memory
Manage per-user and per-agent stored context and config: list, add, edit, pin, delete, or assign entries, and read or write an agent profile's configuration.
Instructions
Per-user memory + per-agent memory_config (mirrors /admin/memory). action: get_config (agent_kind -> the active profile's memory_config, defaults-merged) | set_config (agent_kind, config: a nested memory_config dict — same shape agent_profiles.memory_config stores; unlike the HTML form this skips the checkbox/flat-field parsing layer since a tool call already supplies structured JSON) | list (agent_kind, user_id: uuid or email -> that user's ai_user_memory rows) | add (user_id: uuid or email, content, agent_kind; business_id where the build's plugin has businesses) | assign (memory_id, agent_kind=custom: — move a custom-kind memory that belongs to no agent yet to that agent) | edit (memory_id, content — re-embeds via the same embedder the runtime uses; proceeds without an embedding if the embed call fails, same as the handler) | pin (memory_id, pinned=true/false) | delete (memory_id, confirm=true — soft-archive, status='archived').
Each generic agent keeps its own memories: pass agent_kind
`custom:<slug>` (the value the Memory screen's picker uses) to list or
add one agent's. `list` for such an agent also returns
`unassigned_memories`: the user's custom-kind rows saved before memories
were kept per agent, which no agent recalls until assigned.
get_config/set_config target "the active profile for agent_kind in env"
by default. Pass `profile_id` to read/write one SPECIFIC profile's
memory_config instead — a draft, a fork, or a voice specialist (the
voice brain's memory_config lives on the specialist row, which the
agent_kind lookup never reaches). list returns at most `limit`
memories (default 50).Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "memory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Config branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves. | staging |
| limit | No | list: maximum memories to return (1-200). | |
| action | No | Operation to run: get_config | set_config | list | add | edit | pin | delete | assign. The tool description lists what each action needs. | list |
| config | No | set_config: the nested memory_config dict. | |
| pinned | No | true = pin, false = unpin. | |
| confirm | No | false (default) = dry run, nothing changes; true = execute. | |
| content | No | Memory text (add/edit). | |
| user_id | No | User id (`user.id` of the portal's user table; memory also accepts an email). | |
| memory_id | No | ai_user_memory row UUID. | |
| agent_kind | No | Agent whose memory/config to use: a kind, or `custom:<slug>` for one custom agent (each keeps its own memories). | custom |
| profile_id | No | Agent profile UUID (list_profiles / get_profile). | |
| business_id | No | add: tenant id the memory belongs to, where the build's plugin has tenants (optional). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |