Summary
/recall entity/category filters (main.rs:732-759) are post-filters in Rust AFTER semantic search. This means:
- Fetches up to limit*10 results (max 200)
- Rust iterates all results checking metadata
- Non-matching results discarded
A memory matching entity filter perfectly might be excluded if not in top 200 by similarity.
Proposed Fix
Push entity/category filter into SQL query layer before scoring.
Acceptance Criteria
Functional
Verification (CMO can run without reading code)
Edge cases
Tests
Priority
Low — correctness issue for edge cases.
Dependencies
Partially addressed by #655 (metadata storage) and #656 (DB indexes).
Summary
/recallentity/category filters (main.rs:732-759) are post-filters in Rust AFTER semantic search. This means:A memory matching entity filter perfectly might be excluded if not in top 200 by similarity.
Proposed Fix
Push entity/category filter into SQL query layer before scoring.
Acceptance Criteria
Functional
Verification (CMO can run without reading code)
curl POST /recall {"query":"launch","entity":"drawover"}→ returns drawover memories even if embedding similarity is lowcurl POST /recall {"query":"launch","entity":"nonexistent"}→ returns empty results (no entity match)POST /recall {"query":"generic","entity":"drawover"}results before and after fix → same or more accurate resultsEdge cases
Tests
Priority
Low — correctness issue for edge cases.
Dependencies
Partially addressed by #655 (metadata storage) and #656 (DB indexes).