Skip to content

Search perf + sessions corpus + background-work policy + oa→aix#60

Merged
thorwhalen merged 1 commit into
masterfrom
claude/perf-sessions-policy-aix
Jun 16, 2026
Merged

Search perf + sessions corpus + background-work policy + oa→aix#60
thorwhalen merged 1 commit into
masterfrom
claude/perf-sessions-policy-aix

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Implements four issues from this session (overlapping files → one branch). Full suite green (399).

#56 — search latency quick-wins

  • Lazy embedder (open_corpus): model loads only when a query embeds. ir ls 12.7s → 0.48s; ls/info/lexical never load it.
  • Packed vector matrix (CorpusStore): one mmap'd normalized matrix as a write-invalidated read cache (replaces the per-record vector-file storm); metas() lets lexical skip the matrix; single meta pass.
  • Brute force stays the default (no ANN below ~500k–1M).

#57 — Claude Code sessions corpus

  • ClaudeTurn strategy (user_prompt + assistant_summary surfaces; optional assistant_full; session_title surface), from_claude_sessions (90-day window, ai-title indexed), sessions preset. Parsing lives in priv.claude_transcripts (injectable fetcher).

#58 — per-corpus background-work policy

  • ir/policy.py (MaintenancePolicy + smart per-kind defaults + timing), registry v2 (now persists/reconstructs strategy + maintenance + storage), idempotent ir maintain. Declarative policy in ir; scheduler external (cron snippet in module docstring). No Settings singleton; one-way ir→raglab preserved.

#59 — route LLM calls through aix (not oa)

  • synopsis/select/formulate/eval_genaix.prompt_func; llm extra oaaix. Lazy + injectable preserved; live-verified end to end.

Depends on thorwhalen/aix#30 (adds egress/name to prompt_func). The aix import is optional + lazy, so CI without it skips the eval_gen default-generator tests (importorskip).

Closes #56, #57, #58, #59.

…ration

Four cohesive changes (overlapping files, so one commit):

Search latency quick-wins (#56)
- Lazy embedder: open_corpus binds a _LazyEmbedder that resolves the model only
  when a query actually embeds. `ir ls` 12.7s -> 0.48s; ls/info/lexical no longer
  load the model.
- Packed vector matrix: CorpusStore persists one normalized matrix (mmap reload),
  a write-invalidated read cache, replacing the per-record vector-file storm on
  reopen. Plus a vector-free metas() so mode="lexical" skips the matrix, and a
  single meta pass in matrix().

Claude Code sessions corpus (#57)
- ClaudeTurn strategy (user_prompt + assistant_summary surfaces; optional
  assistant_full; session_title surface + filter field) + from_claude_sessions
  (90-day default window, ai-title indexed) + `sessions` preset. Records come
  from priv.claude_transcripts (injectable fetcher, mirrors from_skills).

Per-corpus background-work policy (#58)
- ir/policy.py (MaintenancePolicy + smart per-kind defaults + timing predicates),
  registry v2 (persists/reconstructs strategy + maintenance + storage; closes the
  gap where source_from_entry always reverted to the preset default), and an
  idempotent `ir maintain` (incremental reindex when due; synopsis only in its
  downtime window). ir holds declarative policy; the scheduler stays external.

Route LLM calls through aix instead of oa (#59)
- synopsis/select/formulate/eval_gen now use aix.prompt_func (multi-provider
  facade) instead of oa.prompt_function; llm extra oa -> aix. Lazy + injectable
  pattern preserved (import ir stays offline). Live-verified end to end.

Full suite green (399). argh needed an explicit NameMappingPolicy for the new
optional-positional `maintain` command.
@thorwhalen thorwhalen merged commit 4f2ab66 into master Jun 16, 2026
12 checks passed
@thorwhalen thorwhalen deleted the claude/perf-sessions-policy-aix branch June 16, 2026 11:05
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.

B — search latency quick-wins: lazy embedder load + packed vector matrix

1 participant