---
title: "Process Agent Input"
method: POST
path: "/enhance_task"
tags: ["agent"]
---

# Process Agent Input

`POST /enhance_task`

Process agent input, enhance it with relevant past knowledge.

This endpoint:
1. Processes the agent's input
2. Searches for relevant past knowledge
3. Enhances the response with recommendations

Args:
    input_data: Agent's input and context with tenant ID (use your API key as the tenant_id)
    agent_type: Optional agent type override

Returns:
    Enhanced response with recommendations

Raises:
    HTTPException: If processing fails

## Request body

- AgentInput — Represents an input from an agent that needs to be processed.
  - `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
  - `context` object — Additional context about the agent's current state
  - `agent_type` string, nullable — Type of agent making the request

## Response `200`

Successful Response

- EnhancedResponse — Response enhanced with relevant past knowledge.
  - `response` string, required — The processed response
  - `metadata` object, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/osmosis/apis/osmosis-agent-improvement-api.md) · [All operations](https://skmtc.net/osmosis/apis/osmosis-agent-improvement-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/osmosis/osmosis-agent-improvement-api/versions/1776d48631c4/schema)
