dokkaiv0.1.0
API Reference

Chat with the codebase (SSE)

Retrieve connected code context and stream an audience-specific answer over Server-Sent Events.

POST/chatadmin, user

Retrieves 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

messagestringrequired
The question to ask.
project_namestringrequired
Must match an ingested repo's project name.
audienceenum
developer | manager | customer. Default developer.
conversation_idstring
Continue an existing conversation, or omit to start a new one.
top_kinteger
Number 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 ..."}