The consumer varieties “assurance décénale” and the doc says “décennale.” One lacking letter, and a literal search finds nothing. Actual questions arrive with typos, and actual paperwork have their very own; earlier than retrieval can match something, somebody has to repair the spelling on either side.
This text is a bonus in Enterprise Doc Intelligence, a collection that builds an enterprise RAG system from 4 bricks. It tackles noisy textual content throughout the pipeline: consumer typos, fast-typing transcription noise, OCR character errors, what classical spell-check fixes, and what embeddings have to hold.
🧭 New to the collection? Each article on this collection sits on our two In direction of Knowledge Science creator pages, Angela Shi and Kezhan Shi. That’s the shortest method to see what is roofed and the place this one sits.

📓 Runnable companion notebooks are on GitHub: doc-intel/notebooks-vol1.

The identical downside exhibits up on either side of a pipeline. On the query aspect, kind “wat is teh covarge for fyre damge?” right into a chatbot constructed over an organization information base: three typos and a lacking letter, and the chatbot returns nothing helpful till the query is retyped rigorously. On the doc aspect, dump 50,000 buyer assist tickets into the identical pipeline for retrieval: half of them are written in fragments, abbreviations, combined case, with the identical type of errors, and the pipeline that labored for clear queries towards clear paperwork begins returning noise.
That is the noisy-text downside in enterprise RAG. It seems like a spell-check downside from the skin, however the precise trigger splits 3 ways. The consumer mistyped a phrase (a typo). The consumer typed beneath strain on cell and scrambled boundaries, dropped accents, abbreviated (transcription noise). The doc got here by OCR and a scanner silently changed O with 0, broke a fi ligature, cut up policyholder into coverage holder (OCR noise). All three finish with the identical symptom downstream: a token within the question or within the doc doesn’t actually match what it ought to, although the that means is undamaged. The classical spell-correction toolbox was constructed for one of many three. The opposite two are those that harm enterprise pipelines, and those embeddings are quietly constructed to soak up.

1. Forty years of classical spell-correction
Earlier than embeddings and LLMs, spell-correction was a solved engineering downside. 5 strategies cowl most of what ran in manufacturing between 1980 and at the moment, all with mature Python libraries (rapidfuzz, jellyfish, symspellpy, pybktree). The following subsections stroll by every, then shut with the case the place this toolbox solves the issue.
1.1 Levenshtein distance
The minimal variety of single-character edits (insert, delete, substitute) wanted to show one phrase into one other. The muse beneath nearly each spell-checker constructed within the final forty years.
A misspelled phrase’s “greatest correction” is the dictionary entry with the smallest Levenshtein distance, damaged by frequency in case of ties. The complete algorithm runs in O(n·m) time: quick on a single phrase, however on a 50,000-word doc it means one comparability matrix per phrase pair, which provides up rapidly.
1.2 BK-tree
A Levenshtein question towards a million-word dictionary is just too gradual in case you compute distance to each entry. The Burkhard-Keller tree (1973) indexes the dictionary so that every one phrases inside distance okay of a question are reachable in roughly O(log n).
This makes aspell and hunspell really feel on the spot. No machine studying, no GPU, only a intelligent index constructed on triangle inequality.
1.3 Soundex and Metaphone
Phonetic codes. They map phrases that sound alike to the identical key no matter spelling. Designed within the 1910s for U.S. census title matching, nonetheless helpful at the moment for surname lookup, drug-name disambiguation, voice-to-text post-processing.
Run on six near-homophone pairs, the 2 coders largely agree however disagree on the more durable spellings, which is why manufacturing methods carry each keys:

