Skip to main content

Ask SABLE

Ask SABLE is the shared chat widget injected by web/app-shell.js and served by:

POST /api/chat

It is intentionally read-only.

Request

{
"question": "What are the open promises for Granite?",
"as": "all"
}

as is honored only for admin/lead users. Other users are pinned to their own identity and project memberships.

Context

In Supabase mode, /api/chat loads the scoped spine with scopedSpine() and retrieves relevant knowledge chunks through the shared RAG service. The service embeds the query with Voyage voyage-4, calls match_knowledge_chunks_scoped, reranks candidates with Voyage rerank-2.5, balances top results by source, expands each match with neighboring chunks, and returns citation-ready evidence.

The model prompt tells SABLE to:

  • Answer only from scoped context.
  • Say when the answer is outside scope or not ingested.
  • Cite retrieved evidence citations exactly.
  • Never write or mutate state.

Model

The chat route currently uses claude-haiku-4-5 through the Anthropic Messages API for fast scoped answers.

Failure Modes

  • 401: missing or invalid Supabase session.
  • 400: empty question.
  • 500: spine load error.
  • 502: model API error.

If embeddings are unavailable, retrieval becomes a graceful no-op for chat and SABLE still answers from the structured spine. /api/search fails closed with 503 because search requires embeddings.