Uploading every quoted reply would create redundant chunks and conflicting retrieval candidates. Deduplication improves the knowledge substrate while source mapping keeps the transformation auditable.把每次引用回复都上传会制造重复切片和相互冲突的检索候选。去重改善知识底座,来源映射则让转换过程保持可审计。
2025 · RAG PIPELINE
Email
Processing
Archive-to-RAG Knowledge System从邮件档案到 RAG 知识系统
I built an operator-facing pipeline that converts overlapping .eml archives into deduplicated Markdown, uses an LLM to extract business facts, and publishes the result into a conversational knowledge base.我构建了一套面向运营人员的处理管线:把高度重复的 .eml 邮件档案转为去重 Markdown,再由 LLM 提取业务事实,最终发布到可对话知识库。
- Solution design · Product workflow · AI-assisted full-stack delivery方案设计 · 产品流程 · AI 辅助全栈交付
- Next.js · TypeScript · Python · Flask
- GPTBots LLM · Knowledge Base API
System flow系统流程
Turn email history into internal knowledge.把邮件历史转成企业内部可用知识。
Code removes repetition first. The model extracts facts only after the archive is reliable.先由代码去除重复;档案可靠后,模型才提取业务事实。
Reference batch参考批次
Remove repetition without losing provenance.减少重复,但不丢失来源关系。
The implementation notes record a seed archive in which newer messages contained most of the earlier thread. The cleaner retained the useful records and attached covered source filenames to their parent document.实施记录中的种子档案存在大量“新邮件包含旧线程”的情况。清洗器保留有效记录,并在主文档中记录被覆盖的源文件名。
Architecture boundary架构边界
Use code for certainty. Use the model for judgment.确定性交给代码,语义判断交给模型。
Parsing an email header, detecting repeated content, and tracking whether a file has already entered the knowledge base should not depend on a model. Python handles those rules. The LLM enters only after the archive is reduced, where it extracts products, quotations, project status, dates, decisions, and action items into a consistent schema.解析邮件头、检测重复内容、判断文件是否已进入知识库,都不应依赖模型,因此由 Python 处理。只有在档案完成去重后,LLM 才负责提取产品、报价、项目状态、日期、决策和行动项,并输出统一结构。