Phonetic matching catches the type of variation that Levenshtein misses: a French speaker writing Stéphane as Stefan, an English speaker writing Catherine as Kathryn. The value is that any two unrelated phrases that occur to sound alike collide.
1.4 SymSpell
The fashionable quick variant. Precomputes all deletes inside distance okay for each dictionary phrase and shops them in a hash. Lookup turns into a hash be part of, sub-millisecond on a 100k-word dictionary on a single CPU core.
Frequency breaks ties. The dictionary is greatest constructed from the goal corpus itself, not a generic glossary, so corrections land on phrases that seem within the paperwork the consumer is looking out.
1.5 Character n-grams
Index each phrase as a set of overlapping n-character substrings, then rating similarity by Jaccard overlap (the fraction of substrings two phrases share: eight matching trigrams out of 9 provides 0.89) on these units. Catches near-matches even when the misspelled phrase just isn’t within the dictionary.
The premise of each trendy fuzzy-search index that doesn’t depend on a curated dictionary (Elasticsearch’s edge-ngram analyzer, pg_trgm in PostgreSQL).
1.6 The place this all works
Hand the toolbox a single misspelled phrase with a transparent correction within the dictionary, and it solves the issue each time, in microseconds. Take a typical RAG question with a single typo:
The computed distances verify the ordering: protection lands at distance 1 alone, each different legitimate candidate sits at 2 or extra.

protection wins at distance 1, overage sits at 2: the textbook case the place classical spell-correction works – Picture by creatorprotection wins by a transparent margin, quick and deterministic, with no GPU. For this form of downside, classical strategies are nonetheless the correct software.
The difficulty begins when the form of the enter not matches this assumption.
2. The place the classical playbook breaks
Classical spell-correction was constructed round three assumptions: the consumer typed one phrase at a time, the typo produced a non-word, and the dictionary was the floor fact. Actual enterprise queries violate all three.
2.1 The typo produced a legitimate phrase
That is the most important gap within the classical toolbox. When a typo lands on one other correctly-spelled phrase, no spell-checker flags it as an error: there’s nothing to flag, each spellings are legitimate. The error just isn’t within the orthography however within the match between phrase and context.
The six pairs aspect by aspect with their distances and meanings make the lure seen:

A consumer varieties “what’s the overage on my house owner coverage?” in an insurance coverage chatbot. They nearly actually meant protection (the quantity the coverage pays out), not overage (the surplus quantity they owe previous a restrict). A classical spell-checker has nothing to flag: overage is within the dictionary, the SymSpell lookup returns it because the best-confidence match for itself, and the retrieval layer fortunately fetches paperwork about paying overages on utilization caps, not protection limits. The consumer will get a assured improper reply.
The explanation classical strategies can’t catch that is structural. They rating similarity towards the dictionary. Whether or not the phrase matches the question’s area is a special query fully. Answering it requires studying the encompassing textual content and figuring out that “house owner coverage” and “protection” co-occur within the corpus much more usually than “house owner coverage” and “overage” do. That’s what embeddings encode (Article 2). It’s also what no Levenshtein-style methodology has any method to entry.
2.2 Phrase boundaries are improper, not the letters
The opposite assumption the classical toolbox makes is that the enter is a sequence of well-separated phrases. When customers kind quick (particularly on cell, particularly beneath stress), they scramble phrase boundaries. They write coverage holder as policyholder, or non-employee labor as nonemployeelabor, or cut up house owner into house proprietor. Typically they merge two questions into one fragment with no punctuation.
OCR provides the identical downside from the doc aspect. A scanned PDF handed by Tesseract or AWS Textract returns textual content with damaged phrase boundaries on tight kerning, missed accents, and stray punctuation. A 1% character error price on a 500-page PDF is 25,000 damaged tokens. Lots of these damaged tokens are legitimate phrases after the boundary error: policyholder turns into coverage holder turns into the trigram set of two unrelated phrases.
The unit a classical spell-checker is constructed to repair is one phrase at a time. The unit that breaks in quick typing or noisy OCR is a sequence of phrases. As quickly because the boundaries are unreliable, Levenshtein has nothing to anchor to. That is the hole classical spell-correction by no means closed.
2.3 OCR replaces letters with different letters
Boundary scrambling is the loud OCR failure, however the silent one is worse. Fashionable OCR engines confuse sure glyph pairs in methods the human eye barely notices, and the result’s textual content that seems nearly proper however doesn’t match something a literal search would search for. The unique character is gone, changed by a near-identical one. No misspelling rule flags it, as a result of nothing was misspelled. The character was misinterpret.

