bash-A v2

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

MethodPathPurpose
POST/api/ingestUpload a PDF and stream stage progress using SSE.
GET/api/documentsList indexed documents and chunk totals.
DELETE/api/documents/:nameDelete a document and invalidate related caches.

Upload and delete use the optional X-Demo-Token guard when DEMO_TOKEN is configured.

Search and inspection

MethodPathPurpose
GET/api/searchSearch vector results, graph results, or both.
GET/api/vectorsReturn sampled 3D-reduced vectors and neighbor data.
GET/api/graph/statsReturn graph counts and summary statistics.
GET/api/graph/relationshipsReturn a sample of graph relationships.
GET/viewRender 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

MethodPathPurpose
POST/api/chatRun the agent and stream its answer through SSE.
POST/api/feedbackRate an assistant message with -1 or 1.
GET/api/analyticsReturn 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.

On this page