mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
9de30dd201
Replace the per-result `get_entities_by_id` loop in `to_search_results` with a single batch `find_by_ids` call: collect all unique entity_id, from_id, and to_id values upfront, fetch them in one query, then use a lookup dict during result shaping. This also fixes a pre-existing bug where `from_entity` and `to_entity` both pointed to `entities[0]` due to unordered IN-query results. `to_graph_context` (used by recent_activity) already applies this same pattern; this change makes search hydration consistent. Closes #710 Related: #707 Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>