Now stack this towards grep, the literal-search baseline each enterprise has on high of its file shares:
A distance of 4 on a 27-character phrase is the borderline the classical playbook can’t survive. Increase the fuzzy-search threshold to 4 and false positives explode (any unrelated 27-character phrase at distance 4 matches too). Drop it to 2 and the real OCR’d kind is missed. There isn’t a setting of the edge that holds each ends.

The asymmetry is the purpose. OCR distributes noise per character. Search phrases in enterprise queries are per phrase. The 2 scale in a different way, and Levenshtein has nothing to bridge the hole. The following part exhibits what cosine similarity does with the identical corrupted phrases.
3. Embeddings and LLMs deal with this naturally, however for various causes
Article 2 of the collection confirmed that embeddings (dense numerical representations of textual content, skilled on giant corpora) tolerate typos by design. polciy and coverage land shut in vector area as a result of the embedding mannequin has seen each, in comparable contexts, throughout coaching. telephone quantity and phone land shut for a similar motive. The embedding doesn’t right the typo. It simply doesn’t care about it as a lot as a literal-token matcher would.
How a lot does it not care, in observe? A brief calibration on actual text-embedding-ada-002 calls, evaluating two regimes on the identical type of enter the retrieval layer sees (full questions, not single phrases). The helper takes a skinny wrapper across the OpenAI embeddings endpoint, the identical one the remainder of the collection makes use of.
Run the identical helper on six consultant pairs (three typos, three look-alikes) and the distinction turns into seen:

Two readings of this desk matter.
Embeddings deal with typos reliably: Each typo pair sits above 0.95, no matter what number of letters had been flipped. The retrieval layer that runs on embeddings treats covarge and protection as the identical question, which is what we would like.
Embeddings deal with look-alikes solely when the encompassing context disambiguates. In insurance coverage textual content, “protection” and “overage” imply various things usually sufficient that the mannequin has realized to separate them: the cosine drops to 0.91. In a generic sentence, “have an effect on” and “impact” incessantly seem in interchangeable contexts, and the mannequin has no sign to maintain them aside: the cosine stays at 0.99. The knowledgeable key phrase dictionary from Article 6 is what catches the circumstances the embedding doesn’t.
Embeddings rescue OCR noise on lengthy phrases, the place Levenshtein gave up. The identical examine() helper utilized to the OCR-corrupted phrases from part 2.3 returns the decision cleanly. The literal distance is 2-4 (already within the false-positive zone for Levenshtein), however the cosine lands between 0.86 and 0.97 in each case, comfortably contained in the band a retrieval layer would deal with as a match. Concrete cosine numbers rely upon the embedding mannequin and the corpus. text-embedding-ada-002 produces the values under; different fashions (text-embedding-3-small, bge, e5, …) sit on totally different scales however present the identical ordering.

The explanation this works is that the embedding sees the phrase as a entire. Per-character noise on one token shifts the vector a bit; the remainder of the phrase pins the that means in place. When the noise spreads throughout a number of phrases (as in non-ernployee labor agreernent), every phrase stays near its clear kind, the encompassing tokens carry the that means, and the cosine sits at typo stage (0.95+). When it concentrates in a single quick phrase (as in po1icyho1der, the place two l → 1 substitutions wreck the identical token), the cosine drops additional (0.86) however nonetheless sits firmly within the retrieval band. The distinction with Levenshtein is the purpose: Levenshtein has nothing to fall again on previous the edge; the embedding all the time has the remainder of the phrase.
The true take a look at: the OCR’d time period sits inside a loud chunk. A retrieval pipeline doesn’t embed the question towards one other phrase; it embeds the question towards doc chunks which have the related time period sitting in a loud neighbourhood (different OCR errors, mangled identifiers, random codes, dates, rubbish tokens). The trustworthy query is whether or not the embedding nonetheless separates a bit that accommodates the time period from a bit that doesn’t, when each are noisy.

