Store Knowledge
API reference for the store knowledge endpoint
The /store_knowledge
endpoint allows you to store agent interactions and experiences for future task enhancement.
This endpoint should be used whenever an agent is complete with a task. If your agent spawns sub sub agents, each sub task agent should also call this endpoint once it’s complete.
Base URL
Authentication
Request Body
Root Level Parameters
Unique identifier that corresponds to a dedicated recommendation collection, enabling sub-tenancy isolation for different agentic workflows
The original user query or instruction that initiated the interaction
Array of interaction turns between the agent and the environment/user
Indicates whether the agent completed its task successfully
Specifies the type of agent (e.g., ‘browser’, ‘voice’)
When the interaction occurred (ISO format)
Additional metadata about the interaction
Turn Object Structure
Each turn in the turns
array represents a single interaction step and contains the following fields:
The turn number in the interaction sequence. Must start at 1 and be sequential without gaps. For single-turn agents, this should be 1.
The flattened input the agent sees at this turn. Should include:
- Available tools and options
- Current observations
- Each tool/option should be listed on a new line
The output or action taken by the agent during this turn
What the agent remembers from this turn, such as:
- Values returned from a RAG store
- User intent understanding
- Key context or decisions made
The outcome of the agent’s action, including:
- User interruptions
- Action success/failure
- Any deterministic results
Example Requests
Response
Success Response
Status of the request (will be “accepted”)
Human-readable status message
The tenant ID that was used for the request
Example success response:
Error Response
Error code identifying the type of error
HTTP status code
Human-readable error message
Additional error details when available
Example error response:
Status Codes
Error Codes
Code | Description |
---|---|
validation_error | Request validation failed |
invalid_query | Invalid or missing query |
invalid_turns | Invalid turns array |
invalid_metadata | Invalid metadata format |
storage_error | Error storing knowledge |
internal_error | Internal server error |
Best Practices
-
Turn Numbers
- Ensure turn numbers are sequential
- Always start from 1
- Avoid gaps in the sequence
- For single-turn agents, use turn number 1
-
Input Documentation
- Document all available tools and options in the
inputs
field - List each tool/option on a new line
- Include relevant observations and context
- Document all available tools and options in the
-
Memory Management
- Use the
memory
field to track important context - Include relevant RAG results
- Document key decisions and user intent
- Use the
Authorizations
Body
Agent interaction knowledge to store
Response
Successful Response
The response is of type object
.