Skip to content

Raise the vector over-fetch to 4x so every collection fills its budget - #177

Open
adamjohnwright wants to merge 1 commit into
mainfrom
fix/vector-overfetch
Open

Raise the vector over-fetch to 4x so every collection fills its budget#177
adamjohnwright wants to merge 1 commit into
mainfrom
fix/vector-overfetch

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Follow-up to #169, which fixed the duplication; this closes the last gap.

The gap

A Reactome entity occupies several CSV rows — a reaction appears once per pathway/input/output/catalyst combination — so the vector store is asked for more than we keep and the extras are collapsed by st_id. At 3x, one of the 20 questions in tests/golden/questions.txt still came up short:

complexes   overfetch 3x -> short of k on 1/20 questions   (8 distinct of 10)
complexes   overfetch 4x -> short of k on 0/20
complexes   overfetch 6x -> short of k on 0/20

After

All four collections, all 20 questions:

reactions    0/20 short
complexes    0/20 short
ewas         0/20 short
summations   0/20 short

6x gains nothing over 4x, so 4 it is. The cost is a larger k on a local Chroma query, which is not measurable beside the LLM calls in the same request.

The constant carries the measurement in a comment, so the next person does not have to redo it to know why the number is 4.

🤖 Generated with Claude Code

3x still came up short on `complexes` for one of the 20 questions in
tests/golden/questions.txt -- 8 distinct documents where 10 were asked for --
because a Reactome entity can occupy more rows than 3x leaves room to collapse.

Measured across all four collections and all 20 questions: 4x clears every case,
6x gains nothing further. The cost is a larger k on a Chroma query that is
already local, which is not measurable next to the LLM calls in the same request.

Follows #169, which fixed the duplication itself. The constant carries the
measurement so the next person does not have to redo it to know why it is 4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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