The related chunk wins, however solely by 0.028 over a loud chunk that occurs to share one associated phrase. Two information preserve this handy in observe.
Retrieval is top-k, not threshold-based. The pipeline pulls the highest 10 (or high 50) chunks by cosine, not “each chunk above 0.85”. The related chunk sits at rank 1; even when a related-but-irrelevant chunk lands just under it, each fall into the top-k collectively and the following stage decides. A skinny margin is barely an issue if the correct chunk falls out of the top-k, which it doesn’t right here, and which not often occurs on actual corpora so long as the chunks are saved small. Chunk dimension is a knob the pipeline owns.
Chunk granularity issues: line-level concentrates the sign, page-level dilutes it. The cosines above are for line-level chunks (about 100 characters every). Embed an entire web page and the result’s a special story.

The road-level vector is dominated by the goal tokens, so it scores excessive. Add eight or ten unrelated traces (premiums, deductibles, community phrases, exclusions) and the web page vector averages the sign throughout all of them. The cosine drops under even a loud chunk that shared a single associated phrase in determine 22. Line-level chunking is the lever that retains the related sign sturdy sufficient for top-k retrieval to seek out it. Article 2 of the collection went by this intimately on clear textual content; the identical conclusion holds, extra sharply, beneath OCR noise.
The numbers from figures 22 and 23 paint an image extra simply seen than tabulated:

For the borderline circumstances that stay, an LLM confirms. That is the pure subsequent layer: take the top-k chunks the embedding returned, ask a small LLM to learn every and make sure whether or not it solutions the question. The embedding does a budget filter (tens of millions of chunks down to 10); the LLM does the costly judgement on the few that stay. That is additionally the place the OCR’d token may be repaired in context: the mannequin reads po1icyho1der subsequent to identification quantity and infers the unique policyholder, although no spell-checker would.
LLMs go additional nonetheless. Hand a chat-completion name a query with 5 typos and a lacking phrase, and the mannequin understands the intent. The inner illustration is constructed on context, not on tokens being well-formed. The mannequin has learn sufficient textual content written by drained people to construct robustness into its inside layers.
So one may conclude: cease bothering with spell-correction, the embedding and the LLM cowl it. That’s the improper conclusion in enterprise RAG, for 2 causes.
The embedding tolerates typos for fuzzy matching, not for key phrase matching. When the retrieval methodology is cosine similarity over chunk embeddings, a small typo barely shifts the cosine rating (Article 2). When the retrieval methodology is precise key phrase matching (BM25: classical lexical search that weights uncommon phrases extra closely, or the knowledgeable key phrase dictionary from Article 6), a typo means a missed match. Most enterprise pipelines do each. The key phrase aspect breaks on typos that the embedding aspect absorbs.
The LLM tolerates typos within the immediate, not within the corpus. The chat-completion name sees the query and the retrieved chunks. If the retrieval missed due to a typo, the LLM can’t get well what it didn’t get. Errors within the query are absorbed by the LLM at era time. Errors within the paperwork should be dealt with earlier than retrieval, or the correct chunks by no means attain the mannequin.
So the query splits in two.
4. Two enterprise issues, not one
4.1 Spelling errors within the query
Customers misspell phrases. They abbreviate. They write in caps. They drop accents. The fitting place to deal with that is query parsing (Article 6), not retrieval. A parsed query goes by a normalization step earlier than any key phrase matching: lowercasing, accent stripping, growth of abbreviations towards the corporate glossary, and a spell-check move towards the corpus vocabulary. The output is a clear canonical kind of the consumer’s intent, plus a listing of expert-validated key phrases (concept_keywords_df from Article 6). The keyword-matching layer downstream sees solely the clear kind.
The selection of fresh kind issues. Spell-correcting towards a generic dictionary (Levenshtein towards the French Wiktionary) usually loses area phrases: insurance coverage jargon, inside acronyms, product codes. The fitting dictionary is the corpus vocabulary itself, weighted by frequency within the firm’s personal paperwork. SymSpell towards a corpus-built index runs in microseconds and corrects to phrases that seem within the paperwork the consumer is looking out.
For the key phrase layer, that is important. A misspelled key phrase within the consumer’s query maps to a correctly-spelled key phrase from the corporate’s vocabulary, and the BM25 / exact-match index returns hits. For the embedding layer, the correction is much less vital (the embedding already absorbs the typo), however making use of it doesn’t harm and makes downstream debugging simpler.
The normalization step is a small composition of low-cost operations, every of which may be skipped on a per-corpus foundation:
The order issues. Stripping accents earlier than lookup means the consumer’s résiliation and the corpus’s resiliation (after the identical strip) collide on the identical key: a corpus-built SymSpell index keyed on stripped tokens does the correct factor. Increasing abbreviations earlier than spell-correction means the SymSpell move sees the expanded kind (comite reglement police), which is way extra more likely to have a clear dictionary entry than the acronym (crp).
4.2 Spelling errors within the paperwork
Most enterprise reference paperwork are clear. Insurance coverage insurance policies, employment contracts, regulatory filings, inside procedures: all written, reviewed, signed off. The spelling-error price is near zero.
The exceptions matter although, as a result of they cluster across the corpora that engineers most frequently wish to make searchable:
-
Buyer assist tickets: Free-form textual content, written beneath strain, usually by customers for whom the language just isn’t native. Blended case, no punctuation, abbreviations, the entire catalogue.
-
Buyer evaluations and suggestions: Similar form, plus deliberate informality.
-
Inside chat logs and emails: Looser than reference paperwork, filled with fast-typing artefacts.
-
Scanned paperwork handed by OCR. Even good OCR engines (Tesseract, AWS Textract, Azure Doc Intelligence) introduce errors:
0forO,1forl, damaged phrase boundaries on tight kerning, missed accents on non-Latin scripts. A 1% character error price on a 500-page PDF is 25,000 damaged tokens.
These are the corpora the place document-side spelling errors harm retrieval. The technique is determined by how necessary the paperwork are.
5. The technique fork: clear what issues, fuzz round the remaining
Two paths, picked per corpus, not per doc.

