Creating Your First Agent

Learn how to create and configure powerful AI agents that can handle specialized tasks for your team.

Table of Contents

What You'll Learn

By the end of this guide, you'll know how to:

  • βœ… Create AI agents via UI and API
  • βœ… Write effective system prompts
  • βœ… Select the appropriate model for your use case
  • βœ… Configure visibility and access control
  • βœ… Test and iterate on agent behavior
  • βœ… Set up specialized agents for different tasks

Time to complete: 20-30 minutes

Prerequisites

Before starting, make sure you have:

Understanding Agents

What Are Agents?

Agents are AI assistants that:

  • Execute tasks based on natural language instructions
  • Have specialized knowledge and capabilities
  • Can use tools and access data
  • Maintain context across conversations
  • Work autonomously or interactively

Agent Components

1. Name

  • Identifier for the agent
  • Descriptive and specific
  • Examples: "Code Reviewer", "Content Writer", "Data Analyst"

2. System Prompt

  • Instructions that define the agent's behavior
  • Establishes role, expertise, and guidelines
  • Affects how the agent responds to tasks

3. Model

  • The AI model powering the agent
  • Different models have different capabilities
  • Choice affects speed, cost, and quality

4. Visibility

  • Who can see and use the agent
  • Controls access and collaboration
  • Options: private, organization, public

Screenshot

Creating an Agent

Step 1: Navigate to Agents

  1. Log in to TeamDay
  2. Click "Agents" in the sidebar
  3. Click "+ New Agent" button

Screenshot

Step 2: Enter Basic Information

Name your agent:

  • Be specific and descriptive
  • Use a name that reflects the agent's purpose
  • Examples:
    • βœ… Good: "Python Code Reviewer", "Marketing Content Writer"
    • ❌ Bad: "Agent 1", "My Agent", "Test"

Add a description (optional but recommended):

  • Brief overview of what the agent does
  • Helps team members understand when to use it
  • Example: "Reviews Python code for best practices, security issues, and optimization opportunities"

Screenshot

Step 3: Select a Model

Choose the AI model that powers your agent:

Available Models:

  1. Claude 3.5 Sonnet (Recommended)
    • ID: claude-3-5-sonnet-20241022
    • Best balance of speed, quality, and cost
    • 200K token context window
    • Excellent for general tasks
  2. Claude 3 Opus
    • ID: claude-3-opus-20240229
    • Most capable model
    • Best for complex reasoning
    • Higher cost, slower responses
  3. Claude 3.5 Haiku
    • ID: claude-3-5-haiku-20241022
    • Fastest and most cost-effective
    • Great for simple tasks
    • 200K context window

Model Selection Guide:

Use CaseRecommended Model
Code review, analysisClaude 3.5 Sonnet
Content writingClaude 3.5 Sonnet
Simple Q&AClaude 3.5 Haiku
Complex researchClaude 3 Opus
Data analysisClaude 3.5 Sonnet
Quick responsesClaude 3.5 Haiku

Screenshot

Step 4: Configure System Prompt

The system prompt defines your agent's personality, expertise, and behavior.

Click "Edit System Prompt" and enter your instructions.

See Configuring System Prompts below for detailed guidance.

Screenshot

Step 5: Set Visibility

Choose who can access this agent:

Options:

  1. Private (Default)
    • Only you can see and use this agent
    • Best for personal experiments or sensitive work
  2. Organization
    • All members of your organization can use it
    • Best for team collaboration
  3. Public
    • Anyone with the link can view (read-only)
    • Execution requires organization membership
    • Best for showcasing or sharing demos

Screenshot

Step 6: Create Agent

Click "Create Agent" to finalize.

You'll be redirected to the agent detail page where you can:

  • Test the agent
  • View execution history
  • Modify configuration
  • Add tools and plugins

Screenshot

Method 2: Via API

Create Agent Request:

curl -X POST "https://cc.teamday.ai/api/v1/agents" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Python Code Reviewer",
    "description": "Reviews Python code for best practices and security",
    "systemPrompt": "You are an expert Python developer with 10+ years of experience. Review code for:\n\n1. Best practices and PEP 8 compliance\n2. Security vulnerabilities\n3. Performance optimizations\n4. Code readability and maintainability\n\nProvide specific, actionable feedback with code examples.",
    "model": "claude-3-5-sonnet-20241022",
    "visibility": "organization"
  }'

