feat(retrieval): add time filters to find and search#1429
Merged
MaojiaSheng merged 8 commits intovolcengine:mainfrom Apr 15, 2026
Merged
feat(retrieval): add time filters to find and search#1429MaojiaSheng merged 8 commits intovolcengine:mainfrom
MaojiaSheng merged 8 commits intovolcengine:mainfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Collaborator
|
I suggest just keep "--since, --until", and don't make it too complecated |
Contributor
Author
|
Changed the CLI to |
# Conflicts: # openviking/server/routers/search.py # openviking/utils/embedding_utils.py
Contributor
Author
|
Did one simplify pass on the current branch head. This only narrows the CLI helper to take the already-converted |
Contributor
Author
|
Added one short comment in the time-filter merge helper and updated the checklist so the PR body matches the current branch state. Behavior is unchanged. |
MaojiaSheng
approved these changes
Apr 15, 2026
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.
Description
This PR adds native time filtering to retrieval.
findandsearchcan nowfilter semantic results by
created_atorupdated_atthrough the Python SDKand HTTP API, while the Rust CLI keeps a smaller
--after/--beforesurface.
OpenViking already stores these timestamps on indexed context records, but
retrieval could not query against them directly. This patch adds
since,until, andtime_fieldto the retrieval surface, keeps the CLI mapping to--after/--beforeonly, and preservescreated_aton rewrites so thefilters stay meaningful after reindex and update flows.
Related Issue
None.
Type of Change
Changes Made
since,until, andtime_fieldrequest fields to retrieval in the Python SDK, local client, HTTP server, and Rust HTTP client.merge_time_filter()helper that compiles relative or absolute bounds into the existing metadata filter tree.ov find/search --after ... --before ..., which map to APIsince/untilwithout the extra shortcut flags.created_atfor leaf records on rewrite and reindex, and derived timestamps from canonical file metadata socreated_atandupdated_atkeep stable semantics.Testing
Validation run locally on macOS:
cargo test -p ov_cli --bin ov✅uv run --isolated --with pytest --with pytest-asyncio python -m pytest tests/unit/test_search_filters.py tests/server/test_sdk_time_filters.py tests/server/test_api_search.py -qstill fails on this host while importingpydantic_corewith macOS code-signature validation (mapping process and mapped file (non-platform) have different Team IDs). That reproduces the earlier local environment issue even outside the repo.venv.Checklist
Screenshots (if applicable)
Not applicable.
Additional Notes
I trimmed the CLI down after review feedback so the user-facing surface is just
--after/--before. If you would prefer an even smaller initial PR, I canstill split the write-path timestamp preservation from the retrieval API and
CLI surface.