Repository navigation
[codex] Add opt-in raw-history dense and reranked memory baselines - #2362
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
The evaluation example for RFC #2057 compares recent history, lexical top-two retrieval, and supplied L3 artifacts. Keyword overlap does not supply the requested raw-history dense retrieval plus reranking baseline. This draft adds runnable, opt-in
raw_denseandraw_dense_rerankedadapters while preserving the default lightweight preflight.Visible pre-question events are split into overlapping character windows, embedded and ranked by normalized cosine similarity. The reranked variant scores only dense candidates with a cross-encoder. Both offer windows to the existing shared budget packer. Optional chunk-to-event provenance lets coverage count unique retained original events after packing. Adapter metadata records configuration, candidate/reranker scores, model revisions/versions, and separate indexing/query/reranking times.
Model SDK imports occur only under
--raw-rag; public safetensors models use immutable revisions, CPU by default,token=False, andtrust_remote_code=False. Overlong model inputs fail explicitly rather than silently truncating. Ordinary tests use injected vectors/model-boundary fakes and do not download weights. Documentation covers installation, commands, granularity differences and report interpretation.Validation
python3hygiene entry; equivalent direct scoped checks pass. General hooks, Ruff, secret scanning, and Bandit pass. Untouched frontend Prettier is skipped.Scope for review
This supplies baseline machinery, not a completed research comparison or a claim that dense retrieval/reranking improves memory. The eleven supplied fixtures are synthetic, snapshots remain hand-authored, and source-ID coverage is not fact/span recall. Indices rebuild per case/adapter for isolation; timings are not production steady-state latency. Model loading/downloading is reported separately. No production memory tools, access rules, providers, or defaults change.
I am opening this as a draft for review of the baseline configuration and report contract before a larger held-out study with actual consolidation artifacts and a shared reader. It relates to #2057 and does not close that RFC.