5.1 Essential reference paperwork: clear them as soon as
When the corpus is the canonical supply of fact (the usual contracts, the technical specs, the regulatory texts the corporate is sure by), the correct transfer is to clear it as soon as, correctly. Spend the engineering hours upfront and by no means take care of the noise once more.
Concretely, this implies a parsing move that mixes:
-
A spell-correction sweep towards the corpus vocabulary, with confidence thresholds (auto-correct above
T_high, flag-for-review betweenT_lowandT_high, depart alone underT_low). -
A LLM cleanup move on the flagged sections, with quick context home windows so the mannequin fixes typos with out inventing content material.
-
An knowledgeable evaluation move on the highest-stakes sections (the desk of protection limits, the indemnity clauses, the coverage numbers).
The cleaned corpus is the brand new supply of fact. Downstream retrieval, embedding indexing, and key phrase extraction all run towards the cleaned textual content. The fee is one-time per doc model. The profit compounds throughout each question for the lifetime of the doc.
The edge values are tunable per corpus. On contracts and regulatory filings, t_high = 0.95 retains the auto-correct conservative as a result of a improper correction in a authorized clause is pricey. On inside procedures and coaching supplies, t_high = 0.85 lets the system clear extra aggressively as a result of the draw back of a missed correction (a worse retrieval hit) is cheaper than the price of human evaluation.
5.2 Quantity paperwork: optimise the search as a substitute
When the corpus is giant, fast-changing, and the per-document worth is low (tickets, evaluations, chat logs, OCR’d scans), cleansing each doc just isn’t value the fee. Right here the technique is the other: depart the paperwork as they’re, and design retrieval to work across the noise.
The form of that retrieval is a coarse-to-fine cascade: web page, then line, then LLM. Every stage narrows the candidate set, and simply as importantly, the unit of comparability shrinks with it.