Response:

{
  "id": "char_abc123xyz",
  "name": "Python Code Reviewer",
  "description": "Reviews Python code for best practices and security",
  "systemPrompt": "You are an expert Python developer...",
  "model": "claude-3-5-sonnet-20241022",
  "visibility": "organization",
  "organizationId": "org_xyz789",
  "createdAt": "2025-01-15T10:00:00Z",
  "updatedAt": "2025-01-15T10:00:00Z",
  "metadata": {}
}

Save the agent ID (char_abc123xyz) for future API calls.

Configuring System Prompts

The system prompt is the most important part of your agent configuration. It defines personality, expertise, and behavior.

Anatomy of a Good System Prompt

1. Role and Expertise

You are a senior software engineer specializing in Python and backend development with 10+ years of experience.

2. Core Responsibilities

Your primary responsibilities are:
- Reviewing code for best practices
- Identifying security vulnerabilities
- Suggesting performance optimizations
- Ensuring code maintainability

3. Communication Style

When providing feedback:
- Be constructive and encouraging
- Provide specific examples
- Explain the "why" behind suggestions
- Prioritize issues by severity

4. Constraints and Guidelines

Guidelines:
- Focus on Python 3.10+ features
- Follow PEP 8 style guide
- Prioritize readability over cleverness
- Consider team coding standards

Example System Prompts

Example 1: Code Reviewer Agent

You are an expert code reviewer with deep knowledge of software engineering best practices, security, and performance optimization.

When reviewing code:

1. **Security**: Identify vulnerabilities (SQL injection, XSS, authentication issues)
2. **Performance**: Spot inefficient algorithms, unnecessary loops, memory leaks
3. **Maintainability**: Check for clear naming, proper abstraction, documentation
4. **Best Practices**: Ensure adherence to language conventions and patterns

Provide feedback in this format:
- πŸ”΄ Critical: Security vulnerabilities or breaking issues
- 🟑 Important: Performance problems or maintainability concerns
- 🟒 Suggestions: Nice-to-have improvements

Always include code examples showing the fix.

Example 2: Content Writer Agent

You are a professional content writer specializing in technical blog posts and marketing copy.

Your writing style:
- Clear and concise
- Engaging and conversational
- Technically accurate but accessible
- SEO-optimized with natural keyword usage

When creating content:
1. Start with a compelling hook
2. Use short paragraphs (2-3 sentences)
3. Include relevant examples and analogies
4. End with a clear call-to-action

Target audience: Software developers and technical decision-makers

Tone: Professional yet friendly, authoritative but approachable

Example 3: Data Analyst Agent

You are a senior data analyst with expertise in statistical analysis, data visualization, and business intelligence.

When analyzing data:
1. Start with exploratory data analysis (EDA)
2. Identify patterns, trends, and anomalies
3. Perform statistical tests when appropriate
4. Create clear, actionable visualizations
5. Provide business recommendations

Present findings in this structure:
- **Summary**: Key insights in 2-3 sentences
- **Analysis**: Detailed breakdown with supporting data
- **Visualization**: Suggest appropriate charts/graphs
- **Recommendations**: Actionable next steps

Use Python (pandas, matplotlib, seaborn) for data work.

System Prompt Best Practices

Do:

  • βœ… Be specific about the agent's role and expertise
  • βœ… Define clear responsibilities and priorities
  • βœ… Specify output format and structure
  • βœ… Include examples of desired behavior
  • βœ… Set boundaries and constraints
  • βœ… Define communication style and tone

Don't:

  • ❌ Be too vague ("You are helpful")
  • ❌ Include contradictory instructions
  • ❌ Make prompts unnecessarily long (keep under 500 words)
  • ❌ Forget to specify output format
  • ❌ Assume context that isn't provided

Testing and Iterating

Initial Test:

  1. Create agent with your prompt
  2. Run 5-10 test queries
  3. Evaluate responses

Iterate:

  1. Identify issues (too verbose, missing key info, wrong tone)
  2. Update system prompt
  3. Test again
  4. Repeat until satisfied

Version Control: Keep track of prompt changes:

# Version 1.0 (2025-01-15)
- Initial prompt

# Version 1.1 (2025-01-16)
- Added output format specification
- Clarified tone and style

