API reference
HTTP routes exposed by FastAPI and the primary use of each route.
The API listens on port 8000 in local development. JSON endpoints use the /api prefix; / and /view are browser-facing pages. The live FastAPI schema is at /docs on the API host and is the source of truth for exact request and response schemas.
Ingestion and documents
| Method | Path | Purpose |
|---|---|---|
POST | /api/ingest | Upload a PDF and stream stage progress using SSE. |
GET | /api/documents | List indexed documents and chunk totals. |
DELETE | /api/documents/:name | Delete a document and invalidate related caches. |
Upload and delete use the optional X-Demo-Token guard when DEMO_TOKEN is configured.
Search and inspection
| Method | Path | Purpose |
|---|---|---|
GET | /api/search | Search vector results, graph results, or both. |
GET | /api/vectors | Return sampled 3D-reduced vectors and neighbor data. |
GET | /api/graph/stats | Return graph counts and summary statistics. |
GET | /api/graph/relationships | Return a sample of graph relationships. |
GET | /view | Render the vector viewer. |
Search accepts a query and parameters for sources, retriever, result count, and optional document scope. Use the live OpenAPI page for exact parameter names and validation rules.
Chat, feedback, and analytics
| Method | Path | Purpose |
|---|---|---|
POST | /api/chat | Run the agent and stream its answer through SSE. |
POST | /api/feedback | Rate an assistant message with -1 or 1. |
GET | /api/analytics | Return feedback, confidence, and query summaries. |
Feedback and analytics use the optional demo-token guard. The guard does not provide general API authorization.
Chat stream
The stream emits named events such as stage, plan, step, citations, token, and done. A decline can report supported: false without token events. Clients should read the event types in src/lib/api-types.ts and parse complete SSE frames rather than assuming a network chunk equals an event.