Quick Start
Five minutes from a running backend to an agent that chats, analyzes email, creates tasks, and answers questions about your documents.
The backend must be running on port 8001 with a valid OPENAI_API_KEY — see Installation. All examples use curl; you can equally use Swagger UI at http://localhost:8001/docs.
Step 1 — Create an agent
Agents are created with a name, type, system prompt, language, tone, and a comma-separated tool allow-list (tool reference):
curl -X POST http://localhost:8001/agents/ \
-H "Content-Type: application/json" \
-d '{
"name": "Ops Assistant",
"type": "Email Ops",
"description": "Handles inbound email triage and knowledge questions.",
"system_prompt": "You are a precise operations assistant. Answer briefly and concretely.",
"language": "English",
"tone": "Professional",
"enabled_tools": "email_analyzer,task_creator,document_search,reply_generator"
}'The response includes the new agent's id (we assume 1 below):
{
"id": 1,
"name": "Ops Assistant",
"type": "Email Ops",
"enabled_tools": "email_analyzer,task_creator,document_search,reply_generator",
"created_at": "2026-07-16T10:00:00"
}Step 2 — Chat
curl -X POST http://localhost:8001/agents/1/chat \
-H "Content-Type: application/json" \
-d '{"message": "Introduce yourself in one sentence."}'{
"agent_id": 1,
"user_message": "Introduce yourself in one sentence.",
"assistant_response": "I am Ops Assistant, ...",
"run_id": 1,
"latency_ms": 842
}Behind the scenes the backend saved two Message rows (user + assistant) and one AgentRun row with latency and status — the observability contract in action. Inspect them:
curl http://localhost:8001/agents/1/messages
curl http://localhost:8001/agents/1/runsStep 3 — Analyze an email (and auto-create tasks)
Because the agent has both email_analyzer and task_creator enabled, analysis also persists a Task per action item:
curl -X POST http://localhost:8001/agents/1/email/analyze \
-H "Content-Type: application/json" \
-d '{"email_text": "Hi team, we need the Q3 revenue report by Friday. Please also schedule a 30-minute review call with finance next week."}'The response contains the structured analysis and the created tasks:
{
"analysis": {
"summary": "Request for the Q3 revenue report by Friday plus a review call.",
"intent": "request",
"priority": "high",
"deadline": "Friday",
"action_items": ["Prepare Q3 revenue report", "Schedule review call with finance"],
"suggested_reply": "..."
},
"tasks_created": [
{ "id": 1, "title": "Prepare Q3 revenue report", "priority": "high", "status": "open" }
]
}curl http://localhost:8001/agents/1/tasks # list tasks
curl -X PUT http://localhost:8001/agents/tasks/1/status \
-H "Content-Type: application/json" -d '{"status": "completed"}'Step 4 — Run the multi-agent email workflow
The full pipeline adds a dedicated Reply Agent and a Reviewer Agent that scores the result (deep dive):
curl -X POST http://localhost:8001/agents/1/workflows/email \
-H "Content-Type: application/json" \
-d '{"email_text": "Our production API is returning 500s since 09:00 UTC. We need a status update within the hour.", "create_tasks": true}'The response includes analysis, tasks_created, suggested_reply, and a review block:
{
"review": {
"approved": true,
"quality_score": 0.92,
"issues": [],
"recommendation": "Send the reply and start the incident task immediately."
}
}Inspect the recorded run and its per-step trace:
curl http://localhost:8001/agents/1/workflow-runs
curl http://localhost:8001/agents/workflow-runs/1/stepsStep 5 — Upload a document and ask about it
Uploads accept UTF-8 .txt files. The file is chunked, embedded, and indexed in Chroma scoped to this agent (pipeline):
printf "Premium customers have a 4-hour support SLA.\nStandard customers have a 24-hour SLA." > sla.txt
curl -X POST http://localhost:8001/agents/1/documents/upload \
-F "file=@sla.txt"Ask a question — this runs the LangGraph corrective RAG graph, which checks retrieval quality before answering:
curl -X POST http://localhost:8001/agents/1/documents/ask \
-H "Content-Type: application/json" \
-d '{"question": "What is the SLA for premium customers?", "top_k": 3}'{
"question": "What is the SLA for premium customers?",
"answer": "Premium customers have a 4-hour support SLA.",
"sources": [{ "filename": "sla.txt", "document_id": 1, "chunk_index": 0, "score": 0.31 }],
"retrieval_evaluation": { "has_answer": true, "confidence": 0.95, "reason": "..." }
}Ask something the document does not cover and the graph refuses instead of hallucinating:
{ "answer": "I could not find this information in the uploaded documents." }Step 6 — See it all on the dashboard
curl http://localhost:8001/agents/1/dashboardThen open http://localhost:3000/dashboard — the Next.js dashboard renders task counts, tool-call success rate, workflow stats, average latency, estimated tokens/cost, and average quality score for agent 1.
Where to go next
- Tutorials — a structured learning path through every subsystem
- API Reference — all endpoints in detail
- Architecture — how these pieces fit together