The recipe falls out of the cascade:
-
Embed on the line stage, not the web page stage (Article 2 part 3.1). The shorter the chunk, the much less noise dilutes the sign of the few correctly-spelled tokens that do exist. Stage 2 of the cascade is the purpose of this rule.
-
Use embeddings as the first retrieval methodology, not BM25. Embeddings take up a lot of the typos; BM25 amplifies them. Each levels 1 and a couple of of the cascade run on embeddings.
-
Hold an knowledgeable key phrase dictionary that maps clear canonical varieties to all of the variants seen within the corpus (
protection→covarge,covrage,coveerage,coverag, …). The dictionary is constructed incrementally by the consultants as they encounter new variants, not at index time. -
Let an LLM learn the top-k traces the embedding returned (stage 3 of the cascade). At line granularity the mannequin name prices a fraction of a cent per candidate, and the mannequin is the one step within the pipeline that reads the that means. The operate under is one variant of stage 3: relatively than confirm every line, it kicks the LLM in as a query-correcting fallback when retrieval got here again empty. The verify-each-line form is identical name utilized per candidate as a substitute of per question.
The log_correction name makes the fallback an asset relatively than a workaround. Each time the LLM fixes a spelling error the embedding couldn’t take up, the corrected kind is written to a log. After a number of weeks, essentially the most frequent corrections grow to be candidates so as to add to the corpus’s SymSpell index, the knowledgeable key phrase dictionary, or the abbreviation map. The fallback progressively turns into redundant for the patterns that present up usually.
This isn’t a everlasting answer. It’s a working strategy that lets the crew begin serving queries whereas the cleansing venture occurs (or is descoped indefinitely).
The Levenshtein substitution lure. The retrieval-time LLM name prices a number of cents per top-k batch, and on a million-chunk corpus that provides up. The reflex is to exchange the LLM with Levenshtein, which is free and native. Tried on the identical noisy chunks as determine 22, the result’s sobering.

