TalkCody

AI Agents

Create and configure specialized AI assistants for different tasks

AI Agents

AI Agents are customizable AI assistants that can be configured with specific roles, behaviors, and capabilities. Create specialized agents for different development tasks to maximize productivity.

What is an AI Agent?

An AI agent is a configured instance of an AI model with:

  • System Prompt: Instructions that define the agent's behavior and expertise
  • Assigned Tools: Capabilities the agent can use (file operations, searches, etc.)
  • Default Model: Which AI model powers the agent
  • Custom Rules: Specific guidelines for output format and behavior

Think of agents as specialized team members, each with their own expertise and responsibilities.

Why Use AI Agents?

Benefits

Specialization: Each agent focuses on specific tasks

Code Reviewer → Focuses on code quality, patterns, best practices
Test Generator → Creates comprehensive unit and integration tests
Documentation Writer → Produces clear, well-structured documentation
Bug Finder → Analyzes code for potential issues and vulnerabilities

Consistency: Agents provide consistent behavior based on their configuration

Efficiency: Switch between agents instead of re-explaining context

Tool Control: Grant different capabilities to different agents

Default Agents

TalkCody comes with built-in agents:

General Assistant

  • Purpose: General-purpose coding help
  • Model: User's default model
  • Tools: Full access to all tools
  • Use for: General questions, mixed tasks, exploration

Code Expert

  • Purpose: Advanced code generation and refactoring
  • Model: Best available coding model
  • Tools: File operations, code search
  • Use for: Complex implementations, architecture decisions

Quick Helper

  • Purpose: Fast responses for simple questions
  • Model: Fast model (Haiku, GPT-4.1 Turbo)
  • Tools: Limited tools for speed
  • Use for: Quick questions, syntax help, simple explanations

Creating Custom Agents

  1. Open TalkCody
  2. Click on the Agents tab in the sidebar
  3. Click + New Agent

Configure Basic Settings

Agent Name

  • Descriptive name (e.g., "React Expert", "API Tester")
  • Appears in the agent selector

Description (optional)

  • Brief explanation of the agent's purpose
  • Helps you remember what each agent does

Write the System Prompt

The system prompt defines the agent's behavior:

Example: Code Reviewer Agent

You are an experienced code reviewer focused on quality and best practices.

When reviewing code:
1. Check for bugs and logic errors
2. Evaluate code style and consistency
3. Suggest performance improvements
4. Identify security vulnerabilities
5. Recommend better patterns when applicable

Always:
- Be constructive and specific
- Explain the reasoning behind suggestions
- Provide code examples for improvements
- Prioritize critical issues over style preferences

Good system prompts are specific, actionable, and include examples of desired behavior.

Select Model

Choose which AI model powers this agent:

  • GPT-4.1: Excellent all-around performance
  • Claude 4.5 Sonnet: Strong reasoning and code understanding
  • Qwen 3 Coder: Specialized for code generation
  • Claude Haiku: Fast responses for simple tasks

Different models can be optimal for different agent types.

Assign Tools

Select which tools the agent can use:

File Tools

  • ✅ Read File: Read project files
  • ✅ Write File: Create new files
  • ✅ Edit File: Modify existing files
  • ⚠️ Delete File: Remove files (use cautiously)

Search Tools

  • ✅ Code Search: Search through codebase
  • ✅ File Search: Find files by name/pattern
  • ✅ Web Search: Search the internet

Execution Tools

  • ✅ Bash Tool: Execute terminal commands
  • ✅ Web Crawl: Fetch web page content

Other Tools

  • ✅ Call Agent: Invoke other agents
  • ✅ Todo Write: Manage task lists

Grant only necessary tools. Limiting tools reduces the chance of unintended actions.

Save and Test

  1. Click Save Agent
  2. Select the agent in a chat conversation
  3. Test it with relevant prompts
  4. Refine the configuration based on results

Agent Configuration Examples

1. Test Generator Agent

Purpose: Create comprehensive unit tests

System Prompt:

You are a testing expert specialized in writing comprehensive unit tests.

For each function or component you test:
1. Test happy path scenarios
2. Test edge cases and boundary conditions
3. Test error handling
4. Mock external dependencies
5. Use descriptive test names

Follow these conventions:
- Use Jest/Vitest syntax
- Organize tests with describe/it blocks
- Include setup and teardown when needed
- Aim for 80%+ code coverage
- Write tests that are maintainable and clear

Model: Claude 4.5 Sonnet (good reasoning) Tools: Read File, Write File, Code Search

2. Documentation Writer Agent

Purpose: Write clear technical documentation

System Prompt:

You are a technical writer focused on creating clear, comprehensive documentation.

When writing documentation:
1. Start with a clear overview
2. Include code examples
3. Explain parameters and return values
4. Document edge cases and gotchas
5. Use consistent formatting

Format:
- Use Markdown
- Include table of contents for long docs
- Add code blocks with syntax highlighting
- Use callouts for important notes
- Keep language clear and concise

Model: GPT-4.1 (strong language capabilities) Tools: Read File, Write File, Code Search

3. Bug Finder Agent

Purpose: Identify bugs and security issues

