Skip to main content

RAG Architecture

About this data (generated 2026-09-19)

Generated discovery surface. This page is generated from a read-only inventory of the local PubMed data store and the omnibioai-rag source, measured on 2026-09-19. It is derivative: the data store and omnibioai-rag remain the authoritative sources. Measured, configured and implemented-in-source are not the same as deployed, and deployed is not the same as operationally verified. See Provenance for how to read every figure.

Pipeline​

PubMed source -> ingestion -> domain organisation -> embedding -> FAISS index
-> retrieval -> (optional expansion, hybrid, reranking) -> generation -> PMID citations

The table lists only stages that have a code element in omnibioai-rag at revision 247b6e8. Each row separates four kinds of evidence:

  • Implemented in source: the named code elements exist at that revision (found by static parsing; nothing was imported or run).
  • Configured: see the optional-features table below.
  • Deployed: UNKNOWN for every stage. This audit did not inspect running services.
  • Operationally verified: UNKNOWN for every stage. No query was run.
StageWhat the source implementsImplemented in sourceDeployedOperationally verifiedEvidence (file and symbol)
IngestionDomain-scoped PubMed search and record fetch through NCBI Entrez; each record is saved as one JSON file per PMID.yesUNKNOWNUNKNOWNragbio/utils/rag_data_loader.py fetch_pubmed_ids
ragbio/utils/rag_data_loader.py fetch_abstract_and_metadata
ragbio/utils/rag_data_loader.py Entrez.esearch
EmbeddingThe loader reads the abstract text of each record; each abstract is embedded as one unit. No text-splitting stage was found.yesUNKNOWNUNKNOWNragbio/embeddings/embedding_engine.py load_abstracts
ragbio/embeddings/embedding_engine.py generate_embeddings
Index buildNormalised vectors are added to an inner-product flat index, saved with a positional PMID map.yesUNKNOWNUNKNOWNragbio/embeddings/embedding_engine.py build_faiss_index
ragbio/embeddings/embedding_engine.py faiss.IndexFlatIP
ragbio/embeddings/embedding_engine.py save_index
RetrievalAn index and its map are loaded per domain with structural checks; the query vector must match the index dimension; nearest neighbours are found by inner product.yesUNKNOWNUNKNOWNragbio/pipeline/rag_pipeline.py FAISSPMIDRetriever
ragbio/pipeline/rag_pipeline.py _load_faiss_index
ragbio/pipeline/rag_pipeline.py _list_studies
Query pipelineOptional query expansion, retrieval per query variant merged by PMID (highest score kept), optional reranking, then generation by a configured chat model.yesUNKNOWNUNKNOWNragbio/pipeline/rag_pipeline.py _run_rag_core
ragbio/pipeline/rag_pipeline.py expand_query
ragbio/pipeline/rag_pipeline.py rerank_results
ragbio/pipeline/rag_pipeline.py self.chat_model
Hybrid retrievalOptional lexical (BM25) retrieval fused with vector results, for a single named domain.yesUNKNOWNUNKNOWNragbio/retrieval/hybrid_search.py HybridSearcher
Knowledge graphOptional graph-backed enrichment.yesUNKNOWNUNKNOWNragbio/knowledge_graph/kg_builder.py KnowledgeGraphBuilder
Provenance in answersEach retrieved document carries its PMID as its source, so answers can be traced to records.yesUNKNOWNUNKNOWNragbio/pipeline/rag_pipeline.py "source": pmid
AuthorizationA study-scope check is applied to a named study on the query API.yesUNKNOWNUNKNOWNragbio/security/resource_scope.py authorize_read
ragbio/api/server.py authorize_read(req.study
Query APIHTTP routes for query, study listing, ingest and embed. See the API Reference.yesUNKNOWNUNKNOWNragbio/api/server.py /v1/query
ragbio/api/server.py /v1/studies
ragbio/api/server.py /v1/ingest
ragbio/api/server.py /v1/embed

Optional features (CONFIGURED)​

These are switches, not evidence of behaviour. The deployment value is what a deployment configuration file sets; it does not show what a running service does.

SettingSource defaultDeployment configuration
RAG_QUERY_EXPANSIONtruetrue
RAG_RERANKINGtruetrue
HYBRID_SEARCH_ENABLEDfalsetrue
NEO4J_ENABLEDfalsetrue

No sub-abstract chunking​

No text-splitting construct was found in 3 ingestion, embedding and retrieval source files (TextSplitter, split_text, RecursiveCharacterTextSplitter, sliding_window). Each abstract is embedded as one unit, so the inventory reports 0 sub-abstract chunks. A "chunk" elsewhere in these pages, such as a general-corpus shard, is a directory.

What this page does not claim​

It does not claim that any stage is deployed, that retrieval quality has been evaluated, or that the retrieval service can answer over every domain today: that depends on the index state in Indexes and Embeddings.