The 63 / 70 / 90 distances will not be “improper” as a rating, however they’re unusable as a retrieval sign. Any retrieval system primarily based on Lev < T would both retrieve each chunk within the corpus (T = 90) or none of them (T = 50). The basic concern is that Levenshtein scales with size distinction, not with semantic distance, and on an actual corpus the chunk lengths differ way over the contents do. Including boundary-aware tokenisation will get you out of the length-scaling downside solely to drop you again into the multi-word alignment issues of part 2.2.
Levenshtein is the correct software for one comparability at a time, a phrase towards a dictionary, the part 1.6 case. It isn’t the retrieval primitive. The pragmatic reply to LLM price is to not change the LLM however to let the embedding minimize the corpus from tens of millions of chunks to 10 candidates first. At that time the LLM verification name on a single line prices a fraction of a cent, and it’s the solely step within the pipeline that reads the that means.
5.3 Knowledge high quality is a continuous-improvement downside
The lure is treating knowledge high quality as a one-time cleanup venture. “We’ll repair all of the spelling, then construct the RAG.” The corpus modifications quicker than any cleanup venture finishes. New tickets land every day. New scanned PDFs seem weekly. New product names enter the vocabulary month-to-month.
The continual-improvement framing: the system launches with no matter cleansing has been achieved, plus the dictionary the consultants have constructed to this point. Each failed question is a sign of both a lacking dictionary entry, a lacking alias, or an unhandled OCR sample. The knowledgeable curates the repair. The dictionary grows. Subsequent month’s queries do higher than final month’s. Six months in, the crew has constructed up a corpus-specific spelling-correction layer that no off-the-shelf software would have produced.
This is identical sample because the broader argument of the collection: amplify the knowledgeable, don’t attempt to change them. Skilled information of what the variants of “non-employee labor” are in our contracts is strictly the type of domain-specific info no embedding mannequin and no spell-checker has, and that the human crew can encode incrementally.
6. Conclusion
There isn’t a single “spelling downside” in enterprise RAG. There are three sources of noise feeding the identical symptom. Classical spell-correction (Levenshtein, BK-tree, Soundex, SymSpell) handles the primary one properly: a single misspelled phrase towards a dictionary. It struggles with the opposite two: fast-typing transcription noise (scrambled boundaries, dropped accents, look-alike substitutions the place the typo is an actual phrase), and OCR character noise (l turns into 1, rn turns into m, ligatures break) the place the edit distance compounds with phrase size and grep returns nothing in any respect. Embeddings carry each: the cosine on a typo or an OCR-corrupted multi-word phrase sits in the identical retrieval band as a clear match, as a result of the embedding sees a phrase as an entire and per-character noise on one token barely strikes the vector when the encompassing tokens maintain the that means. The precise numbers rely upon the embedding mannequin and the corpus; the ordering is what issues.
The sensible cut up for enterprise RAG: spell-correct the query at parse time towards the corpus vocabulary; clear the canonical reference paperwork as soon as; lean on embeddings for the quantity corpora the crew won’t ever end cleansing. The orthographic layer is a steady enchancment system the consultants develop alongside the corpus, not a once-and-done venture.
7. Sources and additional studying
The edit-distance + unigram-frequency baseline the article makes use of is Norvig’s The right way to Write a Spelling Corrector (2007). The pre-computed-deletion lookup trick that makes the corpus-vocabulary path O(1) is Garbe’s SymSpell (2012). The phonetic-matching layer is Philips’s Metaphone (1990), nonetheless used for surname and drug-name matching. The article’s framing is the two-path normalisation cascade: SymSpell + Metaphone towards the corpus vocabulary first (deterministic, O(1), auditable), LLM fallback just for the residue the place the corpus has no spelling in any respect.
Earlier within the collection:
-
Doc Intelligence: collection intro. What the collection builds, brick by brick, and in what order.
What works, what breaks
-
Baseline Enterprise RAG, from PDF to highlighted reply. The four-brick pipeline finish to finish: PDF in, highlighted reply out.
-
Embeddings Aren’t Magic: The Predictable Failure Modes of RAG Retrieval. The place embedding similarity wins (synonyms, typos, paraphrase), the place it predictably breaks (unknown phrases, negation, term-vs-answer relevance), and the best way to use it anyway.
-
RAG just isn’t machine studying, and the ML toolkit solves the improper downside. Why chunk-size sweeps and finetuning optimize the improper factor; route by query kind as a substitute.
-
From regex to imaginative and prescient fashions: which RAG method matches which downside. Two axes, doc complexity and query management, that choose the method for every case.
-
10 widespread RAG errors we preserve seeing in manufacturing. Ten manufacturing errors, organized brick by brick, with the repair for every.
-
Doc parsing
-
Constructing Doc Construction with Loop Engineering: Recovering a PDF’s Define from Physique Typography for RAG. Rebuilding the define from physique typography when the PDF ships no contents web page in any respect: six indicators, one bounded loop.
-
Earlier than Full Agentic RAG: Know How You Resolve, and the Parsing Strategies You Choose From. The parsing strategies as a listing, and the choice of which to run, earlier than handing the loop to an agent.
Technology
-
Loop Engineering for RAG Technology: Iterate top-k One at a Time. Studying the retrieved pages separately as a substitute of , and what that buys when the reply sits in solely one in all them.
-
Most RAG Hallucinations Are Extraction Errors: Seven Patterns for a Typed Technology Contract. Seven recurring methods a mannequin will get the extraction improper, and the typed contract that catches each.
-
Loop engineering for RAG era: an LLM cascade from an affordable native mannequin as much as a hosted flagship. Beginning on an affordable native mannequin and escalating solely when the reply doesn’t maintain up, measured.
One-document pipelines
-
Immediate Engineering Isn’t Sufficient: How 4 Bricks of Context Engineering Cease RAG Hallucinations. Why a greater immediate doesn’t repair a improper web page, and what every of the 4 bricks contributes to the context as a substitute.
-
Minimize an Enterprise RAG Pipeline’s Latency and Value by Calling the LLM Much less, Not by Shopping for a Quicker Mannequin. Reducing a pipeline’s latency and value by calling the mannequin much less usually and cheaper, not by shopping for a quicker one.
-
RAG workflow and loop engineering: the dispatcher that decides when to loop and when to cease. Suggestions loops, bounded iteration, and the dispatcher, composed into one workflow.
-
Loop engineering for RAG: the small loops inside every step, the massive loops throughout the pipeline. The 2 scales of loop: small bounded loops inside every brick, huge generation-triggered loops throughout them.
-
Mannequin and dataset notes. The cosine numbers proven throughout sections 3 and 5.2 come from actual calls to text-embedding-ada-002, an OpenAI proprietary embedding mannequin ruled by OpenAI’s Phrases of Use. Different embedding fashions (text-embedding-3-small, bge, e5, …) produce totally different absolute cosines on the identical pairs however protect the relative ordering the article depends on.


