MemoryToolset gives an agent an explicit, named memory system. Instead of relying on its context window to remember facts across turns, the agent can write information down by name, recall it later, and search across everything it has stored — a persistent scratchpad for things like user preferences, research findings, or decisions made earlier in a long workflow.
What it’s for
Agents working on long tasks frequently “forget” facts they discovered early in the conversation once those messages scroll out of context.MemoryToolset solves this by giving the agent a key-value store it controls directly:
- Remember facts by name — the agent calls
memory_savewith a descriptive key likeuser_preferred_language - Retrieve exactly what it needs — it calls
memory_recallto fetch a single memory by key - Search when unsure of the key —
memory_searchdoes a case-insensitive substring match across keys, content, and tags - Organise with tags — memories can be grouped with labels like
["user", "preference"]for targeted search - Clean up —
memory_deleteremoves stale memories when they’re no longer relevant
Installation
MemoryToolset is bundled inside @vibesjs/sdk.
Quick start
memory_save to store facts, memory_recall when it needs them back, and memory_search when it wants to find related memories.
Tools exposed
| Tool | What it does |
|---|---|
memory_save | Store a named memory. Upserts by key — calling again with the same key overwrites. |
memory_recall | Retrieve a single memory by exact key. Returns null if not found. |
memory_search | Search across all memories by keyword (key, content, and tags — case-insensitive). |
memory_delete | Remove a memory by key. Returns { removed: true } if it existed. |
memory_list | List all memory keys and tags. Does not include full content to keep token use low. |
memory_save
Stores or updates a memory under the given key. Returns the saved memory as JSON.
memory_recall
Retrieves a single memory by exact key. Returns the memory as JSON, or null if not found.
memory_search
Searches all memories with a case-insensitive substring match across key, content, and all tags. Returns a JSON array (may be empty).
memory_delete
Removes a memory by key. Returns { "removed": true } if it existed, { "removed": false } otherwise.
memory_list
Lists all stored memory keys and their tags — without full content — to keep the response token-efficient.
Takes no parameters.
Default storage: InMemoryStore
By default memories are stored in a Map in process memory. State is reset when the process exits, which is fine for single-session agents:
Persistent storage
Pass any object that implements theMemoryStore interface to persist memories across sessions:
Combining with other toolsets
MemoryToolset composes naturally with TodoToolset and other community toolsets:
With dependency injection
MemoryToolset is generic over TDeps so its type aligns with any agent that uses dependency injection: