Stream LazyGraphRAG query results
POST /knowledge-bases/{knowledgeBaseId}/query/stream
Executes a LazyGraphRAG query with iterative LLM relevance testing. Returns citations as Server-Sent Events as they are discovered. The query flow: (1) Query expansion via LLM, (2) Vector search, (3) Community-ordered relevance testing, (4) Stream relevant citations. Budget controls how many chunks are tested (higher = more thorough, more costly).
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Unique identifier for the knowledge base to retrieve
Unique identifier for the knowledge base to retrieve
Request Body
Section titled “Request Body ”object
Search query text
Embedding model to use for this query (defaults to KB’s primary model). Must be configured for this KB.
Maximum number of chunks to evaluate for relevance (1-500, default: 20). Higher budgets find more relevant content but cost more LLM calls.
MongoDB-style metadata filter (e.g., {“status”: “final”, “version”: {“$gt”: 1}})
object
object
object
Responses
Section titled “ Responses ”Server-sent events stream with citation, progress, and stream-complete events
Bad Request - Validation error or invalid input
object
Unauthorized - Authentication required or invalid token
object
Forbidden - Insufficient permissions
object
Not Found - Resource does not exist