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-ragsource, measured on 2026-09-19. It is derivative: the data store andomnibioai-ragremain 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.
| Stage | What the source implements | Implemented in source | Deployed | Operationally verified | Evidence (file and symbol) |
|---|---|---|---|---|---|
| Ingestion | Domain-scoped PubMed search and record fetch through NCBI Entrez; each record is saved as one JSON file per PMID. | yes | UNKNOWN | UNKNOWN | ragbio/utils/rag_data_loader.py fetch_pubmed_idsragbio/utils/rag_data_loader.py fetch_abstract_and_metadataragbio/utils/rag_data_loader.py Entrez.esearch |
| Embedding | The loader reads the abstract text of each record; each abstract is embedded as one unit. No text-splitting stage was found. | yes | UNKNOWN | UNKNOWN | ragbio/embeddings/embedding_engine.py load_abstractsragbio/embeddings/embedding_engine.py generate_embeddings |
| Index build | Normalised vectors are added to an inner-product flat index, saved with a positional PMID map. | yes | UNKNOWN | UNKNOWN | ragbio/embeddings/embedding_engine.py build_faiss_indexragbio/embeddings/embedding_engine.py faiss.IndexFlatIPragbio/embeddings/embedding_engine.py save_index |
| Retrieval | An 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. | yes | UNKNOWN | UNKNOWN | ragbio/pipeline/rag_pipeline.py FAISSPMIDRetrieverragbio/pipeline/rag_pipeline.py _load_faiss_indexragbio/pipeline/rag_pipeline.py _list_studies |
| Query pipeline | Optional query expansion, retrieval per query variant merged by PMID (highest score kept), optional reranking, then generation by a configured chat model. | yes | UNKNOWN | UNKNOWN | ragbio/pipeline/rag_pipeline.py _run_rag_coreragbio/pipeline/rag_pipeline.py expand_queryragbio/pipeline/rag_pipeline.py rerank_resultsragbio/pipeline/rag_pipeline.py self.chat_model |
| Hybrid retrieval | Optional lexical (BM25) retrieval fused with vector results, for a single named domain. | yes | UNKNOWN | UNKNOWN | ragbio/retrieval/hybrid_search.py HybridSearcher |
| Knowledge graph | Optional graph-backed enrichment. | yes | UNKNOWN | UNKNOWN | ragbio/knowledge_graph/kg_builder.py KnowledgeGraphBuilder |
| Provenance in answers | Each retrieved document carries its PMID as its source, so answers can be traced to records. | yes | UNKNOWN | UNKNOWN | ragbio/pipeline/rag_pipeline.py "source": pmid |
| Authorization | A study-scope check is applied to a named study on the query API. | yes | UNKNOWN | UNKNOWN | ragbio/security/resource_scope.py authorize_readragbio/api/server.py authorize_read(req.study |
| Query API | HTTP routes for query, study listing, ingest and embed. See the API Reference. | yes | UNKNOWN | UNKNOWN | ragbio/api/server.py /v1/queryragbio/api/server.py /v1/studiesragbio/api/server.py /v1/ingestragbio/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.
| Setting | Source default | Deployment configuration |
|---|---|---|
RAG_QUERY_EXPANSION | true | true |
RAG_RERANKING | true | true |
HYBRID_SEARCH_ENABLED | false | true |
NEO4J_ENABLED | false | true |
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.