[KongchangAI]
· 3 min read· 1,565 words

RAG Retrieval Gone Wrong? The Real Problem Lurks in Chunk Boundaries

RAG Retrieval Gone Wrong? The Real Problem Lurks in Chunk Boundaries

Poor RAG results stem from chunk boundaries and metadata, not embedding models; Agent success depends on patterns, not frameworks.

The article argues that RAG's "technically correct but contextually useless" results stem from chunk boundaries and metadata design, not embedding models. Assumptions about which contexts belong together often fail, so isolated chunks make models hallucinate. Fixes include overlapping windows, semantic chunking, parent document retrieval, and rethinking stored content. It also criticizes the overuse of "Agent," noting production Agents are mostly narrow pipelines where tool design, failure handling, and observability matter most. Frameworks are noise; patterns are reusable assets.

RAG Retrieval Gone Wrong? The Real Problem Lurks in Chunk Boundaries

RAG Pipeline original article screenshot

When building RAG, many teams habitually focus on embedding models, vector databases, and retrieval algorithms, while overlooking a more fundamental and error-prone step: document chunking. After long-term observation of production systems, the original author points out that when RAG returns results that are "technically correct but contextually useless," the problem is almost always in chunking or metadata—not the embedding model.

1. "Agent" Is Overused, and Engineering Decisions Go Astray

The original article opens by highlighting an industry phenomenon: function-calling tools are called Agents, chatbots with memory are called Agents, and scripts with loops are also called Agents. This semantic dilution is not a trivial matter—it directly leads to engineering misjudgments: simple pipelines get over-engineered, while genuinely complex systems lack the architecture they deserve.

The author's definition is: an Agent should have goals rather than instructions, be able to decide its next step autonomously, handle failures, and judge when a task is complete. If every step requires a human to tell it what to do, it's just a chat interface; being able to recover from a failed tool call and take another path is the entry level; being able to decompose a goal into subtasks and delegate them is a true Agent.

The value of this definition is that it helps teams decide before they start building: do I actually need an Agent? Many workflows can be solved with a well-structured prompt, and forcing in an orchestration layer only adds maintenance cost.

2. Agents in Production Are Actually All "Narrow"

The original article is quite restrained in describing real deployments: most Agent use cases are narrow—customer service ticket routing, document extraction, code review for a specific codebase. They are not general reasoning engines, but purposeful pipelines with an intelligent decision layer.

Teams that get results don't focus on chasing the latest models, but on three things: whether tool design is clean, whether failure handling is in place, and whether observability can trace the decision path. Conversely, teams that get poor results often swap GPT-4 for the latest frontier model, change nothing else, and then expect behavior to change.

This observation connects to the RAG problem: the model is just one component in the system; system behavior is determined by architecture, not by model version.

Observability in Agent systems refers to the ability to track and reconstruct the complete decision path of a task execution, including the inputs and outputs of each tool call, the intermediate steps of model reasoning, and the reasons for failed retries. It differs from traditional logging: logs record "what happened," while observability must answer "why it happened." For Agents, because behavior is dynamically determined by the model, a lack of observability means you cannot pinpoint the root cause of hallucinations, infinite loops, or tool misuse. Common practices include assigning a trace ID to each run, structurally recording a context snapshot at each step, and visualizing the decision path. An Agent system without observability is nearly impossible to debug and trust in production.

3. The Framework Wars Are Noise; Patterns Are the Asset

LangChain, LangGraph, CrewAI, AutoGen, Semantic Kernel—new frameworks appear almost every month, and someone always writes an article declaring an old framework dead. The original author's stance is clear: frameworks matter less than patterns.

Several patterns he has repeatedly validated include:

  • Plan first, then execute: one reasoning step produces a plan, another execution step follows the plan; don't mix the two.
  • Separate retrieval from reasoning: fetching context and using context are two different things; mixing them confuses the system.
  • Explicit handoff: when Agents pass work between each other, the handoff should be structured and recordable, not a string passed through a prompt.

The author mentions rebuilding the same architecture with three different frameworks, with basically identical results. Frameworks are scaffolding; architecture is the building itself. This judgment has direct reference value for teams currently choosing a stack: rather than agonizing over frameworks, define the patterns first.

