API Reference
Chat with the codebase (SSE)
Retrieve connected code context and stream an audience-specific answer over Server-Sent Events.
POST
/chatadmin, userRetrieves the connected code context for message and streams the answer over Server-Sent Events (text/event-stream). Events arrive in order: sources (once, first), token (repeated), done (once, last); an error event terminates the stream.
project_name must match an ingested repo's project name. curl needs -N to see tokens as they arrive.
Body
messagestringrequiredThe question to ask.
project_namestringrequiredMust match an ingested repo's project name.
audienceenumdeveloper | manager | customer. Default developer.
conversation_idstringContinue an existing conversation, or omit to start a new one.
top_kintegerNumber of seed chunks to retrieve (1–50). Default 8.
Request
cURL
bash
curl -N -X POST localhost:8000/chat \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"message":"how does a request move through the system?","project_name":"your-repo","audience":"developer"}'Responses
200An SSE stream (sources → token → done)
json
event: sources
data: [{"entity_type":"Class","qualified_name":"src.http.RequestHandler","file_path":"src/http/request_handler.py","score":0.77,"hop":0,"via":"seed (matched query)"}]
event: token
data: "The request flow"
event: done
data: {"conversation_id":"b0dc2159-...","answer":"The request flow works by ..."}