Choosing an Embedding Model and Vector Store for a Local RAG System


Retrieval-augmented generation (RAG) lets a local language model answer questions using your own documents. Most attention goes to the chat model, but retrieval quality usually decides whether a RAG system feels useful. Two components drive retrieval: the embedding model and the vector store. This guide explains how to choose both for a local setup.

What the embedding model does

An embedding model turns a passage of text into a vector, a list of numbers that captures its meaning. At question time, the question is embedded the same way, and the system finds passages with the most similar vectors. If embeddings are poor, the right passage is never retrieved, and no chat model can fix that.

Choosing an embedding model

Popular local options include the BGE family and nomic-embed-text, both of which can be served through common runtimes including Ollama.

Chunking matters as much as the model

Split documents along natural boundaries such as headings and paragraphs, with a modest overlap. Very small chunks lose context; very large chunks dilute similarity. Keep metadata such as file name, section and date for citations and filtering.

Choosing a vector store

Evaluate with real questions

Collect twenty to fifty real questions with known answers. For each configuration, check whether the correct passage appears in the top results. Improve retrieval first, then tune the chat model and prompt.

Keep it private

All of these components run locally. Store indexes on encrypted disks and apply access control at retrieval time if several users share the system.

References

Published by MicroAI One (本地AI 1号网), a Shenzhen team working on local LLM hardware, software and deployment.