NewRAGSuite Engine: the knowledge engine for your data, run in Germany.About RAGSuite Engine

ProductRAG enginePlatform overviewAI governanceAI chatbotBuild AI assistantsAI searchAI knowledge baseConnectors & integrationsMCP serverTake the product tour →
Engine & self-hostedRAGSuite EngineSelf-hosted / on-premiseOpen source (Community)RAGSuite Engine or self-hosted? →
SolutionsSMEsHealthcarePublic sectorBanking & insuranceChatGPT alternativeAgencies & partnersAll solutions →
Case studies
Pricing
ResourcesGuidesBlogFree toolsAI data protectionEU AI ActTrust Center
Open source on GitHub
Start free trialBook a demo
Guide · RAG

RAG pipeline: how documents become an answer with a source.

A RAG pipeline makes a language model answer from your documents instead of from memory. This guide explains the RAG architecture block by block: chunking, embeddings, vector database, hybrid search, reranking and RAG evaluation, with starting values, common mistakes and a checklist.

RAG pipeline · starting values
Chunk size300 to 800 tokens
Overlap10 to 20%
Search candidates20 to 50
Passages to the model5 to 8 after reranking
Test questions50 to 100 real questions
Answeralways with a source
Starting values, test on your dataAs of 5 Nov 2026

Key points

  • A RAG pipeline has two parts: indexing (read documents in, split into chunks, embed, store) and querying (search, rerank, generate an answer with a source).
  • Most quality problems happen before the language model: poorly prepared documents, unsuitable chunking or a search that misses the right passage.
  • Hybrid search and reranking usually improve hits noticeably, especially for technical terms, numbers and names.
  • Without RAG evaluation on a fixed set of test questions, you cannot tell whether a change helps. Measure retrieval and answers separately.
Basics

What is a RAG pipeline?

RAG stands for retrieval-augmented generation: before every answer, the system finds the right passages in your documents and passes them to the language model. The RAG pipeline is the technical chain that makes this work.

The first part runs in the background: documents are read in, split into sections and stored as vectors. The second part runs with every question: search, choose the best hits, generate an answer with a source.

RAG system →

RAG pipelineIndexing and querying
1 · Indexing (once, again on changes)
SourcesChunksEmbeddingsIndex
2 · Querying (every question)
QuestionSearchRerankingAnswer
Answer with a source to check
RAG architecture

RAG architecture: eight building blocks at a glance.

Every block has settings that matter. The table shows what counts and which mistake is most common at each step.

BlockJobWhat mattersMost common mistake
1 Connect sourcesFetch documents from drives, wikis, websitesCarry permissions over, sync changesStale copies in the index
2 PrepareExtract text from PDF, Word and HTMLHandle tables, headings and headers cleanlyFooters and menus in the text
3 ChunkingSplit text into searchable sectionsSize, overlap, splitting at headingsSections cut off mid-sentence
4 EmbeddingTurn sections into vectorsA multilingual model for German textsSwitching models without reindexing
5 IndexStore vectors and search them fastMetadata such as source, date, rightsNo source stored with the chunk
6 RetrievalFind passages matching the questionTop-K, threshold, hybrid searchToo few or too many hits
7 RerankingScore hits more precisely and reorderNumber of candidates and latencyBest hit ends up in ninth place
8 GenerationWrite the answer from the passages, with a sourcePrompt, context window, allow “I don’t know”Answer without evidence

RAG Engine →Context window calculator →

RAG chunking

RAG chunking: splitting documents the right way.

Chunking decides what the search can find at all. A chunk should hold one statement that makes sense on its own. Too small and the context is missing; too large and the search gets diluted and the context window fills up.

StrategyHow it worksGood for
Fixed size with overlapCut every 300 to 800 tokens, overlap 10 to 20%Getting started, uniform texts
By structureCut at headings, paragraphs or sectionsManuals, policies, contracts
SemanticCut where the topic changesLong, loosely structured texts
With context headerPut the document title and heading in front of every chunkMany similar documents

Chunking playground →Embedding cost calculator →

Retrieval

Hybrid search and reranking: finding the right passages.

Vector search finds passages by meaning, even when different words are used. It is weaker on exact terms such as part numbers, sections, product names or abbreviations. Hybrid search therefore combines it with classic keyword search and merges both result lists.

Reranking comes next: a second, more precise model scores the first 20 to 50 hits against the question and reorders them. Only the best five to eight passages go to the language model. In RAGSuite you turn this on with “Use Reranker” in the model settings.

Model Settings · searchRAGSuite
Models
Chat model<your model>
Embedding model<your embedding model>
Retrieval
Top K Results8
Similarity Threshold0.30
Max Tokens1,024
Use Reranker
Answers with sources · new embedding model → Reindex now
Vector database

Choosing a vector database for RAG (self-hosted).

The vector database is block 5 of the pipeline: it stores the vector, the text and metadata such as source and date for every chunk, and finds the most similar sections for a question. If you host RAG yourself, choose it by operations, permissions and deletion behaviour, not by a benchmark ranking.

The criteria are vendor-neutral. Which option fits depends on data volume, team and infrastructure.