Explicit Handoff is a design pattern in multi-Agent collaboration: when one Agent transfers a task to another, the handoff content should be a structured data object (such as JSON containing the task description, completed steps, to-dos, and constraints) rather than a free-text prompt. The benefit of structured handoff is that it is verifiable, recordable, and replayable—the receiving Agent can clearly know the prior state, and the system can trace which handoff lost information when problems occur. By contrast, implicit handoff via string passing in prompts easily loses key constraints during transfer and is hard to check automatically. This pattern aligns with "separate retrieval from reasoning"; the core of both is making implicit assumptions explicit.

4. The Real Root Cause of RAG: Chunk Boundaries

This is the core of the entire article. RAG is already standard for production AI systems involving proprietary data, but tutorials rarely explain one problem clearly: chunk boundaries are wrong.

When you chunk and embed documents, you are actually making assumptions about "which contexts belong together." These assumptions often fail. A paragraph that can only be understood in light of the previous paragraph, when retrieved in isolation, leads the model to hallucinate the missing context.

The improvement path given in the original article has three layers: better chunking strategies such as overlapping windows, semantic chunking, and parent document retrieval can alleviate the problem; but the real fix is rethinking what to store—sometimes what should be stored is not raw text but a structured representation of the information; and if you find that RAG returns results that are "technically correct but contextually useless," the problem is almost certainly in chunking or metadata, not the embedding model.

This judgment is worth self-checking for every RAG team: before switching embedding models, look at your chunking strategy and metadata design.

Semantic Chunking is a strategy that splits documents based on content meaning rather than a fixed character count. A common approach is to first compute embedding similarity between adjacent sentences or paragraphs, and when similarity falls below a threshold, treat it as a topic boundary and split there. Compared with fixed-length windows, semantic chunking makes each chunk more topically coherent, reducing cases of "half a sentence cut off" or "mixed topics in one chunk." But it is not a silver bullet: threshold selection is empirical, computational cost is higher, and a sudden similarity drop does not necessarily correspond to a true semantic boundary. In practice it is often combined with overlapping windows and paired with metadata labeling the source section of each chunk, so context can be traced and completed after retrieval.

Parent Document Retrieval is another way to mitigate chunk boundary problems. The idea: index smaller child chunks (e.g., sentence-level) to ensure retrieval precision, but return to the model the larger parent chunk (e.g., an entire section or paragraph) that the child belongs to. This avoids long chunks diluting semantics in embeddings while ensuring complete context for generation. Implementation typically requires maintaining a child-to-parent mapping and performing an aggregation and deduplication step after retrieval. Parent document retrieval is particularly suited to technical documentation, legal contracts, and other materials with clear structure but strong context dependence.

5. The Competitive Edge of the Future: Maintainable, Trustworthy Systems

The original article's prediction for future trends is plain: models will keep getting better, context windows will keep expanding, and cost per token will keep falling. But none of this changes the fundamental engineering challenge—building a system that behaves correctly when no one is watching.

The author believes the problems worth solving are governance, observability, and reliable tool calling, not chasing leaderboards. The engineers who truly matter in two or three years will be those who can build AI systems that other engineers can maintain and trust. This is a capability closer to system design than to model research.

The original article also mentions a few industry developments in passing: Anthropic pledged to contribute 5% of its shares to a "public interest fund"; Disney agreed to hire most of Character.AI's staff; Meta removed wording that triggered concerns about crawling and AI training. These developments do not change the engineering judgments above, but they reflect ongoing changes in AI industry governance and talent flows.

For teams building RAG or Agent systems, the value of this article is not new tools, but drawing attention back to the unsexy parts: chunking, metadata, failure handling, and observability. These are what determine whether a system can be trusted.

One-line Summary

Poor RAG results stem from chunk boundaries and metadata, not embedding models; Agent success depends on patterns, not frameworks.

Paragraph Summary

The article points out that when RAG returns "technically correct but contextually useless" results, the problem is almost always in chunk boundaries and metadata design, not embedding models. The assumptions made when chunking about "which contexts belong together" often fail, and isolated retrieved paragraphs lead the model to hallucinate missing context. Improvement paths include overlapping windows, semantic chunking, parent document retrieval, and rethinking what to store. The article also criticizes the overuse of the term "Agent" leading to engineering misjudgments, emphasizing that Agents in production are mostly narrow-scenario pipelines, where success hinges on tool design, failure handling, and observability. The framework wars are noise; patterns such as plan-first-then-execute, separating retrieval from reasoning, and explicit handoff are the reusable assets. Future competitiveness lies in building maintainable, trustworthy systems.

#RAG#chunking#Agent#observability#embedding model#semantic chunking#parent document retrieval
Share:

Related articles