Build a Customer Support Agent
Create a production-ready customer support agent with a knowledge base, tools, and safety policies. Time: ~15 minutes.
What You Will Build
- A support agent that answers questions from your documentation
- Knowledge base with your FAQ documents
- Tool for creating support tickets
- Budget limits and governance policies for safe operation
Step-by-Step Guide
1
Create a Knowledge Base
Upload your FAQ docs to a knowledge collection.
curl -X POST http://localhost:8000/api/v1/knowledge/collections \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "name": "support-docs", "description": "Customer support FAQ" }'2
Upload Documents
Upload PDF/TXT files with your support documentation.
curl -X POST http://localhost:8000/api/v1/knowledge/collections/COL_ID/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@faq.pdf"3
Register a Ticket Tool
Create a tool that the agent can use to create support tickets.
curl -X POST http://localhost:8000/api/v1/tools \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"name": "create-ticket",
"description": "Create a support ticket for issues requiring human help",
"type": "rest_api",
"safety_level": "moderate",
"input_schema": {
"type": "object",
"properties": {
"title": { "type": "string" },
"description": { "type": "string" },
"priority": { "type": "string", "enum": ["low", "medium", "high"] }
},
"required": ["title", "description"]
}
}'4
Create the Support Agent
Create an agent with the knowledge base and ticket tool.
curl -X POST http://localhost:8000/api/v1/agents \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"name": "customer-support",
"description": "Customer support agent with KB and ticketing",
"model": "gpt-4o",
"system_prompt": "You are a helpful customer support agent. Search the knowledge base first. If you cannot find the answer, create a support ticket and let the customer know their issue has been escalated.",
"tools": ["create-ticket"],
"tags": ["support", "production"]
}'5
Set Budget Limits
Prevent runaway costs with a daily budget.
curl -X POST http://localhost:8000/api/v1/budgets \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "name": "support-budget", "agent_id": "AGENT_ID", "period": "daily", "limit_usd": 25, "action_on_exceed": "block" }'6
Add Governance Policy
Set safety rules for production use.
curl -X POST http://localhost:8000/api/v1/governance/policies \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "name": "support-safety", "agent_id": "AGENT_ID", "rules": [{"type": "token_limit", "max_tokens_per_run": 3000}] }'7
Test Your Agent
Run the agent with a test question!
curl -X POST http://localhost:8000/api/v1/agents/AGENT_ID/run \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "input": "How do I reset my password?" }'Next Steps
Promote your agent to "active" via the Lifecycle tab, then publish it with an embed code to add chat to your website!