A reliable RAG application depends on more than choosing an embedding model and a vector database. This checklist covers the full document ingestion pipeline: parsing files, normalizing text, attaching useful metadata, detecting duplicates, handling failures, and reindexing documents when source content changes.
Overview
RAG document ingestion is the process of turning source material into searchable records that an application can retrieve before generating an answer. A typical pipeline looks like this:
Source files or connectors
↓
File validation and text extraction
↓
Cleaning, normalization, and structural parsing
↓
Chunking and metadata enrichment
↓
Duplicate detection and content hashing
↓
Embedding generation
↓
Vector database and document registry
↓
Retrieval, monitoring, updates, and deletion handling
Each stage affects answer quality. Poor parsing can remove headings or table context. Weak metadata can make filtering unreliable. Duplicate records can distort retrieval, while missing deletion logic can expose content that should no longer be available.
Keep the original source, the normalized representation, and the indexed records traceable to one another. A document registry should normally record a stable document identifier, source location, content hash, ingestion status, parser version, chunking configuration, embedding configuration, and timestamps. This makes it possible to explain what was indexed and to rebuild it when a workflow changes.
For production systems, treat ingestion as a repeatable data pipeline rather than a one-time upload script. Store enough intermediate information to diagnose failures without sending the entire source file through every stage again.
Checklist by scenario
When adding a new file type
- Confirm the file type and encoding before parsing.
- Test text extraction on representative files, including empty files, very large files, scanned pages, unusual characters, and documents with tables.
- Decide whether images, diagrams, comments, tracked changes, and hidden sheets are in scope.
- Preserve structural signals such as title, heading, page, section, list, table, and paragraph boundaries where possible.
- Record the parser name and version so a later reindex can reproduce or explain the result.
- Route files that need OCR, manual review, or unsupported parsing to an explicit status rather than silently indexing partial text.
| File type | Handling priorities | Failure cases to test |
|---|---|---|
| Distinguish text PDFs from scanned PDFs; preserve page numbers and headings. | Scans, multi-column layouts, tables, embedded images, password protection. | |
| DOCX | Extract headings, paragraphs, lists, tables, and document properties. | Tracked changes, footnotes, text boxes, malformed files. |
| HTML | Remove navigation and boilerplate while retaining meaningful headings and links. | Dynamic pages, repeated menus, hidden content, inconsistent markup. |
| CSV or spreadsheets | Capture sheet names, column headers, row context, and data types. | Missing headers, merged cells, formulas, multiple unrelated tables. |
| Plain text or Markdown | Preserve headings, code blocks, links, and file paths. | Mixed encodings, very long lines, generated or incomplete files. |
When designing a metadata schema
Use metadata for both traceability and retrieval filters. A practical baseline might include:
{
"document_id": "stable-source-identifier",
"chunk_id": "document-id:chunk-number",
"source_uri": "repository-or-storage-location",
"source_type": "pdf",
"title": "Document title",
"collection": "knowledge-base-name",
"access_scope": "team-or-permission-scope",
"page": 4,
"section": "Installation",
"language": "en",
"content_hash": "hash-of-normalized-document",
"parser_version": "parser-release-or-config-id",
"chunker_version": "chunking-config-id",
"created_at": "source-timestamp",
"updated_at": "source-timestamp",
"ingested_at": "pipeline-timestamp",
"status": "active"
}
Use stable identifiers instead of relying on filenames, which can change. Keep permission metadata close to each indexed record if access filtering is required. Do not place confidential text into metadata fields that are logged or exposed by administrative tools.
When detecting duplicates
- Normalize content before hashing by applying a documented policy for whitespace, line endings, and irrelevant markup.
- Compare an exact content hash to detect identical normalized documents.
- Use source identifiers to catch the same document arriving through multiple connectors.
- Handle near-duplicates separately; a minor revision may require replacement rather than deletion.
- Keep one canonical record when duplicate sources have the same authority, and retain provenance when they do not.
- Do not use a similarity threshold as the only deletion rule. Review false positives before removing content.
When a document fails ingestion
Persist a failure record containing the source identifier, stage, error category, attempt count, timestamp, and a safe diagnostic message. Classify failures as transient, unsupported, malformed, permission-related, or quality-related. Retry transient failures with a bounded policy. Send unsupported or malformed files to a review queue. Avoid retrying indefinitely: repeated failures should become visible operational work.
A failed document should not appear to be successfully indexed. Use explicit states such as discovered, extracted, chunked, indexed, failed, and deleted. If only some chunks succeed, define whether the document is unavailable until all required chunks are indexed or whether partial indexing is acceptable.
What to double-check
- Chunk boundaries: Keep headings with the content they describe. Avoid splitting definitions, procedures, or table rows in ways that remove necessary context.
- Chunk identity: Generate deterministic chunk IDs where possible. This makes replacement and deletion safer than inserting a new set of anonymous vectors.
- Embedding consistency: Do not mix vectors produced with incompatible embedding configurations in one logical index without a deliberate migration plan.
- Access control: Apply authorization checks during retrieval, not only during ingestion. Indexed content should inherit the intended source permissions.
- Deletion behavior: Define how a removed source file is identified and how its chunks are removed or marked inactive in the vector store and registry.
- Observability: Track counts discovered, parsed, skipped, failed, embedded, indexed, updated, and deleted. These measures help distinguish a retrieval problem from an ingestion problem.
- Quality samples: Inspect extracted text and retrieved chunks from each source type. Automated completion status does not prove that the content is useful.
- Privacy: Determine whether sensitive data must be redacted, excluded, encrypted, or kept in a local processing path before it reaches parsing or embedding services. See the PII redaction workflow for a related review.
Keep ingestion configuration versioned. Parser changes, chunking changes, metadata changes, and embedding changes can all alter retrieval behavior. Pair significant changes with a small evaluation set, following the principles in the production LLM evaluation dataset guide.
Common mistakes
- Indexing raw files without validation. A successful upload does not mean the parser extracted usable text.
- Using filenames as document IDs. Renames and duplicate folders can create stale or repeated records.
- Discarding provenance after chunking. Without page, section, or source references, citations and debugging become difficult.
- Appending every refresh. Scheduled ingestion should compare hashes and source timestamps before creating new vectors.
- Deleting only from the source repository. Vector stores usually require an explicit deletion or deactivation operation.
- Retrying all errors identically. A permission error and a temporary network failure need different handling.
- Changing chunking silently. A new chunking strategy can change retrieval results even when the source documents have not changed.
- Treating metadata as decoration. Collection, access scope, language, date, and document status can be essential retrieval controls.
When to revisit
Revisit this RAG ingestion checklist whenever a source system, parser, embedding configuration, vector database, permission model, or chunking strategy changes. It is also useful before seasonal planning cycles or scheduled knowledge-base refreshes, when old documents may be replaced and new collections may be added.
Use this short reindexing runbook:
- Freeze or version the current ingestion configuration.
- Inventory active, changed, missing, and newly discovered source documents.
- Compare normalized content hashes and source timestamps.
- Reprocess changed documents using a new batch or index namespace when a broad migration is needed.
- Validate extraction, metadata, permissions, duplicate rates, and representative retrieval results.
- Switch reads to the validated index or update records in place according to the migration plan.
- Remove or deactivate chunks belonging to deleted documents.
- Review failed records and confirm that monitoring, rollback, and audit information remain available.
For related operational work, compare this process with the LLM observability checklist and the AI API provider migration checklist. A dependable RAG application is maintained through small, traceable changes—not by rebuilding the entire knowledge base blindly.