The Hardest Part of Building a RAG System
When teams discuss Retrieval-Augmented Generation (RAG), the attention usually goes to vector database selection, embedding model tuning, or prompt engineering for the generation model. In real production environments, however, especially in high-density, time-sensitive, and precision-critical scenarios like financial news feeds, the hardest problem is rarely "can we retrieve anything." It is "does what we retrieved actually answer the question the user is asking right now." From a practical perspective on building a financial news RAG system, this article breaks down four genuinely difficult areas and offers reusable engineering methods for each.
The Hardest Part of Building a RAG System
When discussing Retrieval-Augmented Generation (RAG), many teams focus on vector database selection, embedding model tuning, or prompt engineering for the generation model. In real business scenarios, however, especially in high-density, time-sensitive, and precision-sensitive settings like financial news feeds, the hardest part is often not “can we retrieve something” but “does what we retrieved actually answer the question the user is asking right now.” From the practical perspective of a financial news RAG system, this article breaks down four genuinely demanding areas and presents reusable engineering methods.
1. The Real Difficulty: Semantic Alignment Between Evidence and Questions
Surface Similarity Does Not Mean Valid Evidence
Financial text has a typical characteristic: large amounts of content share the same market, the same units, and the same publication date, while the instrument, metric definition, and statistical scope may differ by only a small margin. Two news items both discuss crude oil: one reports the WTI closing price, the other the Brent closing price. Both use “USD/barrel” as the unit, and both are from the same day. From a vector similarity standpoint, they are nearly indistinguishable; from an answer-correctness standpoint, picking the wrong one skews the entire conclusion.
This shows that the core tension in RAG is not recall but evidence discriminability. The system must judge “does this fragment carry the necessary constraints to answer the question” rather than “is this fragment topically close to the question.”
Making Constraints Explicit
A practical approach is to perform “constraint extraction” before retrieval, decomposing the question into verifiable slots:
Question: What is the closing price of US oil?Slots: {instrument: US oil/WTI, metric: closing price, date: latest trading day by default}
Then match slots against candidate fragments, down-weighting or filtering out those missing key slots. This keeps “topically similar but definitionally mismatched” evidence out before generation, instead of hoping the generation model will correct itself.
2. Chunking Strategy: Do Not Discard Structural Information
The Inherent Flaws of Fixed-Length Chunking
Splitting by a fixed token count is simple to implement, but it cuts the logical connections in the original text. Worse, it discards the structural cues required to locate the source.
Consider a common type of content: a title reading “Key Financial Data Roundup,” with the body listing several unrelated items numbered 1, 2, 3. A user asks “what is item 2 in the data roundup.” Here the title, the column name, and the item number are themselves retrieval conditions. If chunking strips this structural information away, the remaining body text may be semantically complete yet still unreachable by that kind of question.
Chunk Along the Original Structure and Preserve Locator Metadata
The improvement is to split along the content’s own structure and write locator information into the index:
chunk = {"text": "US initial jobless claims for last week were 216,000, versus 220,000 expected","meta": {"title": "Key Financial Data Roundup","column": "Overseas Data","item_no": 2,"publish_date": "2024-06-20"}}
In practice, we once hit a numbered-item question where the top candidates from pure semantic retrieval all missed the target, while locating directly by the numbering rule retrieved the exact source text on the first attempt. The lesson: when designing chunks, first reason through how users might later ask about this material, and turn those likely question patterns into metadata fields.
Dual Channel: Retrieval Plus Rules
Scenarios with clear structure suit running “semantic retrieval + rule-based location” in parallel: strong constraints like item numbers, dates, and columns go through rule filtering, while semantic similarity handles fallback and fuzzy matching. Merging and re-ranking both result sets significantly reduces the failure rate for structured question patterns.
3. Retrieval Quality: From “Present” to “Used Correctly”
Looking Only at the Top Three Hits Masks Errors
A common evaluation criterion is “does the correct evidence appear in the top three.” This criterion is too lenient. In reality, the correct fragment may already be recalled and ranked second, but the generation stage actually cites a different real news item ranked first, so the answer names the wrong instrument. Under the old criterion, this question would be recorded as a hit and the problem would be completely hidden.
Joint Judgment Across Three Metrics
It is better to split evaluation into three independently recorded items:
| Metric | Meaning | Stage the problem points to |
|---|---|---|
| Correct evidence rank | Position of the correct fragment in the candidate list | Retrieval and ranking |
| Actually cited fragment | The evidence the answer truly uses | Evidence selection |
| Citation support | Whether that citation can support the conclusion | Answer verification |
Only by looking at all three together can you tell whether the problem lies in retrieval, evidence selection, or answer generation. Optimizing just one of them often yields poor returns for the effort.
Context Organization Is Also Part of Retrieval Quality
Retrieval quality is not only “is the fragment relevant” but also “how is the context organized.” Flattening multiple candidates together by similarity makes the model waver among similar pieces of evidence; a safer approach is to layer them by slot-match strength, placing strong matches first and attaching a brief match explanation to help the model build a basis for discrimination.
4. Data Coverage: Is That Day Actually in the Index
Hidden Gaps Caused by Pagination Limits
While backfilling nearly seven days of news, paging reached page 100 and triggered the pagination limit, so the range had to be narrowed to the last three days to finish the sync. Such gaps raise no error; they only surface when a user asks a question, appearing as an answer that sounds plausible but is subtly wrong.
The Time Trap of Similar Text
When a user asks for a given day’s Shanghai Composite close, the next day’s market recap is highly similar in wording: both discuss the Shanghai Composite, but each closing figure is bound to a different date. If the index lacks date filtering, the model can easily answer with evidence from the wrong date.
Coverage Check Before Querying
For a date-specific query, run a local coverage check first:
if target_date not in covered_date_set:return gap notice + latest synced date, and trigger incremental backfill
Explicitly stating “this day is missing” along with the latest synced date is more reliable than returning an answer that looks complete but is actually misaligned. On the engineering side, you can rely on object storage to keep raw snapshots, a message queue to drive incremental sync, and logging plus monitoring with alerts to track sync lag and gaps, forming a closed loop.
5. Conclusion
The hardest part of RAG is not getting vector retrieval to run, but building a system where evidence is discriminable, structure is locatable, citations are traceable, and coverage is verifiable. In scenarios like financial news feeds, a small difference in metric definition can make the entire answer wrong. Upgrading evaluation from a single hit rate to joint multi-metric judgment, upgrading chunking from fixed length to structure-aware, and adding a coverage check step before the query: these three changes typically deliver far more value than swapping in a larger generation model.
