Enhance Task
API reference for the enhance task endpoint
The /enhance_task
endpoint enriches tasks with relevant knowledge and context to improve agent responses.
This endpoint should be used whenever a user is prompting an agent. If your agent spawns sub sub agents, each sub task should also call this endpoint.
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 agent’s input/query. This can be a user prompt, or the task given to a sub agent.
Type of agent making the request (e.g., ‘browser’, ‘orchestrator’). Best used in multi-agent environments.
Example Requests
Response
Success Response
The processed response with enhanced context and recommendations
Additional metadata about the enhancement process and results
Example success response:
The confidence score in the metadata is currently a simple computation based on our Monte Carlo Tree Search process. While it provides a general indication, it should not be treated as a definitive metric of response quality at this stage. We only provide confidence score if it is below 0.7
Error Response
Array of error details
Example error response:
Status Codes
Error Codes
Code | Description |
---|---|
value_error.missing | Required field is missing |
value_error.json | Invalid JSON in request body |
type_error | Incorrect type for a field |
value_error | Invalid value for a field |
Best Practices
-
Request Timing
- Call this endpoint before agent execution
- Use it for both main tasks and sub-tasks
-
Input Text Formatting
- Keep input text clear and specific
- Include relevant context
- Use consistent formatting across requests
-
Agent Type Usage
- Always specify agent_type when using multiple agents
- Use consistent agent type names
- Document agent types in your system
-
Error Handling
- Implement proper retry logic
- Cache successful responses
- Handle validation errors gracefully
Authorizations
Body
Agent input data including the query text and context
Response
Successful Response
Response enhanced with relevant past knowledge.