Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.litellm-agent-platform.ai/llms.txt

Use this file to discover all available pages before exploring further.

Memories are per-agent text snippets injected into the agent’s context at session start. They are intended for facts, preferences, and instructions that the agent should remember across sessions — for example, a user’s coding style or a recurring project convention. Memories can be searched with a keyword query (?q=) or filtered by tag (?tag=). When the harness’s search_memory tool calls GET /memory?q=..., the platform automatically bumps times_applied and last_applied_at on the returned rows so you can track which memories are actually being used.

Endpoints

MethodPathDescription
GET/api/v1/managed_agents/agents/{agent_id}/memoryList memories
POST/api/v1/managed_agents/agents/{agent_id}/memoryCreate a memory
PATCH/api/v1/managed_agents/agents/{agent_id}/memory/{memory_id}Update a memory
DELETE/api/v1/managed_agents/agents/{agent_id}/memory/{memory_id}Delete a memory

List memories

GET /api/v1/managed_agents/agents/{agent_id}/memory
Returns all memories for the agent. Use query parameters to narrow results. Query parameters
q
string
Case-insensitive substring search against memory text. When provided, only memories whose text contains this string are returned.
tag
string
Filter to memories whose tags array includes this exact tag value.
Both q and tag can be combined — results must satisfy both conditions. Returns an array of ApiMemory objects.

Create a memory

POST /api/v1/managed_agents/agents/{agent_id}/memory

Body parameters

text
string
required
The memory content to store. Must be at least one character.
tags
string[]
Up to 8 tags for categorizing and filtering this memory.
type
string
Optional free-form type label, e.g. preference, fact, instruction.
priority
number
Integer priority used to order memories when multiple are injected. Higher values are injected first.
source
string
Origin of the memory. One of: agent, slack, ui. Defaults to ui when called from the API. The harness sets agent; integrations like Slack set slack.
Returns the new ApiMemory object.

Update a memory

PATCH /api/v1/managed_agents/agents/{agent_id}/memory/{memory_id}
All fields are optional. Only fields you include are updated.
text
string
New memory content.
tags
string[]
New tag list. Replaces the existing tags.
type
string
New type label.
priority
number
New priority integer.
disabled
boolean
Set to true to suppress this memory without deleting it. A disabled memory is excluded from context injection and search_memory results but remains in the database for audit purposes.
Returns the updated ApiMemory object.

Delete a memory

DELETE /api/v1/managed_agents/agents/{agent_id}/memory/{memory_id}
Hard-deletes the memory row. Consider disabling (disabled: true) instead of deleting if you may want to restore the memory later. Returns 204 No Content.

ApiMemory response fields

id
string
Unique memory ID.
agent_id
string
ID of the agent this memory belongs to.
text
string
The memory content.
tags
string[]
List of tag strings.
type
string
Type label.
priority
number
Injection priority. Higher values are injected first.
disabled
boolean
When true, this memory is suppressed from context injection and search without being deleted.
times_applied
number
Number of times this memory has been returned by a GET /memory?q= search (i.e. how often the harness’s search_memory tool has fetched it).
last_applied_at
string | null
ISO 8601 timestamp of the last time this memory was returned in a search. null if never searched.
source
string
Origin of the memory: agent, slack, or ui.
created_at
string
ISO 8601 creation timestamp.

Example: create and list memories

curl -X POST "https://<your-platform-host>/api/v1/managed_agents/agents/agt_01j9xyz/memory" \
  -H "Authorization: Bearer $MASTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Always use TypeScript strict mode in this project.",
    "tags": ["typescript", "style"],
    "type": "instruction",
    "priority": 10
  }'
{
  "id": "mem_01n5xyz",
  "agent_id": "agt_01j9xyz",
  "text": "Always use TypeScript strict mode in this project.",
  "tags": ["typescript", "style"],
  "type": "instruction",
  "priority": 10,
  "disabled": false,
  "times_applied": 0,
  "last_applied_at": null,
  "source": "ui",
  "created_at": "2025-05-01T13:00:00.000Z"
}