---
title: "Answer"
method: POST
path: "/api/v2/agents/{agent_id}/answer"
tags: ["Sessions & Agents", "Memory Operations"]
---

# Answer

`POST /api/v2/agents/{agent_id}/answer`

## Request

- The document declares no server URL.
- Auth: none declared

Answer a question using RAG (Session-based)

Requires:
- X-Session-Token: {session_token}

Uses Moorcheh's answer.generate endpoint to produce LLM-generated answers
based on the agent's stored memories.

## Path parameters

- `agent_id` string, required

## Headers

- `x-session-token` string, nullable
- `authorization` string, nullable
- `X-Api-Key` string, nullable

## Cookies

- `memanto_session_token` string, nullable

## Request body

- AnswerRequest: Request body for answer endpoint
  - `question` string, required: Question to ask
  - `limit` integer, nullable: Number of context memories to use
  - `threshold` number, nullable: Confidence threshold (used only in kiosk mode)
  - `temperature` number, nullable: Temperature for the LLM response
  - `ai_model` string, nullable: AI model to use for generating the answer
  - `kiosk_mode` boolean: Kiosk mode setting
  - `source` string, nullable: Slug of the AI tool making this call (e.g. 'claude-code', 'cursor', 'copilot') for session and connection attribution.

## Response `200`

Successful Response

- AnswerResponse
  - `agent_id` string, required
  - `session_id` string, required
  - `question` string, required
  - `answer` string, required
  - `sources` unknown[]
    - unknown
  - `namespace` string, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-28** `20a0f070170b`: 1 info
  - added the new optional request property `source`
- **2026-09-01** `4dbab4daf6d3`: 2 info
  - added the new optional `header` request parameter `X-Api-Key`
  - added the new optional `header` request parameter `authorization`
- **2026-07-09** `6c0f57766d0f`: 1 info
  - added the new optional `cookie` request parameter `memanto_session_token`
- **2026-06-23** `3f3d8570f1a6`: 1 warning
  - deleted the `cookie` request parameter `memanto_session_token`

[Operation history](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/changes/api/v2/agents/:agent_id/answer/post.md)

---

[API](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love.md) - [All operations](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/llms.txt) - [OpenAPI document](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/revisions/ef842776283e?raw)
