RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Large language models / Retrieval-Augmented Generation (RAG)
Large language models

Retrieval-Augmented Generation (RAG)

RAG is the pattern of retrieving relevant documents from a knowledge base and including them in the LLM's prompt so the model can ground its answer in those documents. The simplest RAG: embed your docs, embed the user's query, find the top-k nearest doc chunks by cosine similarity, prepend them to the prompt.

RAG addresses three problems: knowledge cutoff (new info the model wasn't trained on), private data (docs you can't retrain on), and hallucination (model making things up). It does NOT make the model more capable — a 7B model with RAG is still a 7B model on the reasoning side.

Key design decisions: chunk size (256-1024 tokens typically), embedding model (BGE, E5, or text-embedding-3 from OpenAI), vector store (Postgres pgvector, Qdrant, Weaviate, ChromaDB), retrieval quantity (top-3 to top-20). For local-only RAG, llama.cpp + a small embedding model + SQLite-based vector store gets you started in under 100 lines of code.

Related terms

Embedding (Vector Embedding)Vector DatabaseSemantic Search
Buyer guides
  • Best GPU for local AI →
  • Best laptop for local AI →
  • Best Mac for local AI →
When it doesn't work
  • CUDA out of memory →
  • Ollama running slowly →
  • ROCm not detected →