Skip to main content

Overview

Memory tools provide access to persistent, database-backed workspace storage. This is separate from the local filesystem and designed for agent memory, decisions, context, and long-term knowledge.
Use memory_* tools for workspace storage (HEARTBEAT.md, MEMORY.md, daily logs, etc.). Use read_file/write_file for local filesystem operations.

Tools

Search past memories, decisions, and context using hybrid search (full-text + semantic). Returns relevant snippets with relevance scores.
MUST be called before answering questions about prior work, decisions, dates, people, preferences, or todos.
Input Parameters
string
required
The search query. Use natural language to describe what you’re looking for.
integer
default:5
Maximum number of results to return (min: 1, max: 20)
Output
string
The original search query
array
Array of search results with content, score, document ID, and match type
integer
Number of results returned
Result Object
string
Relevant snippet from the document
number
Relevance score (higher is more relevant)
string
UUID of the source document
boolean
True if both full-text and semantic search matched
Example
Response

memory_write

Write to persistent memory (database-backed storage). Use for important facts, decisions, preferences, or lessons learned that should be remembered across sessions. Input Parameters
string
required
The content to write to memory. Be concise but include relevant context.
string
default:"daily_log"
Where to write:
  • memory - MEMORY.md (curated long-term facts)
  • daily_log - today’s timestamped log
  • heartbeat - HEARTBEAT.md checklist
  • Custom path like projects/alpha/notes.md
boolean
default:true
If true, append to existing content. If false, replace entirely.
Output
string
Always “written” on success
string
Path where content was written
boolean
Whether content was appended (true) or replaced (false)
integer
Number of bytes written
Example
Response
Protected Files
The following identity files cannot be written via tools (prompt injection defense):
  • IDENTITY.md
  • SOUL.md
  • AGENTS.md
  • USER.md
Constraints
  • Content cannot be empty
  • Rate limited: 20 calls per minute, 200 per hour
  • Identity files are protected from modification

memory_read

Read a file from workspace memory (database-backed storage). Use this to read files shown by memory_tree. Input Parameters
string
required
Path to the file (e.g., MEMORY.md, daily/2024-01-15.md, projects/alpha/notes.md)
Output
string
Path to the file that was read
string
File content
integer
Number of words in the content
string
RFC3339 timestamp of last update
Example
Response
Error Conditions
  • ExecutionFailed: File not found or read failed

memory_tree

View the workspace memory structure as a tree. Returns a hierarchical view of files and directories.
The workspace is separate from the local filesystem. Use memory_read to read files shown here, not read_file.
Input Parameters
string
default:""
Root path to start from (empty string for workspace root)
integer
default:1
Maximum depth to traverse (1 = immediate children only, max: 10)
Output Returns a JSON array representing the tree structure. Directories end with / and may have children. Example
Response
Constraints
  • Maximum depth: 10 levels
  • Directories shown with trailing /
  • Files shown without trailing slash
  • Empty directories shown as simple strings

Use Cases

Daily Logging

Automatic timestamped session notes:

Long-term Memory

Curated facts and decisions:

Project Notes

Organized by project:

Searching Context

Before answering questions: