The 3-layer workflow
1
Search — get a compact index
Start with Review the index and identify which observation IDs look relevant before fetching anything further.
search to get a lightweight table of IDs, titles, dates, and types. Each result costs roughly 50–100 tokens.2
Timeline — get chronological context
Use Or let it find the anchor automatically from a query:
timeline to understand the narrative arc around interesting results — what was happening before and after a specific observation.3
Get observations — fetch full details
Call Each full observation costs 500–1,000 tokens and includes the complete narrative, facts, files, and concepts.
get_observations only for the IDs you’ve confirmed are relevant. Always batch multiple IDs in a single call.Why this works
Traditional approach
Fetching 20 observations upfront: 10,000–20,000 tokens, with roughly 10% actually useful.
3-layer approach
Search index + timeline + 3 full observations: ~3,000 tokens, 100% relevant.
Tool reference
__IMPORTANT — workflow documentation
An always-visible reminder of the 3-layer workflow pattern injected into the MCP context. It helps Claude understand how to use the search tools efficiently. You do not need to invoke it directly.
search — search memory index
Search your memory and get a compact index with IDs.
Parameters
string
Full-text search query. Supports AND, OR, NOT, phrase searches, and column-specific filters. See FTS5 query syntax below.
number
default:"20"
Maximum number of results to return.
number
default:"0"
Skip the first N results for pagination.
string
Filter by observation type:
bugfix, feature, decision, discovery, refactor, or change.string
Filter by record type:
observation, session, or prompt.string
Filter results to a specific project name.
string
Include only results on or after this date (
YYYY-MM-DD).string
Include only results on or before this date (
YYYY-MM-DD).string
default:"date_desc"
Sort order:
date_desc, date_asc, or relevance.timeline — get chronological context
Get a chronological view of observations around a specific point or query. Returns depth_before + 1 + depth_after items interleaved in chronological order.
Parameters
number
Observation ID to center the timeline around. Required if
query is not provided.string
Search query to find the anchor automatically. Required if
anchor is not provided.number
default:"3"
Number of observations to include before the anchor. Maximum 20.
number
default:"3"
Number of observations to include after the anchor. Maximum 20.
string
Filter results to a specific project name.
get_observations — fetch full details
Fetch complete observation details by ID. Always batch multiple IDs in a single call — one request instead of N individual requests.
Parameters
number[]
required
Array of observation IDs to fetch.
string
default:"date_desc"
Sort order:
date_desc or date_asc.number
Maximum number of observations to return.
string
Filter results to a specific project name.
Common use cases
Debugging issues
Debugging issues
Find what went wrong and how it was fixed.
Understanding decisions
Understanding decisions
Review architectural choices and their rationale.
Code archaeology
Code archaeology
Find when and why a specific file was changed.
Feature history
Feature history
Track how a feature evolved from first commit to completion.
Context recovery
Context recovery
Restore context after time away from a project.
Reviewing refactoring patterns
Reviewing refactoring patterns
Study past refactoring approaches before starting a new one.
FTS5 query syntax
Thequery parameter uses SQLite FTS5 full-text search syntax.
Boolean operators
Phrase searches
Column-specific searches
Combining operators
Token efficiency guide
Cost estimates
Best practices
- Always start with
search— survey the index before fetching anything - Use small limits first — start with 3–5 results, increase only if needed
- Filter before fetching — use
type,dateStart/dateEnd, andprojectto narrow results - Batch
get_observations— always group multiple IDs in a single call - Use
timelinestrategically — only when understanding narrative context matters
Efficient vs. inefficient patterns
Advanced filtering
Date ranges
Multiple observation types
Make separate searches for each type, then compare results:Project-specific search
Pagination
Result metadata
Every observation returned byget_observations includes:
Troubleshooting
No results found
No results found
Broaden your query:Check the database has data:Try without filters:
IDs not found in get_observations
IDs not found in get_observations
Error:
Observation IDs not found: [123, 456]Possible causes: the IDs belong to a different project, they were deleted, or there is a typo.Token limit errors
Token limit errors
Error: Response exceeds token limitsSwitch to the 3-layer workflow instead of fetching large batches upfront:
Slow search performance
Slow search performance
- Use more specific queries — better precision helps the FTS5 index
- Add date range filters to narrow the scope
- Specify a
projectfilter when possible - Use smaller
limitvalues
Technical details
The MCP tools are a thin wrapper over the worker HTTP API onlocalhost:37777. The MCP server translates tool calls into HTTP requests; all business logic, database queries, and Chroma vector search run in the worker service.
Progressive disclosure
The philosophy behind the 3-layer workflow
Claude Desktop
Using memory search from Claude Desktop
Architecture overview
System components and data flow
Database schema
Understanding the observation data structure