AI Agents

Build powerful AG2-powered multi-agent systems that can handle complex tasks, automate workflows, and provide intelligent responses across your chat integrations.


What are Agents?

Agents are autonomous AI systems built on the AG2 (AutoGen 2) framework. Unlike simple chatbots, agents can:

  • Execute multi-step tasks - Break down complex requests into manageable steps
  • Use tools and APIs - Access external services, databases, and functions
  • Collaborate with other agents - Work together in multi-agent workflows
  • Maintain context - Remember conversation history and user preferences
  • Follow guardrails - Operate within defined safety boundaries

Creating Your First Agent

Step 1: Access the Agent Builder

  1. Go to Dashboard > Agents
  2. Click Create New Agent or choose from a template

Step 2: Choose a Template (Optional)

Templates provide pre-configured agents for common use cases:

Template Best For
Customer Support Handling inquiries, FAQs, ticket creation
Research Assistant Information gathering, summarization
Code Assistant Code review, debugging help, documentation
Sales Assistant Lead qualification, product information
Data Analyst Data interpretation, report generation

Or start from scratch with Custom Agent for full control.

Step 3: Configure Basic Settings

  • Name: A descriptive name (e.g., "Support Bot", "Research Helper")
  • Description: What this agent does (shown to users)
  • Avatar: Choose an icon or upload a custom image
  • Status: Draft, Active, or Paused

Step 4: Define the System Prompt

The system prompt defines your agent's personality, capabilities, and constraints:

You are a helpful customer support agent for [Company Name].

Your responsibilities:
- Answer product questions accurately
- Help troubleshoot common issues
- Escalate complex problems to human support

Guidelines:
- Be friendly and professional
- Never share customer data with others
- Admit when you don't know something

Tips for effective system prompts: - Be specific about the agent's role - List clear responsibilities - Define boundaries and limitations - Keep it under 8 key instructions for best results

Step 5: Configure Tools (Optional)

Enable tools to extend your agent's capabilities:

Tool Capability
Web Search Search the internet for information
File Access Read uploaded documents
Code Execution Run code snippets
API Calls Connect to external services
Database Query Query your data sources

Step 6: Set Guardrails

Guardrails keep your agent safe and on-topic:

  • Content filters - Block inappropriate content
  • Topic restrictions - Keep conversations focused
  • Rate limits - Prevent abuse
  • Handoff triggers - Escalate to humans when needed

Agent Statuses

Status Meaning
Active Live and responding to messages
Draft In development, not deployed
Paused Temporarily disabled
Training Learning from new data

Deploying Agents

Once configured, deploy your agent to messaging platforms:

  1. Telegram - Connect via bot token
  2. Discord - Add to your server
  3. Slack - Install to workspace
  4. API - Use programmatically via REST API

See Chat Integrations for platform-specific setup.


Multi-Agent Workflows

Create sophisticated systems where multiple agents collaborate:

Example: Customer Support Pipeline

User Message
    
[Triage Agent]  Classifies the request
    
[Support Agent] or [Sales Agent] or [Technical Agent]
    
Response to User

Setting Up Workflows

  1. Create individual agents for each role
  2. Go to Workflows tab
  3. Define routing rules and handoff conditions
  4. Test the workflow with sample messages

Monitoring & Analytics

Track your agent's performance in the dashboard:

  • Total Conversations - Number of chat sessions
  • Messages Processed - Total messages handled
  • Response Time - Average reply speed
  • Confidence Score - How certain the agent is in responses
  • Handoff Rate - Percentage escalated to humans
  • Credit Usage - Tokens and costs consumed
  • Handoff Rate Target: < 5% (lower is better)
  • Confidence Threshold: > 0.7 for autonomous responses
  • Response Time: < 3 seconds for chat platforms

Best Practices

1. Start Simple

Begin with a focused agent for one task, then expand capabilities.

2. Test Thoroughly

Use draft mode to test with sample conversations before going live.

3. Monitor Regularly

Check analytics weekly to identify issues and improvements.

4. Iterate on Prompts

Refine your system prompt based on real conversation data.

5. Set Clear Boundaries

Define what the agent should NOT do as clearly as what it should.

6. Plan for Handoffs

Always have a path to human support for edge cases.


Troubleshooting

Agent Not Responding

  1. Check the agent status is Active
  2. Verify the integration is connected
  3. Check credit balance
  4. Review error logs in dashboard

Poor Quality Responses

  1. Refine the system prompt
  2. Add more specific instructions
  3. Enable relevant tools
  4. Lower the temperature for more focused responses

High Handoff Rate

  1. Expand the knowledge base
  2. Add more example responses
  3. Adjust confidence thresholds
  4. Review handoff triggers

API Access

Use agents programmatically with the External Agent API:

# Chat with an agent
curl -X POST https://neurogen.cc/api/v1/agents/{agent_id}/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello, I need help with..."}'

See API Reference for complete documentation.


Next Steps


Need help? Contact support@neurogen.cc

Connecting