Chat
The chat tool lets an agent hold a conversation with a knowledge base. Answers are generated from the content of the KBase you name, and the conversation history is kept on the server so that follow-up questions understand what has already been said. Answers can also be limited to the knowledge that existed at a given point in time.
Chat
Try it
Sends a message to a knowledge base and returns the assistant's reply. Pass a
sessionId to keep the conversation going across several calls, and an
iso8601extendedTime to answer only from knowledge that existed at that time.
Parameters
| Name | Type | Description |
|---|---|---|
indexId | string | The Id of the KBase to chat with. |
message | string | The user's message. |
sessionId | string (optional) | An identifier that ties this message to an existing conversation. If omitted, a fresh conversation is started. |
iso8601extendedTime | string (optional) | A time in ISO 8601 Extended format, where negative years are BCE. The answer is drawn only from knowledge in existence at that time. If omitted, the whole knowledge base is used. |
Returns
The assistant's response as text.
Filtering by time
When iso8601extendedTime is supplied, content whose
existence does not cover that time is left out of the answer, so
the assistant replies as it would have done with the knowledge of that moment. Dates are
written in ISO 8601 Extended form, such as 1815-06-18 or
-0044-03-15 for 15 March 44 BCE. The filter applies to a single call: send
it with every message that should be answered in that way.
How the answer is produced
The server picks the way it answers from the form of the knowledge base. A knowledge base built by indexing documents is answered from the passages of that content; a node-first knowledge base, assembled node by node, is answered from its knowledge graph instead. The choice is made for you on every call, so the tool is used in the same way either way. A node-first KBase must have been indexed with IndexNodeKBase for its newest nodes to be drawn on.
Conversation history
History is stored per user, per knowledge base and per session, and expires after
24 hours without use. To continue a conversation, send the same
sessionId with each message; to start again from scratch, send a new one (or
none at all). Because history is held on the server, an agent does not need to resend
earlier turns.
Notes
The indexId and message are both required; a call missing either
fails. If the underlying model cannot answer, the tool reports that an error occurred while
processing the chat request.