← 返回
未分类 中文

Rag Pipelines

Deep RAG workflow—document ingestion, chunking, metadata, retrieval and reranking, grounding and citations, evaluation, and failure modes (hallucination, sta...
深度RAG工作流——文档摄入、分块、元数据、检索与重排序、引用验证、评估及失败模式(幻觉、...
codekungfu codekungfu 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 519
下载
💾 1
安装
1
版本
#latest

概述

RAG Pipelines (Deep Workflow)

RAG quality is dominated by chunking, retrieval, and evaluation—not the LLM alone. Treat the system as data engineering plus generation with explicit failure modes.

When to Offer This Workflow

Trigger conditions:

  • Building Q&A over internal docs, support assistants, or copilots
  • Hallucinations, wrong citations, or stale answers
  • New content types (PDF, HTML, code repositories)

Initial offer:

Use six stages: (1) task & success criteria, (2) ingestion & cleaning, (3) chunking & metadata, (4) retrieval & rerank, (5) generation & grounding, (6) evaluation & monitoring). Confirm embedding model and retrieval stack (vector DB, search engine, hybrid).


Stage 1: Task & Success Criteria

Goal: Define what a “good” answer contains: required citations, length, tone, and when to refuse.

Exit condition: Written rubric with examples of acceptable vs unacceptable answers.


Stage 2: Ingestion & Cleaning

Goal: Deterministic text extraction (strip boilerplate, handle PDF/OCR if needed); deduplicate documents; track source URL and updated_at for staleness.

Practices

  • Version pipelines when parsers change (re-embed job)

Stage 3: Chunking & Metadata

Goal: Tune chunk size and overlap to query patterns—not one global token count for all content.

Practices

  • Attach metadata for ACL filtering (tenant, product area)
  • Prefer structure-aware splits for docs (headings, sections)

Stage 4: Retrieval & Rerank

Goal: Hybrid lexical + dense retrieval often beats vector-only for keyword-heavy queries.

Practices

  • Cross-encoder reranking on top-k for quality (watch latency)
  • Query rewriting for multi-turn contexts

Stage 5: Generation & Grounding

Goal: System prompts that require using only provided context; explicit “not found” behavior; optional citation format (snippet, doc id, link).


Stage 6: Evaluation & Monitoring

Goal: Offline golden questions with expected supporting docs; online thumbs-down reasons; monitor retrieval hit rate, nDCG@k, and age of sources used.


Final Review Checklist

  • [ ] Rubric and refusal behavior defined
  • [ ] Ingestion deterministic; dedupe and versioning
  • [ ] Chunking and metadata match queries and ACLs
  • [ ] Hybrid retrieval and rerank tuned with metrics
  • [ ] Grounding and citation behavior enforced in prompts
  • [ ] Offline eval plus production monitoring

Tips for Effective Guidance

  • Debug retrieval before blaming the LLM.
  • Long chunks hurt precision; short chunks hurt context—sweep experiments.
  • See also vector-databases and llm-evaluation skills for depth.

Handling Deviations

  • Code RAG: symbol- or AST-aware chunking often beats line-based splits.
  • High-stakes domains: add human review gates and audit logs for sources cited.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 07:09 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,478 📥 541,147
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,112 📥 834,258
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,400 📥 323,306