Overview
Stream agentic search progress in real-time using Server-Sent Events (SSE). This endpoint provides live updates as the agent plans, searches, and evaluates results.
Event Stream:
Planning reasoning and strategy
Search execution with statistics
Evaluator assessments of result quality
Final results and answer
Benefits:
Build interactive search UIs with live feedback
Monitor agent decision-making process
Track search progress for long-running queries
Debug search strategies
Path Parameters
The unique readable identifier of the collection to search Example: “customer-docs-x7k9m”
Request Body
The natural language search query
Search execution mode: thinking or fast
Filter groups applied to search results
Maximum number of results to return
Response
Returns a Server-Sent Events (SSE) stream with text/event-stream content type.
Event Types
Agent’s reasoning and search strategy {
"type" : "planning" ,
"reasoning" : "The query asks about authentication best practices. I'll search for security documentation and API key management guides." ,
"strategy" : "hybrid_search_with_filters"
}
Search execution with result counts {
"type" : "search" ,
"query" : "authentication best practices" ,
"results_found" : 45 ,
"filters_applied" : true
}
Evaluator’s assessment of result quality {
"type" : "evaluation" ,
"quality_score" : 0.92 ,
"needs_refinement" : false ,
"reasoning" : "Results contain comprehensive authentication documentation"
}
Final results and answer {
"type" : "done" ,
"results" : [ ... ],
"answer" : {
"text" : "Based on the documentation..." ,
"citations" : [{ "entity_id" : "abc123" }]
}
}
Error event if something goes wrong {
"type" : "error" ,
"message" : "Search service unavailable"
}
Example Request
curl -N -X POST https://api.airweave.ai/v1/collections/customer-docs-x7k9m/agentic-search/stream \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{
"query": "What are the authentication best practices?",
"mode": "thinking"
}'
Example Event Stream
data: {"type": "planning", "reasoning": "Query asks about authentication best practices", "strategy": "hybrid_search"}
data: {"type": "search", "query": "authentication best practices", "results_found": 45}
data: {"type": "evaluation", "quality_score": 0.92, "needs_refinement": false}
data: {"type": "done", "results": [...], "answer": {"text": "Based on the documentation...", "citations": [...]}}
Connection Management
Auto-close : Connection closes when search completes or encounters an error
Error handling : Errors are sent as events before closing
Buffering disabled : X-Accel-Buffering: no header disables proxy buffering
The response includes:
Content-Type: text/event-stream
Cache-Control: no-cache, no-transform
Connection: keep-alive
X-Accel-Buffering: no
Access-Control-Allow-Origin: *
Error Responses
AGENTIC_SEARCH feature not enabled for this organization
Collection with the specified readable_id does not exist
Invalid query (empty or invalid parameters)
Query limit exceeded for your organization