A free RAG stack: what to build document search from
Updated 23 October 2026
RAG (retrieval-augmented generation) is a way to make an AI model answer from your documents: first find the relevant fragments, then give them to the model together with the question. Every part of such a system can be built on free tiers.
What RAG consists of
- Document parsing — turn PDFs and scans into text.
- Embeddings — turn text fragments into vectors.
- Vector database — store the vectors and search for similar ones.
- Rerank — re-sort the results by relevance.
- LLM — writes the answer based on the fragments found.
Free services for each step
| Step | Options | Limit |
|---|---|---|
| Document parsing | OCR.space, Zerodoc, Unstructured | 25,000 requests / 200 pages a month / 10,000 pages once |
| Embeddings | Pinecone, Weaviate Cloud, Qdrant Cloud | 5 million tokens a month / 2,000 a day / built-in models |
| Vector database | Qdrant Cloud, Upstash Vector, Pinecone | 1 GB / 10,000 operations a day |
| Rerank | Pinecone, NeuralDeep | 500 requests a month / no published quota |
| LLM | Groq, Google Gemini, Mistral | see the cards |
Languages other than English
For non-English texts choose multilingual embedding models: for example multilingual-e5 (available in Pinecone and Qdrant), or for Russian the open model USER2, which you can run locally.
If you need web search
Add web search: Tavily and Exa are built for LLMs and return already cleaned text. To load specific pages — Firecrawl.
How to stay within the limits
- Compute embeddings once and store them instead of recomputing them for every request.
- Split documents into fragments of 300–800 tokens — that lowers usage and improves accuracy.
- Give the model the 3–5 best fragments after rerank, not 20 in a row.
- Keep a backup LLM for error 429 — see the guide on OpenAI alternatives.