
There’s a common assumption in agent design: If the model can read everything, give it everything. Load the wiki, the ticket history, the product docs, and last quarter’s Slack, and let the model sort out what matters. Bigger context windows have made that bet easier to place than ever.
But more information doesn’t necessarily produce better answers. As context grows, relevant evidence can become harder to identify, while outdated, contradictory, or simply distracting information competes for the model’s attention. The result can be an agent that has the right information available but still reaches the wrong conclusion.
The solution isn’t simply a bigger context window or a more capable model. It’s making sure the agent receives the evidence it needs to complete the task, without burying that evidence in unnecessary information.
That sounds obvious, but it isn’t easy. It starts with understanding what relevance means, and why achieving it takes more than finding documents similar to a query.
More context, worse answers: what the research shows
Research into long-context language models has exposed several ways additional information can undermine accuracy.
- Where evidence sits matters. In the 2023 “Lost in the Middle” study, Stanford researchers gave models 20 documents, one of which held the answer, and moved that document around. Accuracy was highest when it sat first or last and fell roughly 20 percentage points in the middle.
- Similar-but-wrong content does the most damage. Chroma’s 2025 “Context Rot” report tested 18 frontier models, including GPT-4.1, Claude 4, Gemini 2.5, and Qwen3. Every one degraded unevenly as input grew, even on simple tasks, and distractors that closely resembled the answer did the most damage. A separate benchmark from LMU Munich and Adobe Research found the same pattern.
- Length alone hurts. A 2025 paper from the Empirical Methods in Natural Language Processing conference, “Context Length Alone Hurts LLM Performance Despite Perfect Retrieval,” had models recite the relevant evidence word for word before answering. Even with perfect recall, accuracy dropped from 13.9% to 85% across five models as the input grew longer. It dropped even when the extra tokens were blank whitespace.
- Missing evidence breeds confident errors. Google’s “Sufficient Context” paper found frontier models answer well when retrieved context is complete. When it isn’t, they tend to answer anyway instead of saying they don’t know, and adding more context can make them even less likely to hold back.
These limitations become more consequential for agents than for traditional chatbots. While a chatbot may retrieve information once to answer a question, an agent may make a dozen or more retrieval calls in a single task as it plans, checks results, and refines its approach. Each call introduces additional tokens, latency, and opportunities for irrelevant or misleading information to influence the next decision. Worse, an incorrect intermediate answer can shape subsequent actions, allowing errors to compound throughout the workflow.
Put together, reliability depends on two properties of the context: sufficiency (the evidence needed to complete the task is present) and relevance (the information provided is useful for that task). Filling the context window prioritizes coverage at the expense of relevance, hoping that more information will include everything the agent needs. Effective retrieval aims to achieve both: enough evidence to support the task, without unnecessary information that could distract or mislead the agent.
What we mean when we say relevance
Relevance sounds straightforward, but it’s one of the hardest parts of retrieval to get right.
Vespa CEO Jon Bratseth says that “relevance is your moat.” As models get more capable and widely available, companies increasingly have access to roughly the same underlying intelligence. What differentiates them is their own information and how effectively their systems use it. For AI agents, that means finding the evidence that actually helps complete a task, not just information on the same topic.
For example, take a question like this one: “Can I enable this feature on our current deployment without upgrading?”
A semantic search might return the feature documentation, the release announcement, and a technical deep dive on how the feature works. All of them are on topic, and some might even rank highly because their language closely matches the query, but none really answer the question. The agent needs evidence about which versions support the feature, which version this customer is running, and any licensing or configuration requirements.
That’s the difference between topical similarity and task relevance. It’s also where the distinction between relevance and sufficiency becomes practical:
- Relevant but insufficient: The agent finds documentation about the feature but misses the version requirements needed to answer the question.
- Sufficient but noisy: The agent retrieves all the necessary evidence, but it’s mixed with outdated release notes, deprecated instructions, and other information that could lead it toward the wrong conclusion.
- Sufficient and relevant: The agent retrieves the current feature requirements and deployment details needed to answer, without unnecessary distractions.
Achieving that last outcome involves more than choosing a good embedding model or retrieving additional documents. Bratseth describes four dimensions of relevance that help explain the engineering involved:
| Dimension | What it means for an agent | What goes wrong without it |
| Comprehensiveness | The agent can find the information it needs in the searchable corpus. | Critical evidence is missing, forcing the agent to work with incomplete information. |
| Freshness | New and updated information becomes searchable quickly enough to reflect the current state. | The agent relies on outdated documentation or information that no longer applies. |
| Recall accuracy | Retrieval finds the right candidates, including exact names, codes, and versions, not just text that sounds similar. | The right document never makes it to ranking, so the agent cannot use it. |
| Ranking quality | The most useful evidence is prioritized so the model can select it for context. | The answer gets buried among less useful results or excluded from the context entirely. |
These dimensions work together. A perfectly ranked result is of little use if the underlying information is outdated. An up-to-date index won’t help if retrieval misses the right document. High recall can introduce more noise if ranking can’t distinguish useful evidence from related content.
“Similarity tells you whether a piece of text is related to a question. Relevance tells you whether it will help the agent answer the question correctly.”
Relevance isn’t a fixed property of a document. It depends on what the agent is trying to accomplish. Achieving it requires engineering the entire path from what information is available to what evidence ultimately reaches the model. Similarity tells you whether a piece of text is related to a question. Relevance tells you whether it will help the agent answer the question correctly. Most agent failures happen in the gap between the two.
Where common retrieval approaches fall short
Many retrieval approaches work well enough at first. The limitations become more apparent as data and traffic volumes grow, information changes, and agents take on more complex, multistep tasks. The problem isn’t necessarily in the technologies themselves, but in how they’re combined. A retrieval pipeline can fail even when the information needed to complete a task exists somewhere in the system.
These failures generally fall into three categories.
1. The right evidence never gets retrieved
An agent can’t use information that never makes it into the candidate set. Several common design choices can cause this:
- Relying on vector similarity alone. Vector search is great at finding conceptually related information, but similarity doesn’t capture every task requirement. Exact product names, error codes, version numbers, and business rules may matter more than semantic similarity. Without lexical matching, metadata constraints, or other relevance signals, a system can retrieve documents that sound right while missing those that contain the answer.
- Filtering after retrieval. Many stacks retrieve the top results by similarity and apply permissions or date filters afterward. The result set shrinks unpredictably, sometimes to nothing, and the agent concludes the information doesn’t exist. Applying constraints during retrieval helps ensure the candidate set contains eligible information.
- Expecting reranking to fix poor retrieval. A sophisticated reranker can improve the order of candidates, but it can’t recover a document retrieval missed. If the right document never reaches the ranking stage, no amount of downstream scoring can bring it back.
These are fundamentally recall problems. The information may be available and up to date, but the retrieval process fails to surface it.
2. The right evidence gets buried
Finding the right information is only half the challenge. The system must also distinguish the most useful evidence from other results that are related to the query but less useful for completing the task.
- Merging result lists instead of ranking them together. Many hybrid setups run keyword and vector search separately, then merge the two lists with a fusion method like reciprocal rank fusion. Fusion only looks at where each result is placed in each list, not why. It can’t tell that one document is the official spec and another is a forum post, or that one matches the customer’s version and another is two releases old. Weighing authority, version compatibility, and freshness requires ranking that scores candidates directly on those signals.
- Losing context through chunking. Small passages can improve retrieval precision, but they may omit surrounding information needed to interpret them correctly. For example, a configuration instruction might appear relevant until the preceding paragraph reveals that it applies only to an older software version. Ranking passages without access to document-level information can prioritize the wrong evidence.
These are ranking and evidence-selection problems. The right information has been found, but less useful information may be prioritized or selected instead.
3. The agent receives the wrong amount of context
Even when retrieval finds and prioritizes useful evidence, the system still needs to decide how much information to send to the model.
- Using long context as a substitute for retrieval. Large context windows let you provide more information, but they don’t eliminate the need to select what matters. Including outdated, contradictory, or loosely related material can make it harder for the model to use the right evidence. For agents making repeated model calls, unnecessary context also increases token costs and latency.
- Returning whole documents. Sending complete documents preserves surrounding context but can fill the model’s context window with material unrelated to the task.
- Sending a fixed number of results. A rule like “Always send 10 chunks” assumes every question needs the same amount of evidence. Some need one passage, while others may need 15. A fixed cutoff can leave an agent with insufficient evidence or overwhelm it with unnecessary information.
These are context-selection problems. The objective isn’t to minimize tokens at all costs, but to provide enough relevant evidence for the agent to complete the task without unnecessary distractions.
Across all three categories, the underlying issue is the same: Retrieving information isn’t the same as delivering sufficient, relevant evidence. A larger context window won’t fix missing candidates, poor ranking, or incomplete evidence. Reliable agents need retrieval pipelines that find the right information, prioritize it appropriately, and select what the model actually needs.
Engineering retrieval for relevant, sufficient evidence
Relevance isn’t a setting you turn on. It’s the result of several techniques working together, within a latency budget and against ever-changing data. Getting it right requires engineering the entire retrieval pipeline, from finding candidates to deciding which evidence reaches the model.
Five practices are particularly important.
1. Combine retrieval methods
Combine keyword matching and vector search in the same query. Keyword matching catches exact names, codes, and version numbers. Vector search catches paraphrases and intent. Agents ask both kinds of questions, often in the same session, so you need both kinds of retrieval working together, not two systems merged after the fact. Combining retrieval methods within a unified query and ranking pipeline also lets you evaluate candidates using shared relevance signals.
2. Apply constraints during retrieval
Dates, customers, permissions, regions, and product versions are hard rules, not hints. Applying filters during retrieval prevents a limited top-K candidate set from being reduced unpredictably by post-filtering. It also ensures the system searches among eligible documents rather than finding the most similar results first and discarding those that don’t qualify. Filtering at retrieval time complements access controls; it doesn’t replace them.
3. Rank in phases, on more than similarity
Retrieving the right candidates is only the beginning. The system still needs to determine which results provide the most useful evidence for the task.
Multiphase ranking makes it possible to balance relevance quality with computational cost. An inexpensive first phase evaluates candidates using signals such as keyword relevance, vector similarity, freshness, or source authority. More sophisticated ranking functions or machine-learned models can then evaluate a smaller set of promising results.
The signals and their relative importance depend on the task. Making these signals explicit allows developers to inspect, evaluate, and tune relevance rather than relying entirely on a model to infer what matters from the text.
4. Select passages, not entire documents
Finding the right document doesn’t mean the agent needs to read it all. A lengthy technical guide might contain only two passages relevant to the question.
Returning entire documents preserves context but can consume the model’s token budget with unnecessary information. Retrieving isolated chunks can be more precise, but those chunks may lack the surrounding information needed to interpret or rank them correctly.
A better approach is to preserve document-level information while ranking and selecting the most useful passages to send to the model. This helps retain the context needed to evaluate evidence without requiring the agent to process every paragraph.
5. Measure relevance and sufficiency separately
Don’t judge retrieval quality solely by whether the model produces a convincing answer.
Build an evaluation set from real agent tasks and measure whether retrieval finds the necessary evidence, whether ranking places it near the top, and whether the selected passages collectively contain enough information to complete the task.
Retrieval and ranking evaluation can help identify where relevant evidence is lost. Recall measures whether retrieval finds the right candidates. Ranking metrics such as normalized discounted cumulative gain (NDCG), which rewards placing the most useful results near the top, help assess how effectively the system prioritizes useful results. Evidence sufficiency requires an additional check: whether the selected information collectively supports the answer.
“A convincing answer based on the wrong evidence is still wrong.”
Test difficult cases deliberately. What happens when evidence is missing, outdated, contradictory, or spread across multiple sources? Does the agent retrieve more information, acknowledge uncertainty, or confidently produce an unsupported answer?
A convincing answer based on the wrong evidence is still wrong.
None of these techniques is new to search. Web search and e-commerce teams have spent decades refining retrieval, ranking, and relevance evaluation. What’s different with agents is how frequently these decisions are made and how directly they influence subsequent actions. A single task can involve repeated retrieval calls, with each result shaping what the agent does next.
Before you give your agent a bigger context window
Before increasing the amount of information an agent can process, make sure it’s getting the right information in the first place. A few practical checks can reveal whether the real limitation is context size or retrieval quality.
- Index everything the agent might need, and keep it current. Bring all the relevant sources into the searchable corpus: docs, tickets, release notes, and customer and deployment records. Apply additions, updates, and deletions as they happen, not in periodic batches. Retrieval can’t surface evidence that was never indexed. An index that lags behind reality will hand the agent instructions that no longer apply. A comprehensive index doesn’t mean a bigger context. It gives retrieval more to choose from so it can be more selective about what the agent reads.
- Use more than semantic similarity. Combine vector search with keyword matching when exact names, error codes, versions, or identifiers matter. Apply permissions and other constraints during retrieval so the right candidates make it into the results.
- Make recency and authority rankable. Capture metadata like update timestamps and source types so ranking can distinguish current, authoritative information from outdated or less trustworthy material.
- Treat context as a limited resource. Set a token budget for each step and prioritize the most useful passages rather than entire documents. Put the strongest evidence first, rather than burying it among less relevant material.
- Match the amount of evidence to the task. Some questions need one authoritative source; others require information from several. Don’t assume a fixed number of retrieved chunks will always be sufficient.
- Let agents search again. Let agents refine queries and retrieve missing information instead of loading everything into the initial prompt. When the evidence is incomplete, another targeted search may be more useful than a larger context window.
- Make uncertainty an acceptable outcome. When evidence is missing, outdated, or contradictory, the agent should acknowledge the limitation rather than produce an unsupported answer. A reliable agent needs to recognize when it doesn’t have enough information to proceed.
The goal is to provide enough reliable evidence to complete the task without making the agent sort through information it doesn’t need.
What’s next
Large context windows are useful. They give agents headroom for long tasks and complex instructions, but they’re capacity, not judgment. An agent can only be as reliable as the evidence it’s given, and that evidence comes from your retrieval and ranking system.
“More data gives an agent more to read. Relevant data gives it what it needs to get the answer right.”
That’s why relevance deserves more attention than it usually gets. It isn’t a single feature or a better embedding model. It’s comprehensiveness, freshness, recall accuracy, and ranking quality working together, plus the permission and sufficiency checks agents need on top. Each one takes deliberate engineering.
More data gives an agent more to read. Relevant data gives it what it needs to get the answer right.
To put this into practice, Vespa combines lexical, vector, and structured retrieval with multiphase, layered ranking in one engine. It’s available as open source or as a managed service on Vespa Cloud. The RAG Blueprint walks you through designing the schema, retrieval, and ranking step by step, and you can start a free trial to build it yourself.
The post Why giving AI agents more data can actually make them less reliable appeared first on The New Stack.