CriterionWhat to look forQuestion to settle first
DeploymentEmbedded, the database runs as a library inside the application process: little to operate, good for a single server. As a separate server, several applications share one index and scale independently, but there is one more service to run and monitor.How many applications and servers use the index?
Persistence and backupThe index must survive restarts and be backed up. It can always be rebuilt from the sources, but with large collections that costs time and compute for the embeddings.Are there snapshots, and have you tested a restore?
Filtering by metadata and permissionsThe search should be able to filter by source, project, date or permission within the query itself. Filtering a short hit list afterwards often leaves too few relevant passages.Can tenants, projects or areas be kept cleanly apart?
Hybrid searchFor part numbers, sections and names you need keyword search alongside vector search. Some databases include both; otherwise you run a second index and merge the result lists.Is keyword search built in or run separately?
Data volume and memoryAs a rough guide, 1 million chunks with 1,024 dimensions stored as 32-bit floats take about 4.1 billion bytes (3.8 GiB) of raw vector data, plus index structures, text and metadata. Many common index types keep this data in memory for fast search.How many chunks do you expect in two years?
LicenceCheck whether the licence allows self-hosting, modification and redistribution (for example Apache 2.0, MIT or the PostgreSQL licence) and whether key features are reserved for a commercial edition. Source-available licences often restrict running the software as a service for others.Does the licence fit your use, including serving customers?
Deletion behaviourMany vector indexes first only mark deleted entries as deleted (tombstones) and remove them physically during compaction. Snapshots and backups also keep deleted data until they expire. For erasure duties under Art. 17 GDPR, what counts is when the data is really gone.When is data physically removed, and how long do backups live?

Own illustration. Open-source examples of the deployment models, without ranking: ChromaDB (embedded or as a server) and pgvector (vector search as an extension of an existing PostgreSQL database). Memory maths: 1,000,000 × 1,024 × 4 bytes = 4,096,000,000 bytes. RAGSuite ships its own search index: ChromaDB, plus PostgreSQL for users, settings and history.

Run a local LLM →Community Edition architecture →

RAG evaluation

RAG evaluation: measure quality instead of guessing.

Every change to chunking, model or search can help or hurt. Without measuring, you only notice when users complain. So set up a fixed set of 50 to 100 real questions early, each with the expected source, and check the same metrics after every change.

LevelMetricThe question behind it
RetrievalHit rate (recall@k)Is the right passage among the top k hits?
RetrievalMean reciprocal rank (MRR)How high up is the right passage?
AnswerFaithfulnessIs everything in the answer also in the sources?
AnswerRelevanceDoes it answer the question asked?
AnswerCitation accuracyDoes the citation point to the right passage?
OperationFeedback, latency, costAre users happy, and does it stay fast and affordable?

In RAGSuite, every edition collects user feedback on answers. Detailed query tracing with timings for retrieval, reranking and model, plus Compare Models, are part of Enterprise.

Quality Loop →AI hallucinations →

Building a RAG system

Building a RAG system: develop it yourself or use a platform?

A prototype with a library and a few PDFs is quick to build. The effort is in operation: keeping sources in sync, respecting permissions, reindexing, providing an interface and monitoring quality.

TaskDevelop yourselfWith RAGSuite
Connect sourcesA separate integration per sourceUpload, website crawl, SharePoint, Confluence, Google Drive, Notion, Slack, Gmail
ModelsIntegrate and maintain yourselfChoose the provider, including local with Ollama; switch embeddings with “Reindex now”
SearchBuild index, parameters and reranker yourselfVector index, Top-K, threshold, reranker by switch
InterfaceDevelop yourselfChat, search, website widget, mobile app, REST API
Sources in answersImplement yourselfEvery answer with a source
CostDeveloper time and operationCommunity Edition free, RAGSuite Engine from €39 a month (billed yearly, plus VAT)

For developers →Open-source AI for business →Pricing →

Checklist

Before your RAG pipeline goes live.

Tick what is done. Nothing is stored.

Jürgen Pietschmann
Building a RAG pipeline?Jürgen Pietschmann · AI Consultant · RAGSuite Lead
FAQ

Questions about the RAG pipeline.

What is a RAG pipeline?

A RAG pipeline is the chain of steps that makes documents searchable and passes the right passages to a language model for each question. It has two parts: indexing (read in, split, embed, store) and querying (search, rank, answer with a source).

What chunk size is right?

A good starting point is 300 to 800 tokens per chunk with 10 to 20% overlap, ideally split along headings. Smaller chunks hit more precisely; larger ones carry more context. Test with your own documents and questions.

Which vector database suits RAG?

There is no single best one. For a self-hosted RAG pipeline, what counts is the deployment model (embedded or a separate server), backup, filtering by metadata and permissions, hybrid search, the expected data volume, the licence and when deleted entries are really removed. For a single server, an embedded option is often enough; several applications and large data volumes point more towards a separate service.

What is hybrid search?

Hybrid search combines classic keyword search with vector search by meaning and merges the two result lists. It helps especially with part numbers, names, abbreviations and technical terms that pure vector search can miss.

What does reranking do?

A reranker scores the first 20 to 50 search hits again, more precisely, against the question and reorders them. Only the best five to eight passages then go to the language model. That improves accuracy but adds some time per request.

How do you measure the quality of a RAG pipeline?

With a fixed set of 50 to 100 real questions and expected sources. You measure retrieval (is the right passage found?) and the answer (is it grounded in the source, does it answer the question, is the citation correct?). Add user feedback and response time.

Should I build a RAG pipeline myself?

A prototype can be done in a few days. For production you add connectors, permissions, reindexing, an interface, logs and updates. A ready platform such as the free RAGSuite Community Edition saves most of that work.

Do I need to reindex after changing models?

For the embedding model, yes: vectors from different models are not comparable, so all documents have to be embedded again. For the chat model, no; you can switch it without reindexing.

Sanjay Chauhan
Sanjay Chauhan
CTO

The RAG pipeline, ready built. With a source for every answer.

Install the Community Edition for free, or let Sanjay show you how RAGSuite makes your documents searchable.