Agent Configuration
Advanced configuration for AI agents
Agent Configuration
Advanced settings for configuring and managing AI agents in TalkCody.
Overview
Agent configuration allows you to:
- Fine-tune agent behavior
- Manage tool permissions
- Configure dynamic prompts
- Set agent-specific parameters
- Control agent visibility and defaults
Agent Settings
Basic Configuration
Agent Name
- Unique identifier for the agent
- Appears in agent selector
- Should be descriptive (e.g., "React Expert", "Python Debugger")
Description
- Optional longer explanation
- Helps identify agent purpose
- Shown in agent list and tooltips
Agent Type
- User Agent: Visible to users, selectable in chat
- System Agent: Hidden, used internally
- Template Agent: Starting point for new agents
System Prompt
The system prompt is the most important configuration.
Structure:
[Role Definition]
You are a [role] specialized in [domain].
[Behavior Guidelines]
When [condition]:
1. [Action 1]
2. [Action 2]
3. [Action 3]
[Output Format]
Respond using this format:
- [Format specification]
[Constraints]
Always:
- [Requirement 1]
- [Requirement 2]
Never:
- [Restriction 1]
- [Restriction 2]Best practices:
- Be specific and concrete
- Include examples
- Define expected output format
- List both requirements and restrictions
- Keep under 1000 words for efficiency
Dynamic Prompts
Use variables that get replaced at runtime:
Available variables:
{project_name} - Current project name
{language} - Primary programming language
{framework} - Main framework
{file_path} - Current file being edited
{file_type} - File extension
{timestamp} - Current date/time
{user_name} - User's name
{workspace_path} - Project directory pathExample:
You are a {language} expert working on the {project_name} project.
Current context:
- Framework: {framework}
- File: {file_path}
- Time: {timestamp}
Provide {language}-specific advice following {framework} best practices.When to use:
- Multi-project workflows
- Language-specific agents
- Context-dependent behavior
- Time-based responses
Dynamic prompts make agents more versatile and context-aware.
Model Configuration
Default Model
Assign specific model to agent:
Options:
- Use Global Default: Inherits from general settings
- Specific Model: Always use assigned model
- User Choice: Let user select per conversation
Recommendations:
Code Generator → Qwen 3 Coder
Code Reviewer → Claude 4.5 Sonnet
Quick Helper → Claude Haiku
Documentation → GPT-4.1
Test Writer → Claude 4.5 Sonnet
Bug Finder → Claude 4.5 OpusModel Parameters
Override global settings per agent:
Temperature
Code Generator: 0.2 (deterministic)
Creative Writer: 0.9 (varied)
General Helper: 0.7 (balanced)Max Tokens
Quick Answers: 512 tokens
Normal: 2048 tokens
Long-form: 4096+ tokensCustom Parameters
- Top P
- Frequency Penalty
- Presence Penalty
- Stop Sequences
Tool Configuration
Tool Permissions
Control which tools each agent can use:
File Tools
- ✅ Read File: Safe, usually enable
- ⚠️ Write File: Consider per agent
- ⚠️ Edit File: Consider per agent
- ❌ Delete File: Rarely needed
Search Tools
- ✅ Code Search: Usually safe
- ✅ File Search: Usually safe
- ⚠️ Web Search: May slow responses
Execution Tools
- ⚠️ Bash Tool: Powerful but risky
- ⚠️ Web Crawl: May be slow
Agent Tools
- ✅ Call Agent: Enable for workflows
- ✅ Todo Write: Useful for planning
MCP Tools
- Configure per MCP server
- Enable selectively
- Consider security implications
Tool Configuration Examples
Read-Only Analyst
✅ Read File
✅ Code Search
✅ File Search
❌ Write File
❌ Edit File
❌ Delete File
❌ Bash ToolCode Generator
✅ Read File
✅ Write File
✅ Edit File
❌ Delete File
✅ Code Search
❌ Bash ToolFull-Access Assistant
✅ All file tools
✅ All search tools
✅ Bash Tool (with confirmation)
✅ Web tools
✅ MCP toolsTool Behavior Settings
Confirmation Requirements
File Write: Always confirm
File Edit: Confirm for >10 lines
File Delete: Always confirm
Bash Execution: Always confirmTool Timeouts
File Operations: 5s
Code Search: 10s
Web Crawl: 30s
Bash Commands: 60sTool Limits
Max Files to Read: 10 per request
Max Search Results: 100
Max Bash Output: 10KBOutput Configuration
Output Format
Define how agent responses should be structured:
Markdown Templates
## Summary
[Brief overview]
## Analysis
[Detailed analysis]
## Recommendations
1. [Recommendation 1]
2. [Recommendation 2]
## Code Examples
```[language]
[Code here]
```JSON Responses
For structured data requests, respond in JSON:
{
"status": "success|error",
"data": { ... },
"message": "..."
}Code-Only Mode
For code generation requests:
- Provide only code, no explanations
- Include brief inline comments
- No markdown, just the codeLanguage Settings
Response Language
Settings → Agent → Response Language
Options: English, Chinese, Japanese, etc.Code Style
Indentation: 2 spaces / 4 spaces / tabs
Quote Style: single / double
Semicolons: always / never / auto
Trailing Commas: always / never / es5Advanced Features
Agent Chaining
Configure agents to call other agents:
Enable Chaining
Settings → Agent → Enable Agent CallsChain Configuration
Agent: Planner
Can Call: [Code Generator, Test Writer, Reviewer]
Max Chain Depth: 3Example workflow:
1. Planner Agent breaks down task
2. → Calls Code Generator for implementation
3. → Calls Test Writer for tests
4. → Calls Reviewer for validation
5. Returns complete solutionChain limits:
- Max depth: 5 levels
- Max calls: 10 per chain
- Timeout: 300s per chain
Context Management
Message History
Include in Context:
○ All messages
● Last 10 messages
○ Last N tokens
○ Smart compressionFile Context
Auto-include:
☑ Current open file
☐ Related files
☐ Recently edited files
☐ Files mentioned in conversationProject Context
☑ Project name and path
☑ Primary language
☑ Framework information
☐ All package.json/dependencies
☐ README contentConditional Behavior
Define behavior based on conditions:
File Type Rules
IF file_type == ".ts" OR file_type == ".tsx":
Use strict TypeScript types
Suggest React patterns
IF file_type == ".py":
Follow PEP 8
Use type hintsProject Rules
IF framework == "React":
Suggest functional components
Recommend hooks over classes
IF framework == "Vue":
Use Composition API
Follow Vue style guideAgent Templates
Creating Templates
Save agent configurations as templates:
- Configure agent completely
- Click Save as Template
- Name the template
- Template available for new agents
Use cases:
- Team standardization
- Quick agent creation
- Best practice sharing
Importing/Exporting
Export Agent
{
"name": "Python Expert",
"systemPrompt": "...",
"model": "claude-4.5-sonnet",
"temperature": 0.7,
"tools": ["readFile", "writeFile", "codeSearch"],
"maxTokens": 2048
}Share with team:
- Export agent to JSON
- Share file with team
- Team members import
- Consistent agent across team
Agent Management
Agent Organization
Folders/Categories
📁 Code Assistants
- Python Expert
- JavaScript Pro
- Rust Developer
📁 Reviewers
- Code Reviewer
- Security Auditor
- Performance Analyzer
📁 Specialists
- Test Generator
- Documentation Writer
- API DesignerAgent Versioning
Track agent changes:
- Enable version history
- Compare versions
- Rollback to previous
- Export specific version
Default Agent
Set default agent for:
- New Conversations: Auto-selected
- File Type: Different defaults per language
- Project: Project-specific defaults
Default: General Assistant
TypeScript files: TypeScript Expert
Python files: Python Expert
Test files: Test HelperPerformance Optimization
Response Speed
For faster agents:
- Use fast models (Haiku, GPT-4.1 Turbo)
- Reduce max tokens
- Limit tool access
- Minimize system prompt
Cost Optimization
For cheaper agents:
- Use budget models
- Lower max tokens
- Enable smart compression
- Reduce tool calls
Quality vs Speed
Balanced configuration:
Quick Tasks: Claude Haiku, 512 tokens
Normal: Claude 4.5 Sonnet, 2048 tokens
Complex: Claude 4.5 Opus, 4096 tokensTroubleshooting
Agent Not Following Instructions
Solutions:
- Make system prompt more explicit
- Add examples of desired behavior
- Try different model (Claude often better)
- Reduce prompt complexity
- Test iteratively
Agent Using Wrong Tools
Check:
- Tool permissions in config
- System prompt mentions tools correctly
- Tool confirmations are enabled
- MCP tools are accessible
Inconsistent Behavior
Causes:
- Temperature too high
- Dynamic variables not resolving
- Model switching
- Context not maintained
Fixes:
- Lower temperature
- Verify variable syntax
- Pin to specific model
- Check context settings
Next Steps
- AI Agents - Using agents in practice
- Model Settings - Configure models
- MCP Configuration - Add custom tools
Well-configured agents dramatically improve productivity. Take time to optimize your agent setup!