Skip to content

perf(memory): auto-index up to 8000 chunks, like memory index - #472

Merged
mrnasil merged 3 commits into
mainfrom
perf/auto-index-cap
Nov 25, 2026
Merged

mrnasil merged 3 commits into
mainfrom
perf/auto-index-cap

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 25, 2026

Copy link
Copy Markdown
Member

Problem

The session auto-index caps the code index at auto_index_max_chunks = 4000, half of what whycodes memory index and the memory tool use (8000). Files are indexed in path order, so on this repo the cap ran out inside crates/llm. 11 of 27 crates were searchable; turn recall could never surface session, tools, tui, memory, sandbox or storage.

Change

Default auto_index_max_chunks 4000 → 8000 (config default, MemorySettings::default, docs/config.md).

Measured

scripts/eval_code_recall.py (from #470/#471), code-search with BM25 order + path boost, release build:

auto-index cap on topic (22) answered (22) held-out on topic (12) held-out answered
4000 (main) 35% 11 31% 6
8000 57% 19 58% 11

Indexing runs in a background thread: 3.8 s → ~6 s on this repo.

Measured and rejected

Same harness, 4000 and 8000 caps:

  • Skipping test files frees room at 4000 (58%, 17/22), but once everything fits it loses on-topic test chunks (8000: 57% → 47%).
  • An even per-file share first, then the rest: every file gets indexed, but the index fills with import headers (4000 without tests: 58% → 39%).

Note

The auto-index is built only when the bank's index is empty (ensure_code_index). Existing indexes keep their size until whycodes memory index is run. The index is also never refreshed as code changes; that is a separate issue I'll look at next.

Checks: cargo test -p whycodes-config --lib (164), -p whycodes-memory --lib (90), clippy, fmt, ratchets.

🤖 Generated with Claude Code

mrnasil and others added 2 commits November 25, 2026 06:07
The session auto-index capped the code index at 4000 chunks, half of
what `whycodes memory index` and the memory tool use. Files are indexed
in path order, so on this repo the cap ran out in crates/llm: 11 of 27
crates were searchable and recall could not reach session, tools, tui,
memory, sandbox or storage.

eval_code_recall.py (code-search with BM25 order and path boost):
4000 chunks: 35% on topic, 11/22 answered; held-out 31%, 6/12.
8000 chunks: 57%, 19/22; held-out 58%, 11/12. Indexing runs in the
background and took 3.8 s -> ~6 s here.

Also measured and rejected: skipping test files (frees room but loses
on-topic test chunks once everything fits) and giving every file an even
share first (fills the index with import headers; 58% -> 39%).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil merged commit a44191a into main Nov 25, 2026
7 checks passed
@mrnasil
mrnasil deleted the perf/auto-index-cap branch November 25, 2026 03:43
mrnasil added a commit that referenced this pull request Nov 25, 2026
…474)

catalog_models also lists OAuth providers that have a stored token,
read from WHYCODES_HOME. catalog_models_merges_oauth_token_store_suggestions
points that at a home holding a token under ENV_LOCK; the decision-model
test read it without the lock, so when the two overlapped its "empty
catalog" saw the token and failed (Coverage on #472). It now holds
ENV_LOCK and uses an empty home of its own.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@mrnasil mrnasil mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant