Skip to main content
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_save with a descriptive key like user_preferred_language
  • Retrieve exactly what it needs — it calls memory_recall to fetch a single memory by key
  • Search when unsure of the keymemory_search does 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 upmemory_delete removes stale memories when they’re no longer relevant
This is especially useful for personal assistant agents, research workflows, multi-session agents, and any scenario where important facts need to outlive a single context window.

Installation

No extra package needed — MemoryToolset is bundled inside @vibesjs/sdk.

Quick start

The agent will autonomously call memory_save to store facts, memory_recall when it needs them back, and memory_search when it wants to find related memories.

Tools exposed

memory_save

Stores or updates a memory under the given key. Returns the saved memory as JSON.
Example model call:

memory_recall

Retrieves a single memory by exact key. Returns the memory as JSON, or null if not found.
Example model call:
Searches all memories with a case-insensitive substring match across key, content, and all tags. Returns a JSON array (may be empty).
Example model call:

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 the MemoryStore 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:

Types

Memory

MemoryStore