Skip to main content
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

tenant_id
string
required
Unique identifier that corresponds to a dedicated recommendation collection, enabling sub-tenancy isolation for different agentic workflows.
input_text
string
required
The agent’s input/query. This can be a user prompt, or the task given to a sub agent.
agent_type
string
Type of agent making the request (e.g., ‘browser’, ‘orchestrator’). Best used in multi-agent environments.

Example Requests

Response

Success Response

response
string
required
The processed response with enhanced context and recommendations
metadata
object
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

detail
array
required
Array of error details
Example error response:

Status Codes

Error Codes

Best Practices

  1. Request Timing
    • Call this endpoint before agent execution
    • Use it for both main tasks and sub-tasks
  2. Input Text Formatting
    • Keep input text clear and specific
    • Include relevant context
    • Use consistent formatting across requests
  3. Agent Type Usage
    • Always specify agent_type when using multiple agents
    • Use consistent agent type names
    • Document agent types in your system
  4. Error Handling
    • Implement proper retry logic
    • Cache successful responses
    • Handle validation errors gracefully