memory_add
Store a memory. Several memories in one call -> memories=[{content, topics, ...}]; top-level topics then apply to every item.
BEFORE params decide: (1) TYPE? (2) what search finds this later? (3) happened, or aspirational? (4) WHO must act on it?
TYPE by example: "User prefers dark mode" -> preference "Team chose JWT for auth" -> decision "Config at /etc/app.conf" -> path "Wants to install Windsurf" -> task + topic "aspirational" "API limit 1000/min" -> fact
ADDRESSING: a memory FOR someone is delivered ONLY by signal -- topics/names in content deliver to NO ONE. another agent -> signal:"" (or "owner") your own next session -> signal:""
content: atomic, front-loaded, self-contained. Sentence 1 = subject + WHY, stands alone (it IS the search preview). Present tense. GOOD "User prefers Python backend -- type safety catches bugs early" BAD "Prefers Python" (no subject, no why) BAD "Type safety is why the user picked Python" (subject buried, not front-loaded) Durable output, not scratchpad: no conversation context, no superlatives -- wrong memories poison future retrieval permanently.
topics: words you would SEARCH, not categories. GOOD [docs, api, express] BAD [documentation, path, local]
aspirational (not yet done/built/tried) -> add topic "aspirational", else it reads as fact later. GOOD "Bakes sourdough weekly" -> fact BAD "Wants to try croissants" -> +aspirational
path -> name WHAT lives there. GOOD "Chat backend at /opt/api -- Express+Socket.io" BAD "Workspace at /opt/api"
preference -> first topic "user". +topic "behavioral" = auto-loaded every session.
task -> title + steps[] (milestones, not to-dos), or content with "- [ ]" lines. summary = state/blockers. task_done when all steps complete.
format: topics + macro_topics = single lowercase words; split compounds (bug_fix -> bug, fix).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"topics": "<topics>"
},
"name": "memory_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Parent task/ticket id -> auto-added to topics. e.g. "a1b2c3d4", "GH-142". | |
| type | No | fact=knowledge, preference=user pattern, decision=choice+reason, path=location, task=actionable, task_done=complete, result=an output or finding. | |
| force | No | Skip dup check. Testing only. | |
| steps | No | Task checklist -> "- [ ]" boxes. Requires title. | |
| title | No | Task title (structured). Requires type="task". Not with content. | |
| signal | No | Also signal recipient (email, agent, "owner"). Needs a SHARED collection ("me"/personal rejected up-front — nothing stored). | |
| status | No | Initial task status. Default pending. | |
| topics | Yes | REQUIRED. Then the specific search keywords: single lowercase, no _ or -. First = "user" for preferences. Not macro_topics. | |
| content | No | Memory text — plain prose only, never a serialized object. topics, macro_topics and type are their OWN parameters; put them there, never inside this text. Self-contained: subject + why, front-loaded. e.g. "User prefers Python backend -- catches bugs early with type hints" | |
| summary | No | Task prose: state/blockers/decisions -> "## Summary" block. type task/task_done. Not type="summary" (that is memory_consolidate). | |
| artifact | No | Commit SHA or filename -> auto-added to topics. e.g. "f4e5d6c", "oauth.py". | |
| memories | No | Several memories at once: each item takes the same fields as this call (content, topics, type...). Top-level topics/macro_topics are added to every item. | |
| ephemeral | No | Auto-expire 90d. | |
| collection | No | Shared collection by name. Omit=default. "me"/"personal"/agent name=own namespace; "owner"/"parent"=account primary (member-gated). | |
| expires_at | No | YYYY-MM-DD, or "never". Overrides ephemeral. | |
| macro_topics | No | The project or domain this memory is ABOUT — decide this first. 1-3 lowercase (e.g. gnosis, magi). Optional, but it almost always applies: use it when the memory belongs to a named project; it keeps the label out of the content instead of "GNOSIS: ...". Searched exactly like topics. An empty one is fine and is not an error. |