HYVE Docs
DumpAPI Reference

Ask a Question

POST/api/rag

Ask a question about your vault content. Returns a streaming SSE response with AI-generated answer and source attribution.

Body

{
  query: string  // Your question (required, min 1 char)
  limit?: number // Max context items (1-20, default 10)
}

Example

curl
curl -X POST "http://localhost:3106/api/rag" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "What are the key benefits of server components?"}' \
  --no-buffer

Response (SSE Stream)

data: {"status":"embedding"}
data: {"status":"searching"}
data: {"status":"thinking"}
data: {"text":"Based on your vault, "}
data: {"text":"server components provide..."}
data: {"done":true,"sources":[{"id":"uuid","title":"RSC Deep Dive","url":"https://...","source_type":"article"}]}

Event Types

EventDescription
statusPipeline progress (embedding, searching, thinking)
textStreamed answer chunk
errorError message if pipeline fails
doneFinal event with sources array

If no relevant content is found, the response will be: "Nao encontrei conteudo relevante no vault para essa pergunta."

Status Codes

CodeDescription
200SSE stream started
400Invalid body or missing query
401Unauthorized

RAG Stats

GET/api/rag/stats

Get statistics about the RAG index.

curl
curl "http://localhost:3106/api/rag/stats"

Response

{
  "totalChunks": 1247,
  "pendingEmbeddings": 3,
  "lastIngest": "2026-02-23T12:00:00Z"
}
FieldDescription
totalChunksTotal chunks in the RAG index
pendingEmbeddingsChunks waiting for embedding generation
lastIngestTimestamp of the most recent document ingestion

On this page