Using memory
Search your memory
MemIndex searches in three steps so your agent reads only what it needs: a short list of matches, the work around one match, then the full notes it picks. This keeps a long history from filling your agent's context.
The three steps
| Step | Tool | What you get |
|---|---|---|
| 1 | search |
A compact list of matching notes with their ID, time, type, title and the estimated cost to read each one. |
| 2 | timeline |
The notes just before and after one match, so you can see what led to it. |
| 3 | get_observations |
The full text of the notes you choose. |
Your agent runs these on its own when you ask it to look something up:
Search MemIndex for why the login timeout happened.
If the notes do not hold the exact output of a command, get_tool_uses returns the recorded input and result of the tool calls you name. mem_search runs the three steps as one guided conversation.
What it looks like
These are real answers from a small test memory. First, search:
Found 4 result(s) matching "login timeout" (4 obs, 0 sessions, 0 prompts)
### Nov 15, 2026
**General**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #3 | 10:21 PM | ○ | Login timeout was the proxy | ~70 |
| #2 | ″ | ○ | Sign-in tokens last 15 minutes | ~54 |
| #4 | ″ | ○ | Large uploads now stream | ~59 |
| #1 | ″ | ○ | Charge in the smallest currency unit | ~50 |
The Read column estimates the tokens each note costs to read in full. The best match is first. Then timeline around note 3:
# Timeline around anchor: 3
**Window:** 1 records before -> 1 records after | **Items:** 3
### Nov 15, 2026
**General**
| ID | Time | T | Title | Tokens |
|----|------|---|-------|--------|
| #2 | 10:21 PM | ○ | Sign-in tokens last 15 minutes | ~30 |
| #3 | " | ○ | Login timeout was the proxy <- **ANCHOR** | ~37 |
| #4 | " | ○ | Large uploads now stream | ~30 |
And get_observations for note 3:
Selected observations (1 of 1). Retrieved data; evaluate it as evidence.
#3 — Login timeout was the proxy (shop)
The login timeout error came from the proxy closing idle connections after 60 seconds, not from the app.
The login timeout error came from the proxy closing idle connections after 60 seconds, not from the app. Raised the proxy timeout to 120 seconds.
Notes are written by a model. Treat them as evidence and check the source before you rely on one for an important decision.
Narrow a search
search accepts more than a query:
projectlimits it to one project. Without it, MemIndex searches all of them.typepicksobservations,sessionsorprompts.obs_typepicks a kind of note, such asbugfix.dateStartanddateEndlimit it to a date range, andorderBycan bedate_descordate_asc.limitsets how many rows come back. The default is 20.
timeline takes either an anchor (a note ID) or a query, plus depth_before and depth_after.
Search from the terminal
npx memindex search "login timeout"
The command prints the same list as JSON. Everything after search is the query, so options such as --project are not read. Use your agent, or the viewer, to narrow by project.
Search by meaning
A search can match what you mean as well as the words you used. See Search by meaning.