<?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-pipeline/</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-pipeline/index.xml" rel="self" type="application/rss+xml"/><item><title>Ingestion and chunking strategies</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/ingestion/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/ingestion/</guid><description>&lt;p&gt;Ingestion is &lt;strong&gt;step 0 of the RAG pipeline&lt;/strong&gt;. It runs before the embedding model
sees anything, before the retriever ever queries ArangoDB, and before any
context prefix is generated. Its job is to turn an uploaded file into a list
of well-sized, well-labelled chunks whose vectors (computed downstream by the
embedding model) will actually match what users ask.&lt;/p&gt;
&lt;p&gt;This page consolidates the &lt;strong&gt;RAG-specific side&lt;/strong&gt; of ingestion: how the
chunker sizes chunks per format, how the Contextual Retrieval prefix is
generated (per-chunk vs doc-level), and how the decoupled-labelling mode
keeps the labeler honest. For the &lt;strong&gt;operator side&lt;/strong&gt; — supported formats,
file-size limits, ClamAV scanning, the file lifecycle states — see
&lt;a href="https://genie-ai-7e342b.opensource.unicc.org/docs/knowledge-base/ingestion/"&gt;Knowledge base → Ingestion&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Pipeline Architecture</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/pipeline/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/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/genieai_chatqna.py&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;p&gt;This page describes the lifecycle of a single chat request — from the browser
submitting a query to the streamed tokens reaching the screen — and the
configuration surface that governs it.&lt;/p&gt;</description></item><item><title>Retrieval</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/retrieval/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/retrieval/</guid><description>&lt;p&gt;Retrieval is the stage that decides &lt;strong&gt;which&lt;/strong&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-pipeline/reranking/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/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 &lt;strong&gt;true relevance&lt;/strong&gt; 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-pipeline/generation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/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 behaviour is shaped by three knobs — 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 — plus
&lt;strong&gt;translation&lt;/strong&gt; when the user&amp;rsquo;s UI locale is not English.&lt;/p&gt;
&lt;p&gt;This page is for developers tuning answer quality and operators debugging
the response stream.&lt;/p&gt;</description></item><item><title>Contextual Retrieval</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/contextual-retrieval/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/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-pipeline/choosing-models/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/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><item><title>Data Labelling Strategy</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/data-labeling/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/data-labeling/</guid><description>&lt;p&gt;Labelling is what keeps a multi-domain knowledge base from bleeding across
topics. Every chunk is assigned one or more labels drawn from the
service-category taxonomy, and at query time the retriever uses those
labels to return only on-topic chunks. Without labels, a question about one
service could pull in unrelated chunks from another.&lt;/p&gt;
&lt;p&gt;This page is for developers configuring dataprep and operators debugging
why retrieval is (or is not) constrained to the right topic.&lt;/p&gt;</description></item><item><title>Streaming &amp; Metadata Events</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/streaming-sse/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/streaming-sse/</guid><description>&lt;p&gt;When the backend calls &lt;code&gt;POST /v1/chatqna&lt;/code&gt; with &lt;code&gt;stream: true&lt;/code&gt;, ChatQnA
streams the answer back as &lt;strong&gt;Server-Sent Events&lt;/strong&gt; (SSE). Each event is a
single line &lt;code&gt;data: &amp;lt;json&amp;gt;\n\n&lt;/code&gt;; the terminal event is &lt;code&gt;data: [DONE]\n\n&lt;/code&gt;.
Between the first and the last, ChatQnA interleaves per-token content
events and a single terminal &lt;strong&gt;metadata event&lt;/strong&gt; carrying
&lt;code&gt;source_documents&lt;/code&gt;, &lt;code&gt;retrieval_confidence_score&lt;/code&gt;, &lt;code&gt;confidence_score&lt;/code&gt;,
&lt;code&gt;is_grounded&lt;/code&gt;, and (when &lt;code&gt;LLM_SELF_CONFIDENCE_ENABLED=1&lt;/code&gt;) &lt;code&gt;self_confidence&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This page is for backend developers parsing the stream, frontend developers
rendering the citation list, and operators debugging what the user actually
receives.&lt;/p&gt;</description></item><item><title>Multi-Turn Retrieval</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/multi-turn-retrieval/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/multi-turn-retrieval/</guid><description>&lt;p&gt;By default ChatQnA retrieval is &lt;strong&gt;stateless&lt;/strong&gt;: only the last user message is
embedded and searched against the knowledge base. This is fine for
standalone questions but breaks for multi-turn follow-ups:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;User (turn 1):&lt;/strong&gt; How do I renew my residence permit?
&lt;strong&gt;User (turn 2):&lt;/strong&gt; Can you elaborate on this?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;ldquo;Can you elaborate on this?&amp;rdquo; has no semantic content on its own. Embedding
it in isolation retrieves nothing useful, even though the conversation is
clearly about permit renewal.&lt;/p&gt;</description></item><item><title>Streaming Translation</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/streaming-translation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/streaming-translation/</guid><description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;For backend developers and deployers.&lt;/strong&gt; This page explains the
&lt;code&gt;STREAMING_TRANSLATION_ENABLED&lt;/code&gt; toggle that fixes &lt;a href="https://gitlab.com/un/itu/genie-ai/-/issues/829"&gt;issue #829&lt;/a&gt;:
when a user asks in Spanish, the chat must show Spanish text &lt;strong&gt;as it
streams&lt;/strong&gt;, not an English stream that flips at the end. The flag is
off by default — turning it on requires the GPU translation service and
a recent enough deployment to support unit boundaries.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="the-problem-issue-829"&gt;The problem (issue #829)&lt;/h2&gt;
&lt;p&gt;Before this feature, the flow for a Spanish-speaking user was:&lt;/p&gt;</description></item><item><title>Per-Request Overrides</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/per-request-overrides/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/per-request-overrides/</guid><description>&lt;p&gt;Most RAG knobs in GENIE.AI are deployment-wide (set in &lt;code&gt;.env&lt;/code&gt;). A subset
can be overridden on a &lt;strong&gt;single&lt;/strong&gt; chat request via the OpenAI-compatible
&lt;code&gt;retriever_parameters&lt;/code&gt; and &lt;code&gt;reranker_parameters&lt;/code&gt; fields on the request
body — useful for an admin tool that wants to A/B a chunk count, for an
experiment harness that varies &lt;code&gt;top_n&lt;/code&gt; per query, or for an integration
test that needs to lock in a known reranker strategy.&lt;/p&gt;
&lt;p&gt;This page is for backend developers building integrations against ChatQnA
and operators experimenting with retrieval and reranking knobs.&lt;/p&gt;</description></item><item><title>Model Capability Cache</title><link>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/model-capability-cache/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genie-ai-7e342b.opensource.unicc.org/docs/rag-pipeline/model-capability-cache/</guid><description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;For backend developers and operators.&lt;/strong&gt; The
&lt;code&gt;genie-ai-overlay/core/model_cache.py&lt;/code&gt; module probes a remote vLLM
endpoint&amp;rsquo;s &lt;code&gt;/v1/models&lt;/code&gt; route, caches the result for &lt;code&gt;MODEL_DETECT_TTL&lt;/code&gt;
seconds (default 60), and serves the cached value on subsequent calls.
On expiry the endpoint is re-probed; on probe failure the last known
value is returned. This lets services pick up model changes on the
GPU node without a restart.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This page documents the cache contract, the env var, the failure modes,
and how to clear the cache for testing.&lt;/p&gt;</description></item></channel></rss>