# Version 1.2 (2025-01-17)
- Reduced verbosity
- Added priority levels for feedback

Choosing the Right Model

Model Comparison

ModelContextSpeedCostBest For
Claude 3.5 Sonnet200KFastMediumGeneral tasks, balanced quality
Claude 3 Opus200KSlowHighComplex reasoning, critical tasks
Claude 3.5 Haiku200KFastestLowSimple tasks, high volume

When to Use Each Model

Claude 3.5 Sonnet (Default - Best for Most Cases)

  • Code review and generation
  • Content writing
  • Data analysis
  • Customer support
  • General automation

Claude 3 Opus (Premium - Complex Tasks)

  • Advanced research and analysis
  • Critical decision-making
  • Complex problem-solving
  • Legal or medical analysis
  • High-stakes content

Claude 3.5 Haiku (Economy - High Volume)

  • Simple Q&A
  • Data classification
  • Content moderation
  • Quick summaries
  • Routing and triage

Switching Models

You can change the model anytime:

Via UI:

  1. Open agent settings
  2. Select "Model" dropdown
  3. Choose new model
  4. Click "Save"

Via API:

curl -X PATCH "https://cc.teamday.ai/api/v1/agents/char_abc123" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-opus-20240229"
  }'

Setting Visibility

Visibility controls who can access and use your agent.

Visibility Options

1. Private

  • Who can access: Only you
  • Use case: Personal experiments, sensitive work
  • Sharing: Cannot be shared

2. Organization

  • Who can access: All organization members
  • Use case: Team collaboration, shared missions
  • Sharing: Automatic for org members

3. Public

  • Who can access: Anyone with link (view only)
  • Use case: Demos, showcasing, public tools
  • Sharing: Link-based sharing
  • Note: Execution still requires org membership

Changing Visibility

Via UI:

  1. Open agent settings
  2. Select "Visibility" dropdown
  3. Choose new level
  4. Click "Save"

Via API:

curl -X PATCH "https://cc.teamday.ai/api/v1/agents/char_abc123" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "visibility": "organization"
  }'

Testing Your Agent

Interactive Testing

Via UI - Chat Interface:

  1. Navigate to agent detail page
  2. Click "Chat" tab
  3. Enter test message
  4. Review response

Test Scenarios:

Scenario 1: Basic Capability

Message: "Hello! What are you designed to do?"
Expected: Agent describes its role and capabilities

Scenario 2: Specific Task

Message: "Review this Python function: [paste code]"
Expected: Detailed code review with specific feedback

Scenario 3: Edge Case

Message: "Can you help me with JavaScript?"
Expected: Agent either helps or explains it's specialized in Python

Screenshot

API Testing

Execute Agent:

curl -X POST "https://cc.teamday.ai/api/v1/agents/char_abc123/execute" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Review this code: def get_user(id): return db.query(\"SELECT * FROM users WHERE id=\" + id)"
  }'

Response:

{
  "executionId": "exec_xyz789",
  "message": "πŸ”΄ **Critical Security Issue**: SQL Injection Vulnerability\n\nYour code is vulnerable to SQL injection attacks...\n\n**Fix:**\n```python\ndef get_user(id):\n    return db.query(\"SELECT * FROM users WHERE id=?\", (id,))\n```",
  "status": "completed",
  "usage": {
    "inputTokens": 156,
    "outputTokens": 234
  }
}

Evaluation Criteria

Quality Checklist:

  • βœ… Responses are accurate and relevant
  • βœ… Tone matches system prompt
  • βœ… Output format is consistent
  • βœ… Agent stays within its defined role
  • βœ… Handles edge cases gracefully

Advanced Configuration

Adding Metadata

Store additional information with your agent:

curl -X PATCH "https://cc.teamday.ai/api/v1/agents/char_abc123" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "metadata": {
      "version": "1.2",
      "author": "engineering-team",
      "lastReviewed": "2025-01-15",
      "tags": ["code-review", "python", "security"]
    }
  }'

Temperature and Sampling

Control response randomness (coming soon):

{
  "model": "claude-3-5-sonnet-20241022",
  "temperature": 0.7,
  "topP": 0.9,
  "maxTokens": 2000
}

Temperature:

  • 0.0 - Deterministic, focused
  • 0.7 - Balanced (default)
  • 1.0 - Creative, varied

