| title | Knowledge Base 4-Sigma Quality Audit Pipeline | |||
|---|---|---|---|---|
| domain | rag | |||
| source | bootstrap | |||
| status | published | |||
| tags |
|
|||
| language | en | |||
| created | 2026-05-03 | |||
| domain_expert | bootstrap | |||
| verified_date | 2026-05-03 | |||
| subdomain | quality |
After continuous document imports, the RAG knowledge base developed data contamination, version confusion, inconsistent sources, and other issues that affected retrieval quality.
- Multiple versions of the same document were imported repeatedly, with old versions not removed
- OCR imports introduced garbled data
- The same knowledge point appeared in multiple documents with different wording
- There was no systematic quality-check workflow
Build a 4σ quality audit pipeline:
- Contamination cleanup: delete non-document content (garbled text, empty chunks, numeric-only chunks)
- Version deduplication: identify duplicates by filename + import time
- Source correction: standardize document paths, filenames, and source URLs
- Quality scoring: score by completeness, cleanliness, and version consistency
Implement it as daily_audit.py, run automatically by cron every day at 06:00.
Reports are stored at ~/audit_reports/audit_YYYY-MM-DD.json.
Audit reports showed no new contamination for 7 consecutive days, and the knowledge-base score stayed above 95%.
# Expected result: retrieval logs show the intended chunks and no stale cache or fallback errors.
python3 search_knowledge.py "rag verification smoke test" --lessonsEnvironment: Linux / WSL with Python 3.10 or newer; adapt the query to the affected RAG corpus.
A continuously growing RAG knowledge base (>150 documents, >200K vectors) that needs automated quality assurance.