> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Remember

> Store a single memory for the agent in the active session namespace.

## Overview

Stores one memory in the agent’s Moorcheh namespace scoped by the active session. Fields are sent as **JSON in the request body** only (no query-string parameters).

## Authentication

API clients do not send an API key or `Authorization` header.

<ParamField header="X-Session-Token" type="string" required>
  Session token from [Activate Agent](/api-reference/sessions/activate-agent). Must match `agent_id`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

## Path Parameters

<ParamField path="agent_id" type="string" required>
  The unique identifier of the agent.
</ParamField>

## Body

<ParamField body="content" type="string" required>
  Memory text to store (max length enforced by the server; typically up to 10,000 characters).
</ParamField>

<ParamField body="type" type="string" default="fact">
  Memory category (e.g. `fact`, `preference`, `instruction`, `decision`, `goal`, …). Must be one of the supported Memanto memory types.
</ParamField>

<ParamField body="title" type="string">
  Optional title (max 100 characters). If omitted, a title is derived from the content.
</ParamField>

<ParamField body="confidence" type="number" default="0.8">
  Confidence between `0.0` and `1.0`.
</ParamField>

<ParamField body="tags" type="array">
  Optional list of tag strings.
</ParamField>

<ParamField body="source" type="string" default="agent">
  Source label for the memory (e.g. `agent`, `user`).
</ParamField>

<ParamField body="provenance" type="string" default="explicit_statement">
  How the memory was obtained: `explicit_statement`, `inferred`, `observed`, `validated`, `corrected`, `imported`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "http://localhost:8000/api/v2/agents/my-agent/remember" \
    -H "X-Session-Token: your_session_token" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "User prefers email communication",
      "type": "preference",
      "confidence": 0.9,
      "tags": ["communication"],
      "source": "agent",
      "provenance": "explicit_statement"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "memory_id": "b7c3cf31-e537-49f1-abc4-c50ac6adeac5",
    "agent_id": "my-agent",
    "session_id": "9f733fdb-ebf2-494e-8eb6-fb3320d6020d",
    "namespace": "memanto_agent_my-agent",
    "status": "queued",
    "confidence": 0.9,
    "provenance": "explicit_statement"
  }
  ```

  ```json 401 - Unauthorized (Missing Token) theme={null}
  {
    "detail": "Missing session token. Use X-Session-Token header."
  }
  ```

  ```json 401 - Unauthorized (Invalid or Expired Token) theme={null}
  {
    "detail": {
      "error": "InvalidSessionToken",
      "message": "Invalid session token: Not enough segments",
      "details": {}
    }
  }
  ```

  ```json 422 - Validation Error (Missing Content) theme={null}
  {
    "detail": [
      {
        "type": "missing",
        "loc": ["body", "content"],
        "msg": "Field required",
        "input": {}
      }
    ]
  }
  ```

  ```json 422 - Validation Error (Bad Confidence) theme={null}
  {
    "detail": [
      {
        "type": "less_than_equal",
        "loc": ["body", "confidence"],
        "msg": "Input should be less than or equal to 1",
        "input": 1.5
      }
    ]
  }
  ```

  ```json 500 - Server Error theme={null}
  {
    "detail": {
      "error": "InternalServerError",
      "message": "An unexpected error occurred",
      "details": {
        "original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
      }
    }
  }
  ```

  ```json 413 - Payload Too Large (Content Too Long) theme={null}
  {
    "detail": {
      "error": "text_too_long",
      "message": "Memory content exceeds maximum length of 10000 characters",
      "actual_length": 12000,
      "max_length": 10000
    }
  }
  ```
</ResponseExample>

## Next Steps

* [Recall](/api-reference/search/recall) to search stored memories
* [Generate AI Answer](/api-reference/ai/generate-ai-answer) using the agent's context
