Query Knowledge Engine
Streams a response to a natural language query using Server-Sent Events
Query a knowledge engine with a natural language question. This endpoint uses Server-Sent Events (SSE) to stream the response back to the client.
Request Format
The natural language query to ask the knowledge engine
A name for this query workflow
Example Request
Response Format
The response is streamed using Server-Sent Events (SSE) with the following event types:
message
: Contains intermediate response chunks as they are generatederror
: Contains error messages if something goes wrongdone
: Final event containing the complete response with metadata
Example Response Stream
Notes
- The streaming response allows for real-time display of the AI’s response as it’s being generated
- The final
done
event includes the complete response along with metadata and citations - If an error occurs, the stream will emit an
error
event and close the connection - Clients should handle connection closure appropriately using the
close
event
The streaming response requires a client that supports Server-Sent Events (SSE). Most modern browsers and HTTP clients support this feature.
Response Object
Unique identifier for the workflow
Name of the workflow
The original query that was asked
Type of workflow (always “query”)
ID of the knowledge engine that was queried
Status of the workflow (“processed” when complete)
The complete response text
Array of citations supporting the response
Unix timestamp when the workflow was created
Path Parameters
Knowledge engine ID
Body
Name of the workflow
The natural language query
Response
The response is of type string
.