memory_search
Search past sessions' learnings, decisions and blockers by topic, combining full-text and semantic search with filters for kind, project, path and date range.
Instructions
Search past sessions' learnings, decisions, blockers and other memory records by TOPIC (Postgres full-text search fused with semantic similarity) -- the tool for 'what did we decide/learn about X'. Filter by kind, scope, project, path, or since/days. A date phrase in the query ("last week", "yesterday", "Sept 20") is read as a time hint: it is taken out of the search text and records from that window rank higher, but older matches still come back (date_hint shows the reading); since/days are hard filters. Newer records win near-ties. since/days filter on the session's start time; each record's when is its session's end time (else start). Covers extracted, quote-verified records (extraction runs on sessions within about 30 days of upload; older extracted records stay searchable); a fact that was said but never extracted is only in the raw turns (search_conversations). When nothing is relevant enough, reason says why -- that is the answer, not an error. Records a newer record replaced are hidden unless include_superseded is true or the query names a past date; paraphrases of one fact are served as one record with seen_in (the number of sessions that said it); every record carries as_of, the day its session recorded it (true when recorded, not current state). Local installs return served: lines (records as JSON, raw session excerpts marked "raw excerpt") packed whole to max_tokens (default 3000). Else (hosted; raw_reason says why) ranked records cut at max_tokens (dropped_for_budget). A record's session_id is a code session: read the turns around it with get_code_session id=<session_id> turn=<turn_idx>, or session_summary session_id=<session_id>. Records carry links to their sources when known: sha (the commit the session was on), paths (files it names, up to 5), ref_url (the ref's forge page). Open them directly; they locate sources, they do not report current state. Results are dated records of what sessions did, not the current state of a PR or issue; check that live.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Only records from sessions in the last N days, a whole number 1-365 (a hard filter). Ignored when since is given. | |
| kind | No | One or more of: outcome, decision, learning, blocker, preference | |
| path | No | Only records whose paths[] includes this file | |
| limit | No | Max records to return, a whole number 1-20 (default 10) | |
| query | Yes | What to search for | |
| scope | No | Only records of this scope: "project" (about one repo, the default a record gets) or "global" (a rule or fact bigger than one repo). Omit for both. | |
| since | No | Only records from sessions on or after this time (a hard filter). ISO date "2026-09-24" (00:00 UTC) or ISO datetime "2026-09-24T09:30:00Z". Wins over days. | |
| project | No | Repo remote URL, absolute path, or short repo name (e.g. "acme/payments" or "owner/repo", as the preamble names the current repo) to scope the search to one project | |
| max_tokens | No | Token budget for the result, 200-20000 (default 3000). Served lines (records and raw excerpts) are packed whole, in order, estimated as characters / 4, and stop at the first line that does not fit. Without raw excerpts the ranked records fill it instead, and at least one is returned. | |
| recall_token | No | The recall_token line from this session's Membral preamble, if you have one. Only logged to link this call to that preamble; it never changes the results. | |
| include_superseded | No | Also return records a newer record replaced, each marked superseded_by {id, on}. Default false: replaced records are hidden. A past date phrase in the query ("as of Sept 20") also serves what was current then. |