<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>RAG Pipeline on GENIE.AI</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/</link><description>Recent content in RAG Pipeline on GENIE.AI</description><generator>Hugo</generator><language>en</language><atom:link href="https://genie-ai-7e342b.opensource.unicc.org/docs/rag/index.xml" rel="self" type="application/rss+xml"/><item><title>Pipeline Architecture</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/pipeline/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/pipeline/</guid><description>&lt;p&gt;The RAG pipeline is orchestrated by the &lt;strong&gt;ChatQnA&lt;/strong&gt; mega-service
(&lt;code&gt;genie-ai-overlay/chatqna/&lt;/code&gt;), a Python/FastAPI service built on the OPEA
mega-service framework. It wires together five specialist microservices into a
directed acyclic graph (DAG) and streams the final answer back to the client.&lt;/p&gt;
&lt;h2 id="service-roles"&gt;Service roles&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Stage&lt;/th&gt;
 &lt;th&gt;Service&lt;/th&gt;
 &lt;th&gt;Stack&lt;/th&gt;
 &lt;th&gt;Role&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Orchestration&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;ChatQnA&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Python / FastAPI&lt;/td&gt;
 &lt;td&gt;Owns the DAG; calls each stage; enforces abstention and confidence.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Embedding&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;TEI Embedding&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Hugging Face TEI&lt;/td&gt;
 &lt;td&gt;Vectorises the query (and chunks at ingest time).&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Retrieval&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;Retriever&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Python / ArangoDB&lt;/td&gt;
 &lt;td&gt;Hybrid vector + graph search over indexed chunks.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Reranking&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;TEI Reranker&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Hugging Face TEI&lt;/td&gt;
 &lt;td&gt;Re-scores retrieved chunks by query relevance.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Generation&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;vLLM&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;vLLM (OpenAI-compatible)&lt;/td&gt;
 &lt;td&gt;Produces the grounded answer.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Translation&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;Translation&lt;/strong&gt; (optional)&lt;/td&gt;
 &lt;td&gt;TranslaTron or vLLM&lt;/td&gt;
 &lt;td&gt;Translates the stream into the user&amp;rsquo;s UI language.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;All services are containerised and communicate over the internal Docker network.
Only the backend (BFF) and the public Nginx gateway are reachable from outside
the cluster.&lt;/p&gt;</description></item><item><title>Retrieval</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/retrieval/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/retrieval/</guid><description>&lt;p&gt;Retrieval is the stage that decides &lt;em&gt;which&lt;/em&gt; chunks of the knowledge base the LLM
is allowed to see. GENIE.AI does not rely on a single signal: it fuses
&lt;strong&gt;dense-vector&lt;/strong&gt; search with &lt;strong&gt;lexical (BM25)&lt;/strong&gt; search, and can additionally walk
the &lt;strong&gt;knowledge graph&lt;/strong&gt; to surface related chunks. The result is high recall
(semantic matches the exact-keyword search would miss) without losing precision
on proper nouns, codes, and rare terms that dense models handle poorly.&lt;/p&gt;</description></item><item><title>Reranking</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/reranking/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/reranking/</guid><description>&lt;p&gt;Retrieval hands the reranker a candidate set of chunks; the reranker&amp;rsquo;s job is to
re-order them by true relevance to the query and decide &lt;strong&gt;how many&lt;/strong&gt; (if any) are
good enough to send to the LLM. A cross-encoder reranker is more accurate than
the bi-encoder used for retrieval because it reads the query and each chunk
together, but it is also slower — which is why it runs only on the small
candidate set, not the whole corpus.&lt;/p&gt;</description></item><item><title>Generation</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/generation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/generation/</guid><description>&lt;p&gt;Generation is the final RAG stage: the kept chunks are assembled into a prompt
and sent to the LLM, which produces a grounded answer streamed back to the user.
The default LLM is &lt;code&gt;meta-llama/Meta-Llama-3.1-8B-Instruct&lt;/code&gt; (the docker-compose
default). &lt;code&gt;ibm-granite/granite-4.1-8b&lt;/code&gt; is the recommended and validated model;
&lt;code&gt;ibm-granite/granite-3.3-2b-instruct&lt;/code&gt; is the in-code fallback. All are served by
vLLM (OpenAI-compatible API).&lt;/p&gt;
&lt;p&gt;The generation behaviour is shaped by three things: the &lt;strong&gt;system prompt&lt;/strong&gt;, the
&lt;strong&gt;abstention&lt;/strong&gt; rule, and an optional &lt;strong&gt;self-confidence&lt;/strong&gt; token. Each is an
environment variable with a built-in default.&lt;/p&gt;</description></item><item><title>Data Labelling Strategy</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/data-labeling/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/data-labeling/</guid><description>&lt;p&gt;This repository implements a &lt;strong&gt;data labeling and enrichment pipeline&lt;/strong&gt; designed to maximize the accuracy and explainability of Retrieval-Augmented Generation (RAG) systems.&lt;br&gt;
Unlike conventional data labeling systems that prepare training sets for supervised learning, this process focuses on &lt;strong&gt;labelling document chunks for ingestion into a RAG pipeline&lt;/strong&gt;, creating both semantic and structural signals that boost retrieval performance.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="why-this-approach"&gt;Why This Approach?&lt;/h2&gt;
&lt;p&gt;Most RAG pipelines rely solely on &lt;strong&gt;vector embeddings&lt;/strong&gt; for semantic similarity. While powerful, vector-only retrieval often suffers from:&lt;/p&gt;</description></item><item><title>Contextual Retrieval</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/contextual-retrieval/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/contextual-retrieval/</guid><description>&lt;p&gt;Standard retrieval embeds each chunk in isolation. A chunk removed from its
section can be hard to match: a paragraph about &amp;ldquo;renewing it&amp;rdquo; will not retrieve
well for a query about &amp;ldquo;permit renewal&amp;rdquo; because the chunk alone does not say what
&amp;ldquo;it&amp;rdquo; is. &lt;strong&gt;Contextual Retrieval&lt;/strong&gt; (an Anthropic-style technique) fixes this by
prepending a short, LLM-generated &lt;strong&gt;doc-context prefix&lt;/strong&gt; to each chunk &lt;em&gt;before&lt;/em&gt;
it is embedded and labelled, so the chunk&amp;rsquo;s vector carries its surrounding
meaning.&lt;/p&gt;</description></item><item><title>Choosing and Configuring Models</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/choosing-models/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag/choosing-models/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;GENIE.AI uses a &lt;strong&gt;multi-model architecture&lt;/strong&gt; where different AI models serve distinct purposes across the entire framework — from document ingestion and knowledge graph construction through to retrieval, reranking, and response generation. Not every model is suitable for every role. Choosing the wrong model for a given purpose will cause silent failures — ingestion batches being skipped, labels returning garbage, or graph data not being created.&lt;/p&gt;
&lt;p&gt;This guide explains what each model does, what capabilities it &lt;strong&gt;must&lt;/strong&gt; have, what license it is released under, and provides specific recommendations for both open-source and commercial models across different hardware tiers.&lt;/p&gt;</description></item></channel></rss>