智能體找到正確對話後,模型實際收到甚麼?
Your Agent Found the Right Conversation. What Reached the Model?
Agent Memory Leaderboard 作者指出,檢索到正確對話不代表模型收到完整決策條件,並提出追蹤候選證據、打包內容及最終輸入的診斷方法。文中提到,mnemotree 在 AML Cycle 2 的 Textual Open-source Methods 評分為 60.81,基準説明採用 8,000-token 證據預算。
Imagine a checkout agent searching an old engineering discussion. It finds the conversation containing the retry policy:
Monday: “Set the retry limit to three.”
Tuesday: “Roll that back. A timeout after a successful charge can create a duplicate payment.”
Wednesday: “Retry only after the gateway confirms no charge exists, and reuse the idempotency key.”
Now ask the agent how checkout should handle a timeout.
If its final context contains Monday's proposal but misses the later restriction, a retrieval dashboard could still report a hit on the correct conversation. The answer could recommend exactly the behavior the team rejected.
This is a constructed example, not an observed failure of the projects discussed below.
Disclosure: I work on Agent Memory Leaderboard (AML). This article reviews public documentation and proposes a debugging experiment; I have not run that experiment.
A source hit can hide a missing condition
The useful question is whether the model received enough evidence to distinguish a proposal from the policy that replaced it.
For this checkout example, I would inspect four points:
| Point in the pipeline | What to inspect |
|---|---|
| Candidate retrieval | Did the candidate pool include the rollback and the replacement rule? |
| Evidence packing | Did those passages survive the context budget? |
| Final model input | Were their dates, roles, and qualifications still present after integration? |
| Action and validation | Did the agent follow the current rule, and did the checkout tests pass? |
A single “relevant source found” metric cannot tell us where this example went wrong. Even locating the correct message may be too coarse if only a partial span reaches the model.
A concrete place to inspect the boundary
AML Cycle 2 lists mnemotree second in Textual Open-source Methods at 60.81.
Its README describes a source-first engine using SQLite FTS5/BM25 and sqlite-vec, with reciprocal rank fusion. Original passages retain their speaker and time.
The project's benchmark notes describe a v1.0.0 setup with an 8,000-token evidence budget.
The memory engine calls an embedding model; gpt-4o-mini answers and judges outside it. “No LLM inside the memory engine” therefore does not mean the evaluation has no model-generated answers.
The current guide documents traces for candidates, ranking, and packing losses. It also distinguishes context tokens from the extra JSON framing and source metadata in an MCP response.
Those details suggest something practical to measure. They do not establish why the system earned its score, or prove that today's MCP integration reproduces the evaluated build.
Hold retrieval fixed before changing the budget
For a small diagnostic experiment, I would start with the checkout conversation above and label the exact spans needed for a correct decision: the duplicate-charge risk, the replacement condition, and the idempotency requirement.
Then freeze the retrieved candidate pool. Change only how that pool is packed into the final context.
For example, compare three evidence budgets while keeping the reader, prompt, ordering policy, and generation settings fixed.
For each run, record:
- Whether all required spans were candidates.
- Whether all required spans reached the final model input.
- Whether the agent followed the current rule.
- Whether the proposed change passed the same tests.
- Input tokens and latency for the complete request.
This separates several hypotheses.
If a restriction never enters the candidate pool, packing cannot recover it. If it is retrieved but excluded from the prompt, changing the embedding model may address the wrong stage. If the complete evidence reaches the reader and the action is still wrong, the next investigation belongs downstream.
I would also compare strict rank-order packing with a policy that keeps a decision and its qualifying context together, under the same budget.
That is a proposed comparison, not a demonstrated improvement. A larger bundle might preserve an essential condition, but it could also displace other evidence.
The final check matters: adding the missing restriction and observing a successful answer once would be a useful clue, not proof of a general causal explanation. Repeated, matched runs would make the diagnosis more credible.
Count what the reader actually receives
A memory setting called token_budget needs a defined boundary.
Evidence text, tool-response framing, source metadata, conversation history, instructions, and the current question can all occupy different parts of the eventual request.
For an integration, I would count the fully assembled input with the reader's tokenizer. I would report embedding and search latency separately from answer generation, alongside total latency and provider usage where available.
This avoids treating a bounded evidence field as a guarantee about the full request's size or cost.
It also makes comparisons easier to interpret. Two integrations can use the same evidence allowance while sending different amounts of surrounding text.
What I want to learn from AML entries next
The AML Cycle 2 results provide a starting point for choosing systems to inspect. Following an entry into its documentation can reveal a more specific experiment than another ranking comparison.
Here, that experiment is to measure the gap between finding a conversation and delivering the conditions needed to act on it.
A strong retrieval score and a successful task are separate observations; tracing the intermediate evidence helps explain their relationship.
When debugging your memory layer, do you log the evidence candidates, the final packed context, or both—and can you identify which required condition disappeared between them?
Full leaderboard: https://agentmemoryleaderboard.ai
GitHub — mnemotree: https://github.com/kurcontko/mnemotree
來源:DEV Community · dev.to