Repository navigation
A search that returns a document of a decaying source counts as a use of it - #20
Merged
Merged
Conversation
… of it Signed-off-by: Bogdan Szabo <[email protected]>
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.
Slice 3 of 5 of RC-003 (a source may decay), on top of #19. A search that hands back a document of a source with
decayset records the use; nothing reads the record yet, so ranking does not change.What is in it.
decay::record_retrievals: one statement for all the documents of a read. For a document of a decaying source it adds one toretrieval_count, setslast_retrieved_at, and adds 2 days to the half-life up to 365 (a first retrieval starts from the source'shalf_life_days). Documents of other sources get no row.POST .../searchand thesearch_chunkstool record what they return, spawned off the request path: a failure is logged and never fails the read. The REST body takesrecord: falsefor probes, evals and health checks. Chat's automatic prefetch does not count.docs/design/chat-and-mcp.mdsays so.Tests. A store test pins: only the decaying source's document is written, +2 days per retrieval, the 365 cap, and an unknown id or an empty list writes nothing. A unit test pins that
recorddefaults to true.Checked locally on the rebased branch:
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace(1684 passed, 0 failed).🤖 Generated with Claude Code