Custom Instructions

Add context-specific instructions:

{
  "customInstructions": {
    "codeReview": "Focus on security and performance",
    "outputFormat": "markdown with code blocks",
    "prioritization": "critical issues first"
  }
}

Best Practices

1. Start Simple, Iterate

Initial Agent:

You are a code reviewer. Review code for bugs and best practices.

After Testing:

You are an expert Python code reviewer specializing in security and performance.

When reviewing code:
1. Check for security vulnerabilities (SQL injection, XSS, etc.)
2. Identify performance bottlenecks
3. Ensure PEP 8 compliance
4. Verify proper error handling

Provide feedback with:
- Issue severity (πŸ”΄ Critical, 🟑 Important, 🟒 Suggestion)
- Specific location in code
- Fixed code example
- Brief explanation

2. Use Descriptive Names

Good Names:

  • βœ… "Python Security Auditor"
  • βœ… "Marketing Blog Writer"
  • βœ… "Customer Support Triager"

Bad Names:

  • ❌ "Agent 1"
  • ❌ "General Helper"
  • ❌ "Test Bot"

3. Document Your Agents

Add descriptions and metadata:

{
  "name": "Python Code Reviewer",
  "description": "Automated code review focusing on security, performance, and best practices for Python 3.10+ codebases",
  "metadata": {
    "purpose": "code-review",
    "languages": ["python"],
    "focusAreas": ["security", "performance", "style"],
    "team": "engineering",
    "version": "2.0"
  }
}

4. Test Thoroughly

Test Matrix:

Test TypeExample
Happy pathNormal, expected input
Edge casesEmpty input, very long input
Invalid inputWrong format, missing data
Boundary casesMax length, special characters

5. Version Control

Track changes to your agents:

# Agent Evolution Log

## v1.0 (2025-01-10)
- Initial creation
- Basic code review capabilities

## v1.1 (2025-01-12)
- Added security focus
- Improved output format

## v1.2 (2025-01-15)
- Added severity levels
- Included code examples in feedback
- Optimized for Python 3.10+

6. Monitor Performance

Track key metrics:

  • Average response time
  • Token usage per execution
  • User satisfaction ratings
  • Common failure patterns

7. Create Specialized Agents

Instead of one general agent, create specialized ones:

Instead of:

  • ❌ "General Purpose Helper"

Create:

  • βœ… "Code Reviewer" (for code tasks)
  • βœ… "Content Writer" (for content tasks)
  • βœ… "Data Analyst" (for data tasks)

Benefits:

  • Better performance on specific tasks
  • Clearer system prompts
  • Easier to maintain and improve

Troubleshooting

Agent Not Responding as Expected

Problem: Agent gives generic responses

Solutions:

  1. Make system prompt more specific
  2. Add concrete examples of desired output
  3. Test with different phrasings
  4. Consider switching to more capable model

Responses Too Verbose

Problem: Agent writes too much text

Solution: Add to system prompt:

Keep responses concise (under 200 words unless more detail is requested).
Use bullet points for lists.

Agent Goes Off-Topic

Problem: Agent doesn't stay within defined role

Solution: Add clear boundaries to system prompt:

IMPORTANT: You ONLY review Python code. If asked about other topics, politely redirect: "I'm specialized in Python code review. For other topics, please consult a different agent."

Inconsistent Output Format

Problem: Agent responses vary in structure

Solution: Specify exact format in system prompt:

Always structure your response as:

## Summary
[1-2 sentence overview]

## Issues Found
[List with severity markers]

## Recommendations
[Specific action items]

High Token Usage

Problem: Executions using too many tokens

Solutions:

  1. Optimize system prompt (remove unnecessary text)
  2. Set max tokens limit
  3. Switch to more efficient model (Haiku)
  4. Break complex tasks into smaller steps

Next Steps

Now that you've created your first agent, explore:

1. Set Up a Workspace

  • Create a space for your agent to work with files
  • Guide: Space Setup

2. Enable Git Integration

3. Install MCP Plugins

  • Add tools and integrations to extend capabilities
  • Guide: MCP Plugins

4. Create Sub-Agents

  • Build specialized agents that work together
  • Guide:

5. Schedule Automated Tasks

Learning Resources

Happy agent building! πŸ€–