Match seed terms against memory bodies directly — the KG FTS indexes only node ids/labels/summaries, so body words are invisible to the keyword search. Memories are few and small; a linear scan keeps free-text queries useful without a storage-layer change.
(
repo: &Repository,
seed_query: &str,
candidates: &mut HashMap<String, CandidateScore>,
)
| 423 | /// to the keyword search. Memories are few and small; a linear scan |
| 424 | /// keeps free-text queries useful without a storage-layer change. |
| 425 | fn scan_memory_bodies( |
| 426 | repo: &Repository, |
| 427 | seed_query: &str, |
| 428 | candidates: &mut HashMap<String, CandidateScore>, |
| 429 | ) -> Result<(), Status> { |
| 430 | let terms = search_terms(seed_query); |
| 431 | if terms.is_empty() { |
| 432 | return Ok(()); |
| 433 | } |
| 434 | let metas = repo |
| 435 | .vault_list("memory/", Some(VaultEntryType::Memory)) |
| 436 | .map_err(repository_error)?; |
| 437 | for meta in metas { |
| 438 | let Some(node_id) = |
| 439 | memory_path_to_node_id(&repo.project_id().map_err(repository_error)?, &meta.path) |
| 440 | else { |
| 441 | continue; |
| 442 | }; |
| 443 | let Some(entry) = repo.vault_retrieve(&meta.path).map_err(repository_error)? else { |
| 444 | continue; |
| 445 | }; |
| 446 | if !is_eligible_memory(&entry) { |
| 447 | continue; |
| 448 | } |
| 449 | let body = String::from_utf8_lossy(&entry.content_bytes); |
| 450 | let matched = body_match_fraction(&terms, &body); |
| 451 | if matched > 0.0 { |
| 452 | let base = BODY_MATCH_WEIGHT * matched; |
| 453 | merge_candidate(candidates, &node_id, Some(meta.path), base, false); |
| 454 | } |
| 455 | } |
| 456 | Ok(()) |
| 457 | } |
| 458 | |
| 459 | /// Seed query terms and graph-neighbor candidates from an intent. |
| 460 | fn seed_from_intent( |
no test coverage detected