System Prompt:

You are a security-conscious code analyst focused on finding bugs and vulnerabilities.

When analyzing code, look for:
1. Logic errors and edge cases
2. Security vulnerabilities (XSS, SQL injection, etc.)
3. Memory leaks and performance issues
4. Race conditions and concurrency bugs
5. Error handling gaps

For each issue found:
- Explain the problem clearly
- Show the exact location (file and line)
- Explain the potential impact
- Provide a fix or mitigation
- Rate severity (Critical/High/Medium/Low)

Model: Claude 4.5 Opus (deep reasoning) Tools: Read File, Code Search

4. API Designer Agent

Purpose: Design RESTful APIs

System Prompt:

You are an API design expert focused on creating well-structured REST APIs.

When designing APIs:
1. Follow REST principles
2. Use appropriate HTTP methods
3. Design intuitive URL structures
4. Include proper error responses
5. Consider versioning from the start

Provide:
- Endpoint definitions with methods
- Request/response examples
- Status code documentation
- Authentication/authorization approach
- OpenAPI/Swagger schema when applicable

Model: GPT-4.1 Tools: Write File, Web Search (for best practices)

5. Refactoring Specialist Agent

Purpose: Improve code structure and quality

System Prompt:

You are a refactoring expert focused on improving code quality without changing behavior.

When refactoring:
1. Identify code smells
2. Extract repeated code into functions
3. Improve naming for clarity
4. Simplify complex logic
5. Apply appropriate design patterns

Always:
- Maintain existing functionality
- Preserve test coverage
- Explain each refactoring step
- Show before/after comparisons
- Consider performance implications

Model: Claude 4.5 Sonnet Tools: Read File, Edit File, Code Search

Advanced Agent Features

Dynamic Prompts

Dynamic prompts can include variables that change based on context:

You are a {language} expert specialized in {framework}.

Current project: {project_name}
Primary language: {language}
Framework: {framework}

...

Variables are automatically replaced with actual values when the agent runs.

Agent Chaining

Agents can call other agents using the "Call Agent" tool:

Example workflow:

  1. Planner Agent: Breaks down the task into steps
  2. → Calls Code Generator Agent: Implements each step
  3. → Calls Test Generator Agent: Creates tests
  4. → Calls Code Reviewer Agent: Reviews everything

Agent chaining enables complex multi-step workflows with specialized expertise at each stage.

Output Format Configuration

Configure how agents structure their responses:

Structured Output Example:

For code review, respond in this format:

## Summary
[Brief overview]

## Critical Issues
- [Issue 1]
- [Issue 2]

## Suggestions
- [Suggestion 1]
- [Suggestion 2]

## Examples
[Code examples]

Managing Agents

Editing Agents

  1. Navigate to Agents view
  2. Select an agent from the list
  3. Click Edit
  4. Modify settings
  5. Save changes

Duplicating Agents

Create variations quickly:

  1. Select an agent
  2. Click Duplicate
  3. Modify the duplicate
  4. Save as new agent

Deleting Agents

  1. Select an agent
  2. Click Delete
  3. Confirm deletion

Deleting an agent does not delete conversations where it was used. Past conversations remain intact.

Best Practices

System Prompt Writing

Do:

  • Be specific about expected behavior
  • Include examples of good responses
  • Define output format clearly
  • List specific tasks or checks to perform
  • Explain the agent's role and expertise

Don't:

  • Be vague or overly general
  • Contradict the model's capabilities
  • Include unnecessary personality traits
  • Make prompts too long (under 500 words is ideal)

Tool Selection

Principle of Least Privilege:

  • Grant only necessary tools
  • Restrict destructive operations
  • Consider read-only agents for analysis tasks

Example:

Code Reviewer Agent:
✅ Read File (needed to review code)
✅ Code Search (needed to check patterns)
❌ Edit File (should only suggest, not change)
❌ Delete File (no need to delete)

Model Selection

Match the model to the agent's task:

  • Complex reasoning: Claude 4.5 Opus, GPT-5
  • Code generation: Qwen 3 Coder, GPT-4.1, Claude 4.5 Sonnet
  • Fast responses: Claude Haiku, GPT-4.1 Turbo
  • Budget tasks: DeepSeek, GLM 4.5 Air

Testing Agents

Always test new agents:

  1. Create test conversations
  2. Try edge cases
  3. Verify tool usage is appropriate
  4. Refine system prompt based on results
  5. Compare with other models if needed

Troubleshooting

Agent Not Following Instructions

  • Make system prompt more explicit
  • Add examples of desired behavior
  • Try a different model (Claude models often better at following instructions)
  • Reduce prompt complexity

Agent Using Wrong Tools

  • Review which tools are enabled
  • Make tool usage expectations clear in system prompt
  • Consider removing tools that shouldn't be used

Responses Too Generic

  • Add more specific context to system prompt
  • Include domain-specific terminology
  • Provide examples of ideal responses

Agent Too Slow

  • Switch to a faster model
  • Reduce tool count
  • Simplify system prompt

Next Steps

Well-configured agents can dramatically improve your development workflow. Experiment with different configurations to find what works best for your needs!