feat(recall): add metadata sidecar search#177
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a bounded “metadata sidecar” candidate channel to /recall, allowing recall ranking to consider whitelisted memory metadata values (without mutating stored vectors/content) and documenting the end-to-end metadata behavior.
Changes:
- Introduces graph-side metadata candidate search and wires it into recall behind
RECALL_METADATA_SEARCH_ENABLED. - Extends scoring to account for
match_type="metadata"viaSEARCH_WEIGHT_METADATA. - Adds tests and documentation for metadata lifecycle and recall-side behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_metadata_recall_search.py |
Adds coverage for metadata sidecar admission, whitelisting rules, and scoring behavior. |
docs/METADATA_BEHAVIOR.md |
Documents current metadata storage/recall/update/enrichment/consolidation behavior and new sidecar search rules. |
docs/ENVIRONMENT_VARIABLES.md |
Documents RECALL_METADATA_SEARCH_ENABLED env var for enabling/disabling the sidecar channel. |
docs/API.md |
Notes metadata sidecar recall behavior and the controlling env var. |
automem/utils/scoring.py |
Adds a metadata score component and includes it in final scoring. |
automem/search/runtime_recall_helpers.py |
Implements metadata parsing/tokenization/matching and graph query for metadata sidecar candidates. |
automem/runtime_wiring.py |
Wires the metadata search function into blueprint registration. |
automem/config.py |
Adds RECALL_METADATA_SEARCH_ENABLED and SEARCH_WEIGHT_METADATA configuration. |
automem/api/runtime_recall_routes.py |
Passes the metadata search function through the runtime recall route DI. |
automem/api/runtime_bootstrap.py |
Threads metadata search function into blueprint registration. |
automem/api/recall.py |
Runs metadata sidecar search during recall and incorporates results into scoring/ranking. |
app.py |
Exposes _metadata_keyword_search as a runtime attribute for wiring. |
- Fetch relations only for kept metadata candidates (at most limit) instead of every admitted row (up to the scan limit) on each recall - Drop the subsumed branch in _metadata_value_has_strong_evidence and the unused include_people parameter; mark METADATA_SKIP_FIELDS as a whitelist safety guard - Document SEARCH_WEIGHT_METADATA in ENVIRONMENT_VARIABLES.md and CLAUDE.md so operators can discover and lab-sweep it - Add regression test bounding fetch_relations calls to returned results Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI pins black 24.4.2 and isort 5.13.2 via pre-commit; local black 24.8.0 formats these two spots differently. Reformatted with the pinned hooks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
/recall, controlled byRECALL_METADATA_SEARCH_ENABLED.Breaking Changes
None.
Validation
.venv/bin/python -m pytest -q-> 465 passed, 12 skipped.data/sweep_runs/20260610T174320Z-metadata-server-metadata-search.Eval harness PR: verygoodplugins/automem-evals#10
Closes #110