by.waclaw.online / spark / rag / 01

What a Private RAG Should Look Like Here

The lead article: the component map, measured numbers on this hardware, when retrieval is the wrong answer, and whether to assemble a stack or deploy a finished one.

Series 4, article 1 of 4 · written 31 July 2026

Retrieval-augmented generation has a simple premise and a great deal of accumulated folklore. The premise: a language model cannot know what is in your files, so find the relevant passages first and put them in the prompt. Everything else is engineering — and most of the quality comes from parts of that engineering people find boring.

This series is opinionated about where the effort goes, because on this hardware the model is rarely the bottleneck. It is nearly always ingestion or retrieval.

The components

  documents ──▶ [ parse ] ──▶ [ chunk ] ──▶ [ embed ] ──▶ ┌──────────┐
   pdf/docx      Docling       heading-      bge-m3       │  vector  │
   xlsx/pptx     + OCR         aware                      │  store   │
   md notes                                               └────┬─────┘
                                                               │
  question ──▶ [ embed ] ──▶ [ hybrid search ] ──▶ [ rerank ] ─┘
                              dense + sparse       cross-encoder
                                    │
                                    ▼
                        [ prompt with sources ] ──▶ LLM ──▶ answer + citations

Six stages, and their contribution to final quality is roughly the inverse of the attention they usually get:

StageEffect on answer qualityUsual effort spent
ParsingEnormous. A table mangled into prose cannot be retrieved correctly by anything downstream.Minimal
ChunkingLarge. Chunks that split an idea in half retrieve half an idea.Minimal
Embedding modelModerate, and language-dependentLarge — this is where the arguing happens
Hybrid searchModerate; matters most for names, codes and rare termsSmall
RerankingLarge, for very little workOften skipped entirely
Generation modelSmaller than you would think, above a certain sizeLarge

If you take one thing from this article: fix parsing and add a reranker before you upgrade the model. A 30B model with good retrieval beats a 120B model with poor retrieval, and it runs three times faster.

The numbers on this exact hardware

A documented GB10 RAG deployment — vLLM serving a 26B mixture-of-experts model with an fp8 KV cache at 65K context, bge-m3 embeddings, a bge-reranker-v2-m3 cross-encoder, Docling for parsing — reports:

MetricMeasured
Time to first token183 ms
Single-stream generation23–24 tok/s
Three concurrent requests~50 tok/s aggregate
Maximum concurrency at 65K context45 parallel requests
Memory footprint~95 GiB (48.5 GiB weights + 41.7 GiB KV cache)
Docling parsing a 5-page PDF (warm)6.04 s

Read the last two rows together with the memory budget. The generation model and its cache take about 95 GiB of a roughly 120 GiB usable pool. The embedding model and reranker are 1–2 GB each. It fits — with less headroom than you might have assumed, which is why the context length and the KV cache dtype are the settings to adjust first if you run short.

This is the one workload that breaks one-model-at-a-time, and it is fine. Three models resident is unavoidable for RAG: generation, embedding, reranking. But the two small ones together are under 4 GB. The discipline that still matters is not running RAG and a video model — those genuinely conflict, and article 4 covers switching cleanly between them.

When you should not build this

Retrieval is not free — in setup, in maintenance, or in failure modes. There are cases where the simpler thing is better, and it is worth being honest about them before spending a weekend:

RAG earns its keep on a large, messy, heterogeneous corpus where you do not know in advance which document holds the answer. That is exactly the case you described — mixed PDFs and Office files plus years of personal notes — so this series proceeds.

The multilingual problem

Two languages in one corpus, with Polish among them, breaks several defaults quietly.

Embedding models are not equally good in every language. An English-first model will embed Polish text, produce plausible vectors, and retrieve worse than you expect — with no error to alert you. The models to consider are the explicitly multilingual ones: bge-m3, MIT-licensed, covering 100+ languages and producing dense, sparse and multi-vector representations from a single pass, and the Qwen3-Embedding family, which leads multilingual retrieval benchmarks in its larger sizes. This series uses bge-m3 as the default because getting dense and sparse retrieval from one model simplifies the hybrid step considerably.

Keyword search assumes English morphology. Polish is heavily inflected: umowa, umowy, umowie, umową, umów are one word. A BM25 index with English stemming treats them as five, so a query using one form misses documents using another. This is why the sparse side of a hybrid system needs language-aware handling, covered in article 3.

Cross-language retrieval needs to be a decision. Should a Polish question surface relevant English documents? Multilingual embeddings make this possible — it is one of their main attractions — but it needs to be intentional, and it needs to be tested, because it also makes spurious cross-language matches possible.

For evaluating Polish retrieval seriously, PL-MTEB is the benchmark that exists — 30 Polish-language tasks across classification, clustering, pair classification, retrieval and semantic similarity, with published results for a wide set of Polish and multilingual models. It is a far better basis for choosing an embedding model for a Polish corpus than an English leaderboard.

Assemble, or deploy something finished?

Three routes, and the right one depends on what you want to spend your time on.

RouteWhat it isChoose it when
Assemble Docling + your chunker + bge-m3 + Qdrant + a reranker + your own answering service, wired by hand You want to understand and control every stage, and to tune for Polish specifically. This is what the series builds.
A finished RAG engine RAGFlow — a complete system with a web UI, deep document parsing, multilingual OCR and knowledge-base management, no code required. There is a GB10-specific build. You want it working today and are content with its opinions about chunking and retrieval.
A packaged GB10 stack A one-command private RAG deployment built exclusively for this hardware: vLLM, bge-m3 embeddings, bge-reranker-v2-m3, Docling, Weaviate or Qdrant, RAGFlow, Dify as orchestrator, Open WebUI, MinIO, Postgres, Redis — an interactive wizard and about 25 minutes. You want the whole thing, correctly configured for unified memory, without making twenty decisions first.

There is a fourth option worth knowing about for the notes half of your corpus specifically. Graph-based approaches such as LightRAG extract entities and relationships during indexing and retrieve over the resulting graph rather than over isolated chunks. For a personal knowledge base — where the value is often in connections between notes rather than in any single note — this answers questions that vector search structurally cannot, such as "how does this project relate to that one." It is more expensive to index and it is a genuine addition rather than a replacement. Run it alongside vector retrieval over the same corpus rather than choosing between them.

A pragmatic suggestion. Deploy a finished stack first, even if you intend to build your own. A day with a working system over your real documents will teach you more about what your corpus actually needs — which files parse badly, which questions fail, whether Polish retrieval is holding up — than a week of reading about chunking strategies. Then build the version you actually want, informed.

What the rest of the series does

Article 2 handles ingestion: parsing documents that resist parsing, chunking that respects structure, and the metadata that makes citations possible. Article 3 builds hybrid retrieval and reranking, with the Polish-specific adjustments. Article 4 puts an API and a UI in front of it, and — the part most guides omit — an evaluation harness, so that when you change something you can tell whether it helped.

Sources