[Bug]: .overview.md files outrank the memory cards they link to in find results since v0.4.17
Summary
Since v0.4.17 ("missing memory overview indexing" fix), .overview.md files are returned by /api/v1/search/find and frequently outrank the real memory cards they merely link to. For an agent whose recall budget is a handful of results, this replaces knowledge with tables of contents.
Measurement
Same store, same four queries, same templates. Only the server version differs (fresh encrypted store each time, memories created by the same four sessions).
| query (actor) | v0.4.16 | v0.4.17.1 |
|---|---|---|
| "comment je dois presenter mes bilans" (guillaume) | 1 overview in top 4 | 3 of 5, and the top hit is preferences/.overview.md at 0.678, above the real card at 0.604 |
| "comment je dois presenter mes bilans" (steven) | 1 of 4 | 4 of 5 — the real card no longer appears in the top 5 at all |
| "quelle longueur pour un compte rendu de visite" (steven) | 1 of 4 | 3 of 5 |
| "qui sont les associes de Kindi Immo" (guillaume) | 1 of 4 | 4 of 5 |
Why it matters
An .overview.md is a directory listing, not knowledge:
---
directory: viking://user/agence/peers/x/memories/preferences/
generated_by:
component: MemoryUpdater
trigger: memory_update
freshness:
total_entries: 2
---
# Preferences Overview
**User:** x
**Topic:** format des bilans
- [format des bilans](./format des bilans.md)
- [format des comptes rendus](./format des comptes rendus.md)
The link text repeats the topic, which is exactly what the query matches on — so an overview scores like the card it points to, sometimes higher, while carrying none of its content.
The agent integration this affects is the Hermes memory plugin, which prefetches a small fixed number of memories before each turn (default recall_limit: 6, recall_max_injected_chars: 4000, full reads on the top 2). When 3 or 4 of those 6 slots are overviews, the model receives link lists instead of the preference or fact it needed. In the steven/bilans case above, the correct card is simply gone from what the agent would see.
Why callers cannot easily work around it
FindRequest does expose filter and level, so a caller could in principle exclude these. But the Hermes plugin's prefetch sends a fixed payload — query, limit, score_threshold, context_type — and its _GENERATED_MEMORY_SUMMARY_FILENAMES set (.abstract.md, .overview.md) is only used to refuse deletion in viking_forget, not to filter recall. So for that integration the overviews reach the model.
Suggestion
Two options, either would work for us:
- Exclude generated summaries (
.abstract.md,.overview.md) fromfindresults by default, with an opt-in flag for callers that want them. - Index them at a distinct
leveland document it, so callers can exclude them with the existinglevelparameter.
Happy to test a patch against the same bench.
Environment
Server v0.4.16 and v0.4.17.1 compared directly. api_key auth, encryption enabled, custom templates for entities / preferences / events, memory types entities + preferences + events.
Thanks for the detailed report and measurements. We do not plan to define .overview.md or .abstract.md as results that OpenViking should exclude by default. They are valid indexed contexts, while the reported impact depends on an integration using a small fixed recall budget. That selection policy should remain with the caller rather than becoming a server-side filename special case. Closing this as not planned.
Thanks for looking at it. The principle makes sense, and the caller-side filter you point to already exists — I just hadn't found it. But that filter isn't reachable the way the code stands in one of the two retrieval modes, and I think there's a smaller, non-filename bug underneath. Both points verified in the installed package at v0.4.17.1 and measured on a live store.
1. level already is my option 2, and it works.
ContextLevel is ABSTRACT=0 / OVERVIEW=1 / DETAIL=2, assigned at index time (utils/embedding_utils.py: level=ContextLevel.ABSTRACT for .abstract.md, level=ContextLevel.OVERVIEW for .overview.md). On my store, find returns:
level |
results |
|---|---|
| 0 | 7 records, all .abstract.md, no cards |
| 1 | 6 records, all .overview.md, no cards |
| 2 | 83 records, all leaf cards, no summaries |
So a caller passing level: 2 gets exactly what I asked for, with no filename special case anywhere. I could not find this documented — the only mention is the retrieve() docstring ("0=L0, 1=L1, 2=L2"), which doesn't say that L0/L1 are the generated summary files. If that's the intended answer, documenting the mapping would close this for every integration, and I'd be happy with that outcome.
2. QUICK and THINKING disagree about whether directory records belong in results.
In HierarchicalRetriever.retrieve():
- THINKING (rerank client configured): the global search is pinned to
level=[0, 1]to pick entry points, and directory hits are then added to the result pool only when the caller asked for them. The code says so itself:# Add directory hits to the result pool only when explicitly requested.followed byif level is not None:. Withlevel=None, L0/L1 are navigation and never surface as results. - QUICK (no rerank client): the single
search_in_tenant()call receiveslevel=levelunchanged, solevel=Nonemeans no filter at all, and L0/L1 compete with L2 on raw score.
And mode = RetrieverMode.QUICK if not self._rerank_client else RetrieverMode.THINKING. I run without a rerank client, so I'm on the QUICK path — which is why v0.4.17's overview indexing changed my results, and why a rerank-enabled deployment would not have seen this at all. That asymmetry looks unintended rather than a policy choice, and aligning QUICK with the rule the THINKING path already states needs no server-side filename filter.
3. On the recall-budget point — it cuts the other way. limit is applied server-side, so when 4 of 6 slots are directory records, the cards never reach the client. The Hermes plugin's own leaf_boost = 0.12 for level == 2 cannot recover them, because it runs after truncation.
Either outcome works for me: align QUICK with the documented intent, or document the ContextLevel mapping so callers can pass level deliberately. I'm taking the level: 2 prefetch to the Hermes plugin regardless, and I'm happy to test a patch on the same bench.