Skip to content
4 min read · 776 words

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):

bash
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):

json
{
  "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

bash
curl -X POST http://localhost:8001/agents/1/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Introduce yourself in one sentence."}'
json
{
  "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:

bash
curl http://localhost:8001/agents/1/messages
curl http://localhost:8001/agents/1/runs

Step 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:

bash
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:

json
{
  "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" }
  ]
}
bash
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):

bash
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:

json
{
  "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:

bash
curl http://localhost:8001/agents/1/workflow-runs
curl http://localhost:8001/agents/workflow-runs/1/steps

Step 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):

bash
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:

bash
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}'
json
{
  "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:

json
{ "answer": "I could not find this information in the uploaded documents." }

Step 6 — See it all on the dashboard

bash
curl http://localhost:8001/agents/1/dashboard

Then 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