memory_index
Returns a budgeted index of memory records, one line per record, so an agent can identify and open the right entry without loading the entire store.
Instructions
THE ALWAYS-LOADED INDEX: one line per record, budgeted, so the right one gets opened.
A store too big to hold in context is read through a small index, and the agent decides what to open from those lines alone. The line is therefore the only surface a future need can reach: a record whose line does not distinguish it is present, correct, and never retrieved.
MEASURED on a 316-note store, 120 questions written from the note bodies and shown to no line-writer, ranking all 316 candidates. recall@3 on full questions / on the three-to-eight words someone types into a search box: a hand-written title-and-hook 0.333 / 0.508; the title alone 0.300 / 0.450; title plus its highest-idf terms 0.350 / 0.533; a line saying what the record CONCLUDED 0.683 / 0.833; the full records, as a ceiling, 0.858 / 0.967.
So the line worth having is a sentence about the conclusion, and no extraction produces one --
term-stuffing is a null on both registers. Which is why the useful call is not this one alone:
read needs_line, write those sentences yourself, and store them with set_index_line. Without
them this returns the fallback -- the record's opening sentence, measured through this same call
at 0.442 / 0.525 against 0.692 / 0.842 with written lines -- and limits says which you got.
budget_tokens shortens lines to fit and NEVER drops a record -- a record with no line cannot be
found at all -- so a budget too small to hold one line each is reported as exceeded rather than
silently met.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_tokens | No |