From zero to a RAG system: successes and failures
TL;DR Highlight
Filtering files, batching, and ChromaDB turned 451GB of documents into a working local RAG
Who Should Read
Backend developers who must make hundreds of GB of internal documents searchable with a local-LLM RAG
Core Mechanics
- Filter out useless files first
- Videos, images, executables, archives, simulation files, and backups were excluded by extension and name pattern.
- CSVs and JSONs were dropped too, since they were costly to process and added little value.
- The number of files to index fell 54% and RAM stopped blowing up.
- LlamaIndex's default storage hit a wall
- The default JSON storage became unmanageable at hundreds of GB.
- Every service restart reprocessed all documents from scratch, which could take days.
- A hand-built checkpoint system corrupted data and was slow.
- Switching to ChromaDB fixed it
- Files were embedded in batches of 150 and stored straight into ChromaDB (SQLite-backed).
- 451GB was indexed over multiple sessions with no lost progress on interruptions and no corrupted data.
- Backup was just copying the SQLite file.
- Indexing was impractical without a GPU
- Processing 500MB on CPU on an integrated-graphics laptop took 4-5 hours.
- After renting an NVIDIA RTX 4000 SFF Ada with 20GB VRAM, indexing finished in 2-3 weeks.
- The result was 738,470 vectors and a 54GB index, with Hetzner rental costing 184 euros.
- Original documents are served from Azure Blob Storage
- The server had only 100GB of disk, so 451GB of originals did not fit.
- For each cited document the system generates a SAS-token download link so users fetch it from the cloud directly.
- The server holds only the 54GB ChromaDB index and the roughly 10GB LLM.
- The final stack is mostly local and open source
- Ollama with llama3.2:3b generates answers and nomic-embed-text creates embeddings.
- LlamaIndex and ChromaDB (HNSW) handle retrieval, with a Flask+Gunicorn API and a Streamlit UI tied together by Docker Compose.
- The author's conclusion is to spend time building the best possible data.
Community Reactions
- Accuracy and chunking are the gaps, per commenters
- One commenter said the post doesn't cover accuracy or how long paragraphs and lists stay coherent when split into chunks.
- Another said the article doesn't touch RAG best practices.
- Data ingestion is the key, from experience
- A commenter who has built many RAGs agreed that data ingestion is the key conclusion.
- They spent a week building an ETL for one 20-page PDF to split it into SQL and a graph database to get 100% accuracy on pricing.
- They argued that converting PDFs to markdown and dumping them into a vector DB is not enough.
- Skipping a re-ranker was called a miss
- One commenter said a re-ranker lets you embed with a small, cheap model.
- Others asked why not plain full-text search and why ChromaDB rather than pgvector.
- Small-scale builders felt worried
- A commenter planning a RAG chatbot over about 50 Confluence docs with Streamlit, text-embedding-3-small, and FAISS asked if that path was still right after reading the post.
- Another commenter pointed out that handling source data changes is a big missing piece.
How to Apply
- Build an extension exclusion list before indexing
- Today, scan your document folder for video, image, archive, backup, and temp file extensions and make an exclusion list.
- Filter files with this list at the very start of the indexing script.
- Log how many files were filtered to see the reduction.
- Add batching, checkpoints, and skip-on-error
- Keep originals in external storage and cite via links
- Make source document links mandatory in the answer template
Try It
# Prompt to paste into Claude or ChatGPT (to design an indexing pipeline based on this article)
I want to index {{total document size}} of internal documents with a local-LLM RAG. Document formats are {{formats such as PDF, DOCX}}.
Write a Python indexing pipeline design with pseudocode that includes these 4 things.
1. A filter that excludes video, image, archive, backup, and temp files by extension and filename pattern
2. A structure that processes {{batch size, e.g. 150}} files at a time and frees memory after each batch
3. A checkpoint that saves the last completed batch and a timestamp, and resumes from there on restart
4. Error handling that logs files that fail to parse and moves on to the next one
Use ChromaDB as the vector store, and make answers include links to the source documents.Terminology
Related Papers
FutureBench: A Renewable Framework for Evaluating Knowledge-Context Conflict in LLMs
Adding 'verify and prioritize the passage' to RAG prompts raised false-passage adoption; a knowledge-priority warning fixed it.
Faster Retrieval for Better, More Efficient RAG
Small neural nets learned query routing, hitting the same recall up to 8x faster in IVF search
Memorilla: Latent Semantic Memory for LLMs
Compressing documents into 16 memory tokens beat full-context accuracy on FactKG.
What the Author Wrote, What the Agent Reads: Silent Cue Loss in Enterprise Document Ingestion
Preserving red text and highlights in docx ingestion lifted marked-requirement F1 from 0.150 to 0.690.
Multimodal Reranking Is a System One Decision
One multiple-choice question to a VLM over 16 candidates reranks them, beating a dedicated 2B reranker.
You could have invented transformers from memory
Viewing linear, MLP and attention layers as memory stores: capacity goes ~64 to ~2,700 to over a million
Pointing AI at archives found a forgotten meteorite, lost rhinos, and more
Embedding search plus a cheap filter model surfaced unrecorded events in 400 years of archives
EmbeddingGemma 2: An open, lightweight multimodal embedding model
One open 740M model embeds text, images, audio and video into a single shared vector space