This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
Thursday, 08 January 2026
若您在 RAG='中是全新的 RAG},}开始于 RAG 解释 和 RAG 建筑结构@.@'}这是你建造RAG输油管的地方 多数为 {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}为什么它回答说"?"调试会"?
包括#: @% RAG. 生产背后的建筑图案 用 RAG 构建文档摘要器.
从哪来的? 我建造的 DocSummamer 缩写器 (Document RAG 引擎=), 数据合成器 (DataRAG 引擎), 图像合成器 (-图像RAG引擎+), 音频合成器 -=YTET -伊甸园字幕组=- 翻译: 更清晰 , 数据@, 图像 @,和音频=.
您可能正确地注意到这个网站的语义搜索已破损@ ... @ and yeah it'_s a config sublication I has@'}t have time to fix
| @ | _Term { | }它意味着什么? ~ | }示例@ |
|---|---|---|---|
| RAG 区域包 在回答“ | ”之前,先给您公司一个LLM文件 | ||
| 弹头 将文档分割成小块 *\ | \ 打破一个 PDF 到段落\ MPK2\ { | ||
| 上端的-k “ | ” 获取搜索结果“"” “MSBET” “ | ” “I"” 给我看看最相关的块“MS K5” (MSSK6) @ @ | } |
| 矢量搜索 @ | } 使用嵌入式 { | } \ _ MS K2 find docs 来查找类似文字, 类似于此错误消息@"}\ | |
| BM25 | +关键字搜索@ | + @"#Find docs 包含 <'_timeout '}和<'{database>'"+ | # |
| 上下文窗口 | + | +Finite和昂贵的# | }您能装在快速 & MSSK1Q中有多少文字适合 |
| 信号 @"_Priority@:High"}高音 MSK7# | _ |
检索+(RAG)成为其中之一,这意味着 什么都没有,一无所有.
对于很多球队来说 ,+#“BARBAR”}现在是:
它的工作原理 . 直到它达到’为止
@’QQS 昂贵的@,QASONAS 很难理解关于 @MS K3QAS, 它会悄悄地对模型负责 #:QAS 分析结构,Q}强制执行过滤器#,Q}决定什么重要 ,Q调和矛盾 ,QAZ 并有信心相信它$.
当人们说““’RAG幻觉” “”’ 或“MS K2‘RAG doesn't ’’ t过滤井” 他们通常责怪错误的成分 .
问题在于RAGQ. 问题是 懒懒的RAG.
此文章描述不同的默认值@: @% 减少的RAG -使用LMM 小于@,_Not more\ ,}通过在前面提取确定性信号,将模型视为模式 合成合成引擎# , # 不是# 数据存储.
上下文窗口是 @: @%
这不是一个数据存储@. @%
当你问:的模型时 只需多插几根
这就是为什么RAG演示看起来很棒 并且生产RAG系统静悄悄地腐烂.
减少RAG翻转默认值@. @%
而不是:
获取文本, 让模式决定什么重要 @. @%
你做:
决定什么重要 曾经',存储它 ,,只有在需要合成时才涉及模型=.
在实践中,这意味着 廉价检索 ,捆绑的一代.
如果此声音听起来熟悉 @ , @ it@ MS K1}%s 和 受限制的模糊: 允许概率组件 提议; 让定型系统 决定.
让我们先看看大多数球队都做了些什么 以及为什么它很贵
flowchart LR
subgraph Traditional["❌ Traditional RAG: Everything Through the LLM"]
T1[Documents] --> T2[Chunk Everything]
T2 --> T3["Embed All Chunks<br/>(once)"]
T3 --> T4[Vector Search]
T4 --> T5["Paste Top-K<br/>(per query)"]
T5 --> T6["LLM Decides<br/>(per query)"]
T6 --> T7[Answer]
end
style Traditional stroke:#ef4444,stroke-width:3px
style T6 stroke:#ef4444,stroke-width:3px
style T5 stroke:#ef4444,stroke-width:2px
问题 @:
现在这里=' 减少的RAG接近*:
flowchart TB
subgraph Ingestion["✅ Ingestion (Once - Pay Upfront)"]
I1[Source Docs] --> I2[Parse Structure]
I2 --> I3["Extract Signals<br/>(deterministic)"]
I3 --> I4[(Structured Fields)]
I2 --> I5[Semantic Units]
I5 --> I6[(Vector Store)]
I2 --> I7[(Evidence Store)]
end
subgraph Query["Query Time (Cheap Per Query)"]
Q1[User Question] --> Q2{Extract Filters}
Q2 --> Q3["Filter Database<br/>(no LLM)"]
Q2 --> Q4["BM25 Search<br/>(no LLM)"]
Q2 --> Q5["Vector Search<br/>(no LLM)"]
Q3 --> R[Candidate Set]
Q4 --> R
Q5 --> R
R --> S["Small Evidence Pack<br/>(5 sources not 50)"]
end
subgraph Generation["LLM (Bounded Synthesis Per Query)"]
S --> L[Synthesize Answer]
L --> A[Answer + Citations]
end
style Ingestion stroke:#22c55e,stroke-width:3px
style Query stroke:#3b82f6,stroke-width:3px
style Generation stroke:#f59e0b,stroke-width:2px
style I3 stroke:#22c55e,stroke-width:3px
style Q3 stroke:#3b82f6,stroke-width:3px
style L stroke:#f59e0b,stroke-width:3px
密钥差异@: @%
-=YTET -伊甸园字幕组=- 翻译: |-------|----------------|-------------| | 摄食 @|just push and insepting #|}解压缩日期 ,_Q分类,}实体=,}品质旗@|{ | 过滤 “|”请LLM迅速过滤“|”数据库,其中含有“MS K2”的条款。 | 搜索 | 矢量只| BMQ25 MS K3 病媒 □+ 结构过滤器 *| | LLM 作用 @ | passe 过滤器@ , 并回答 *|} 只是合成答案@| | 费用成本 @|_每个查询都为整个背景支付费用 {|}%spession once *,}询问便宜的@|
在消食时间, 分析您能做的 无无 一个LLM.
suppicle : 支援票券系统
而不是仅仅在文本中填入票@: @%
Traditional: "Ticket #1234: Customer complained about slow loading..."
→ Embed entire text
→ Hope the LLM figures out it's about performance
提取前端的信号@: @%
// Parse once during ingestion
var ticket = new SupportTicket
{
Id = "1234",
CreatedDate = DateTime.Parse("2025-01-15"),
Category = "Performance", // ← Deterministic field
Product = "WebApp", // ← Filterable
Priority = "High", // ← Sortable
Customer = "Enterprise", // ← Segment filter
SentimentScore = -0.3, // ← Computed once
Tags = ["slow-loading", "timeout"], // ← Searchable
Text = "Customer complained about..." // ← Still keep for RAG
};
你能从中提取到什么?
| “ | ”信号类型“ | ”实例“ | ”为何重要? |
|---|---|---|---|
| 时间时空 @ | _Created date@,}更新日期=%,}过期时间={ | }"}上星期唯一显示的 '}误差=%"}MPK7} | |
| 分类符号 -=YTET -伊甸园字幕组=- 翻译: | |||
| 数值 @ | #@"#Sort 按严重性分列#"MSC7# | ||
| 身份识别特征 @ | _作者@,_BARBAR_客户 ID,}(SKU),_发票 *##}{ | }*"}所有来自顾客的机票 | |
| 质量质量 “ | ” OCR Information@, @Outo=-}生成的旗子 @ | @ @%"#Exclexdude low_-}(信任 OCRQ | |
| 证明书 | Q来源系统 @,QFile path@,Q URL _ | }"Q 仅来自生产日志%"{ | } |
保存输出@. @ that'_s 您的系统可以依赖#.}
RAG 的硬部分是 @'}(不是模型) #- It='* 具体实施情况*,}见 用 RAG 构建文档摘要器 和 建筑RAG管道.
而不是将 @"_chunks@"}和指针放在源代码.}♪
文本仍然是系统的一部分 @ - @ 但变成 证据证明{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}什么?
这是“"RAG ” 的答案与“{"和 “"〞RAG 的回答之间的差别。
你没有做 ' t. 不是前面的.}
整个储存点 原始信号 取代 LLM @ -}处理的概要@.
传统RAG @(}(改变成本昂贵) ∮):
// ❌ You asked the LLM to "summarize the key points"
var summary = await llm.Summarize(ticket.Text); // Expensive
await db.SaveAsync(summary); // Threw away the original structure
// Later: "Actually, we need sentiment scores too"
// 😱 Have to re-process 10,000 tickets through LLM again!
变换RAG ):+Q(#cheap 的降为 RAG @ MS K0 @ cheap
// ✅ Store raw signals extracted deterministically
var signals = new TicketSignals
{
Text = ticket.Text, // ← Keep original
WordCount = ticket.Text.Split().Length, // ← Cheap to compute
ContainsErrorCode = Regex.IsMatch(ticket.Text, @"ERR-\d+"),
MentionedProducts = ExtractProducts(ticket.Text), // ← Heuristic
SentimentWords = CountSentimentWords(ticket.Text), // ← Word lists
CreatedHour = ticket.Created.Hour // ← Maybe useful later?
};
// Later: "We need to prioritize by sentiment"
// ✅ Just add a computed column - no LLM re-run needed!
await db.ExecuteSqlAsync(@"
ALTER TABLE Tickets ADD COLUMN SentimentScore AS
(SentimentWords->>'positive' - SentimentWords->>'negative')
");
刚刚发生了什么?
这是和:}相同的模式
规则=: 记得记住 之前 更新您的 " memory\ @ MS K2} @ I( retrieval 逻辑@)}免费的.}
关键的建筑效益:挥发性 . 因为您在嵌入 {(} 的同时存储确定性信号, 而不是它们),} 系统每个部分都可以独立改变 . swap 嵌入模型_ MS K3\ re\ MOSK4\ 编组而不触动信号@.\ 添加一个新的信号\ ? 从储存的文本中计算它而不重新%-\ embed\ mSSK8\ tune 排名=?\ 调整信号重量和评分逻辑而不重索引<.>
使用多@ - @ vector 仓库\ MS K1 类似 Qdrant @ MSSK2} 您甚至可以添加 每个文件的多个嵌入“. 想要尝试一个新的嵌入模型”“? 添加它与现有的模式并加, 并在生产过程中逐渐过渡 ‘. 测试 ’ ,} 比较质量@, 然后在不重新索引或中断服务的情况下对旧的“ @- ” 进行拆分 。
每个组成部分都可以演进,而不会迫使一个完整的管道重建 -,并且不贬低其他部分。
存储任何你能计算到的东西 廉价和决定性地.
重要的: 信号只是 短文本字符串@, @ number @ ,}和布林值@ — @ 不是巨型数据结构@ . @ 您K2# 正在存储 @ I" @ performance @ MPK4 @ @ @ MCK5 @ chars @ MASK6}不是 @"_ Customer 抱怨着缓慢的装载时间@..." @ @ *(50+# words{
public class DocumentSignals
{
// Always extract (almost free)
public int CharCount { get; set; } // Example: 1247
public int WordCount { get; set; } // Example: 203
public int ParagraphCount { get; set; } // Example: 5
public string[] UniqueWords { get; set; } // Example: ["timeout", "error", "api"]
// Structural (parse once)
public bool HasCodeBlocks { get; set; } // true/false
public bool HasLinks { get; set; } // true/false
public int HeadingCount { get; set; } // Example: 3
// Heuristic (simple patterns)
public string[] MentionedProducts { get; set; } // Example: ["WebApp", "API"]
public string[] ErrorCodes { get; set; } // Example: ["ERR-404", "ERR-500"]
public Dictionary<string, int> SentimentWords { get; set; } // { "positive": 3, "negative": 7 }
// Metadata (already available)
public DateTime Created { get; set; } // Example: 2025-01-15T14:23:00
public string Author { get; set; } // Example: "[email protected]"
public string Category { get; set; } // Example: "Performance" (not essay-length)
// Computed (cheap math)
public double ReadingTimeMinutes { get; set; } // Example: 4.2
public double KeywordDensity { get; set; } // Example: 0.034
}
储存成本比较
| }您在文档中存储的 { | } 大小@ | } @10k 文档 *% | } |
|---|---|---|---|
| 全文全文 | ~5 KB | MM □ | |
| 所有这些信号 @ | ~500 bytes _ | @#5 MB | |
| LLM-生成摘要 | ~2 KB | MM □ |
信号是 10#x 小一点 文本+, 4#x 小一点 超过 LLM 摘要@,和 价格无限便宜 重新計算(}因為您需要 LLMMS K2}(% 1) 。
当你意识到你需要不同的信号时 : 仅从存储的原始数据中计算 . 储量是廉价; LLM 推论是昂贵\ .
这就是为什么 @"_Over@-}%expracteraction}"}你曾经在储藏室支付过一次 (Neggleppilable{),}没有反复的推论
大部分的"RAG查询"}其实只是些有限制的搜索查询
传统RAG -=YTET -伊甸园字幕组=- 翻译:
// ❌ Paste everything into prompt and hope
var chunks = await vectorSearch.SearchAsync(query, k: 50); // 50 chunks!
var prompt = $@"
Given these 50 chunks of text, answer the question but ONLY use
docs from last week and ONLY for UK customers.
Chunks: {string.Join("\n", chunks)}
Question: {userQuestion}
";
var answer = await llm.GenerateAsync(prompt); // Expensive + unreliable
减少的RAG -=YTET -伊甸园字幕组=- 翻译:
// ✅ Filter first, retrieve less, synthesize last
var candidates = await db.Tickets
.Where(t => t.CreatedDate > DateTime.Now.AddDays(-7)) // ← Database does this
.Where(t => t.Region == "UK") // ← Not the LLM!
.ToListAsync();
// Hybrid search on the filtered set
// (In production: push BM25 to database/index, not in-memory LINQ)
var bm25Results = candidates.Where(c => c.Text.Contains(keyword));
var vectorResults = await vectorSearch.SearchAsync(query, k: 5, filter: candidates);
// Small evidence pack
var evidence = RRF.Merge(bm25Results, vectorResults).Take(5);
// LLM only synthesizes
var answer = await llm.GenerateAsync($@"
Synthesize an answer using ONLY these 5 sources:
{FormatEvidence(evidence)}
Question: {userQuestion}
");
刚刚发生了什么?
这就是为什么生产中的混合搜索问题吗? “. ” 如果你已经建造了“' ” 它,但是还没有建成“MS K2 ” 介质搜尋@& @ auto @ - @ Indexing 是整个RAG系列中最实用的片段 .
如果查询真的乱七八糟 @,_您 能够 使用一个小模型来提取意图@/过滤器 @("\ñacompare vs 解释对麻烦射击的错误=%"):}
// Use small model to propose filters (ephemeral - discarded after use)
var intent = await smallModel.ExtractIntent(userQuestion);
// Returns: { intent: "troubleshoot", filters: { priority: "high", product: "api" } }
// Validate the proposal against known fields (deterministic)
var validatedFilters = ValidateAgainstSchema(intent.filters);
// Use validated filters for retrieval
var results = await db.Tickets.Where(validatedFilters).ToListAsync();
核心原则:LLM提议MS K1确定层验证{.
这是 受限制的模糊 模式@. @%
更深入地潜入时间执行模式,即您临时使用LLMs而不坚持其输出结果=,见。 火和火.
只有在检索后,你才给LLM.打电话。 你才会给出一小串明确的事实,附有证据指示和明确的不确定说明。
模型='}工作_: 合成, @ 解释@ , @ 比较# . @ 不是:# 决定真相 ,发明结构.
如果您在意 @ “ @%LLLMs, 将整个上下文窗口拖到答案@ MS K1 @ 您已经看到过失败模式@.}我直拨了 受限制的模糊环境拖拉{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你要求它做什么?
典型客户支持 RAG 系统磁力比较@:
假想: @10,000 支持票@, @#1,000每日查询
| “ | ” 接近“ | ” 摄取成本 “MS K2” Per-” 出勤成本 | 每日成本 * | * |
|---|---|---|---|---|
| 传统RAG ×大环境 @ | #~每日$75/ | |||
| 减少的RAG ×小环境 @ | #~每日$7.50/ |
音量序列@: @% ~10x每天降低成本
再好不过了 有了良好的证据和确定性的过滤@,}你可能需要一个边境模型 在所有的.}本地的Ollama模式 @()}与小型的证据包常常比GPT=-4}喂饱了%50}它必须自己分析的块子#.}
Plus: 减少调试时间 , 少支持升温 , 和模型灵活性swap 型号,无建筑改变*MS K4
传统RAG (#Hope@-}基于过滤机的过滤器 @):
// ❌ Prompt says "only UK customers" but model can ignore it
var answer = await llm.Generate(prompt); // No guarantee
减少的RAG ( 强制过滤 ):
// ✅ Database physically prevents non-UK results
var results = db.Tickets.Where(t => t.Region == "UK"); // Guaranteed
为什么它会更安全? 在一代人“(”之前强制实施过滤器。 “MSKOQ 模型”从未拥有过这些过滤器@, can @'t forget them_), 并且幻觉被你控制的证据所约束.
传统RAG: @"@BARBAR,}模型上说这个#MSK1Q}但不知道为什么或者哪个块来自~."}
减少RAG:
// You know exactly why each result matched
var result = new SearchResult
{
Text = "Server timeout error",
MatchedBecause = new[]
{
"Region = UK (database filter)",
"Created in last 7 days (date filter)",
"BM25 score: 4.2 (keyword 'timeout')",
"Vector similarity: 0.89 (semantic match)"
},
SourceChunks = [chunk1, chunk2], // ← Audit trail
ConfidenceScore = 0.89
};
您可以检查为什么每个结果匹配@ ,, 当信任度低时会显示证据吗? @ , 和调试生产问题,
如果您已经有一个工作RAG system {,} <在这里>'}_BARBAR_如果您已经有可用的RAG Systems@MSKO}这里*MSK 1}#如何迁移:%
在:之前
public class Document
{
public string Id { get; set; }
public string Text { get; set; } // ← Only unstructured text
public float[] Embedding { get; set; }
}
在:后
public class Document
{
public string Id { get; set; }
public string Text { get; set; } // ← Keep for evidence
public float[] Embedding { get; set; }
// Add deterministic signals (extract once during ingestion)
public DateTime CreatedDate { get; set; } // ← Parse from metadata
public string Category { get; set; } // ← Extract from filename/tags
public string Author { get; set; } // ← From file properties
public string[] Tags { get; set; } // ← Parse from content/metadata
public double QualityScore { get; set; } // ← Compute heuristics
}
在:之前
var prompt = "Only use docs from last month for product 'API'. Query: " + userQuery;
var chunks = await vectorStore.Search(userQuery, k: 50);
var answer = await llm.Generate(prompt + chunks); // ❌ LLM might ignore filters
在:后
// ✅ Database enforces filters
var candidates = await db.Documents
.Where(d => d.CreatedDate > DateTime.Now.AddMonths(-1))
.Where(d => d.Category == "API")
.ToListAsync();
// Search only the filtered candidates
var results = await vectorStore.Search(userQuery, k: 5, filter: candidates.Select(c => c.Id));
var answer = await llm.Generate(FormatEvidence(results)); // Much smaller context
// Combine keyword and semantic search
var keywordResults = await db.Documents
.Where(d => EF.Functions.ToTsVector("english", d.Text)
.Matches(EF.Functions.ToTsQuery("english", keywords)))
.ToListAsync();
var vectorResults = await vectorStore.Search(userQuery, k: 20);
// Merge using Reciprocal Rank Fusion (RRF)
var merged = RRF.Merge(keywordResults, vectorResults, k: 5);
见见 介质搜尋@& @ auto @ - @ Indexing 完全执行@. @%
在“:”之前和之后跟踪这些度量。
public class RAGMetrics
{
public int PromptTokens { get; set; } // Should drop by 80-90%
public int CandidatesRetrieved { get; set; } // Should drop from 50+ to 5-10
public TimeSpan QueryLatency { get; set; } // Should improve
public bool FiltersEnforced { get; set; } // Should be true
public List<string> EvidenceSources { get; set; } // Should be traceable
}
如果您的系统依赖于 ever-}大上下文窗口来保持准确@ ,} 您没有%'}%t 有检索问题 *_您有摄取问题=□.}
| 意图意图 @ | 使RAG可以预测@,便宜#,和可调试的| |
| 部队 “ | ”高代币成本“,”微弱过滤器“MS K2”静默幻觉 @,}未打字的提示@ |
| 解决方案 “ | ” 解压缩信号一旦“→” 强制实施限制, |
| 后果的后果 更前卫的工程 更好的行动行为 |
减少的RAG是't 抗MS K1LLM. ItMSKO3s 抗□-Washage{.
以这种方式想一想
Traditional RAG = "LLM, here's 50 chunks. Figure out what matters and answer."
Reduced RAG = "Database, filter to 100. BM25, find keywords. Vector, find similar.
Now LLM, here are the 5 most relevant sources. Synthesize an answer."
变换时间@: @
原始人 :
模式@: @%
当您对包含语言模型的系统应用正常软件工程纪律时, 它会发生什么? .}
如果你准备好建造这个:
参考实施@:
基础设施已经存在@. 您只需要停止将上下文窗口当成数据库 @.
© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.