Ingesting RAG Content
Automated process for indexing new documents into the factory's Qdrant vector store using standardized Parent-Child retrieval patterns.
Prerequisites
- Python 3.10+ environment with
cursor-factoryenv active. - Access to
D:/ebooksor target document path. antigravity-ragMCP server active (configured in%USERPROFILE%\.gemini\antigravity\mcp_config.json).
When to Use
- When new reference materials (PDF) are added to the project.
- When an agent discovers new domain knowledge that needs to be persistent.
Process
- Identify source: Locate the PDF to be ingested.
- Call tool: Use
@tool mcp_antigravity-rag_ingest_documentwith the absolute path. - Monitor logs: Ensure the Parent-Child splitting (chunking) completes successfully.
- Verify: Call
list_library_sourcesto confirm registration.
Level 3 Resources
Scripts
scripts/validate_ingestion.py: Runs a health check on the Qdrantebook_librarycollection.scripts/ai/rag/rag_optimized.py: The core ingestion engine logic.
References
references/rag-architecture.md: Explains the Parent-Child chunking strategy and Qdrant storage schema.
Important Rules
- PDF Only: In the current optimized version, only PDF documents are supported for Parent-Child splitting.
- UTF-8 Only: Ensure environment variables (
$env:PYTHONIOENCODING="utf-8") are set. - Incremental indexing: The system supports adding to existing Qdrant collections.
- Local Embeddings: Uses
BAAI/bge-small-en-v1.5(via FastEmbed) for performance.
Best Practices
- Recursive Splitting: Always use recursive character splitting to maintain paragraph integrity.
- Absolute Paths: Store absolute paths in metadata to ensure reliable document opening.
- Validation: Run
scripts/validate_ingestion.pyafter bulk ingestion.
---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/gitwalter) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->