SpiritRAG: Archival QA for UN Resolutions
- SpiritRAG is a domain-specific retrieval-augmented generation system that enables context-sensitive question answering over UN resolutions focused on religion, spirituality, health, and education.
- It employs a modular dense-retrieval pipeline using document embeddings in Faiss and heuristic sentence-level reranking to navigate a multilingual and metadata-rich archival corpus.
- The system integrates real-time user-uploaded PDFs with evaluated performance on retrieval relevance and generation coherence, highlighting both its practical contributions and limitations.
Searching arXiv for the cited SpiritRAG paper and closely related RAG work mentioned in the provided material. SpiritRAG is a domain-specific retrieval-augmented generation system for question answering over religion and spirituality in the United Nations archive. It is presented as an interactive, chat-based web system designed to make religion/spirituality, described as “complex and highly domain-dependent concepts,” searchable in large and noisy archival collections that are poorly served by conventional keyword search (Gao et al., 6 Jul 2025). The system is built on a curated UN resolution corpus focused on health and education, uses dense retrieval over document embeddings stored in Faiss, supports optional incorporation of user-uploaded PDFs, and was evaluated through a pilot study with domain experts on 100 manually composed questions (Gao et al., 6 Jul 2025). In a broader research context, SpiritRAG can also be situated alongside recent work on confidential federated RAG, agentic data synthesis for robust retrieval, and structured evidence-centric RAG architectures, although these are separate systems rather than variants of SpiritRAG (Stripelis et al., 26 Mar 2026, Tao et al., 13 Jan 2026, Fever et al., 21 Apr 2026).
1. Concept and scope
SpiritRAG is designed to address an operationalization problem in archival research: religion and spirituality in policy corpora are not fixed categories but context-sensitive concepts whose meanings vary across disciplines, institutions, and historical moments (Gao et al., 6 Jul 2025). In UN materials, this creates a retrieval problem because semantically relevant content may be expressed through heterogeneous formulations such as religion, belief, faith, spirituality, interfaith dialogue, religious freedom, faith-based organizations, cultural appropriateness, or dignity, while the archive also contains misleading phrase matches such as “in the spirit of …” that are semantically irrelevant to religion/spirituality (Gao et al., 6 Jul 2025).
The system is explicitly framed for researchers and policymakers working in domains such as religion, health policy, education, international relations, and digital humanities, especially during the “initial stages of knowledge acquisition” (Gao et al., 6 Jul 2025). Its purpose is not merely exact-match retrieval but context-sensitive question answering over a curated archive. The use cases described in the evaluation include historical tracing, institutional monitoring, topical analysis, and policy search across health and education, including questions about gender equality, refugees’ religious freedom, SDG 4, girls’ education, multilingual education, pandemics, universal primary healthcare, and health as a human right (Gao et al., 6 Jul 2025).
Although SpiritRAG is described as a system for religion/spirituality in the United Nations archive, the implementation reported in the paper is narrower than that label might suggest. It focuses concretely on UN resolution documents in the domains of health plus religion/spirituality and education, rather than the full UN archival ecosystem (Gao et al., 6 Jul 2025). This suggests that SpiritRAG should be understood as a domain-specific archival QA system rather than a general-purpose UN search engine.
2. Corpus construction and archival substrate
The underlying corpus is the UN-RES corpus, built by crawling the United Nations Official Document System using Selenium, with BeautifulSoup also mentioned in the appendix as part of the crawler implementation (Gao et al., 6 Jul 2025). The inclusion criteria are explicit: documents had to be resolution documents marked “RES,” related to health and education, and published between 01.01.1990 and 03.31.2025 (Gao et al., 6 Jul 2025). The paper states that this yielded “nearly 7,500 UN resolution documents across seven languages”: Arabic, Chinese, English, French, German, Russian, and Spanish (Gao et al., 6 Jul 2025).
The corpus statistics are multilingual and somewhat heterogeneous because the per-language counts appear to reflect multilingual document versions rather than unique document identities. For health + religion/spirituality, the reported document counts are ar 4,669; de 2,328; en 4,781; es 4,670; fr 4,747; ru 4,690; zh 4,759, with subject counts around 2,046–2,383. For education, the reported document counts are ar 2,586; de 1,123; en 2,718; es 2,658; fr 2,694; ru 2,670; zh 2,586, with subject counts around 1,455–1,944 (Gao et al., 6 Jul 2025). Some resolutions belong to both domains (Gao et al., 6 Jul 2025).
The appendix specifies the topical search terms used in corpus identification. Education-related materials were found using Boolean combinations of educat*, school*, and learn*, while health-related religion/spirituality materials were identified using health, faith, religi*, spiritual*, and belief (Gao et al., 6 Jul 2025). The paper does not report manual document-level relevance annotation during corpus construction, so topicality is governed primarily by document metadata and search-term filtering rather than gold-standard human relevance judgments (Gao et al., 6 Jul 2025).
A further metadata layer is used for corpus analysis. The authors analyze 2,652 unique subject tags and perform hierarchical cluster analysis over these tags, deriving 185 “concise and interpretable clusters” (Gao et al., 6 Jul 2025). Cluster titles were assigned automatically using GPT-4o, and clustering used all-MiniLM-L6-v2 embeddings plus agglomerative clustering with sklearn at distance threshold 2 (Gao et al., 6 Jul 2025). This clustering is presented as corpus analysis rather than part of the online retrieval pipeline, but it shows that SpiritRAG is built on a metadata-rich archival substrate rather than raw PDF text alone.
3. System architecture and retrieval pipeline
SpiritRAG follows a modular dense-retrieval RAG design. The pipeline begins with PDF ingestion, parsing, and chunking, continues with embedding and Faiss indexing, and ends with prompt-grounded generation over retrieved context (Gao et al., 6 Jul 2025). The paper says that crawled documents in English, French, German, and Spanish were parsed into structured JSON with paragraph chunks using Docling (Gao et al., 6 Jul 2025). Arabic, Chinese, and Russian were not parsed because sufficiently high-quality PDF parsers were unavailable for those languages (Gao et al., 6 Jul 2025). This means the searchable text index is based on only four languages even though seven-language document availability and metadata are retained (Gao et al., 6 Jul 2025).
The chunking strategy is paragraph-based rather than fixed-token sliding windows (Gao et al., 6 Jul 2025). The vector database is implemented with Faiss, and the paper states that it was built “with the efficient nearest neighbor search toolkit Faiss,” using pre-trained Sentence-BERT and Qwen3-Embedding models to pre-compute document embeddings (Gao et al., 6 Jul 2025). Two retriever backbones are evaluated: all-MiniLM-L6-v2 and Qwen3-Embedding-0.6B (Gao et al., 6 Jul 2025).
The retrieval formulation is given explicitly. For a user query , SpiritRAG computes a query embedding . Each stored document embedding is , where is the embedding dimension and is the corpus (Gao et al., 6 Jul 2025). First-stage retrieval uses cosine similarity,
Documents are then ranked in descending cosine similarity (Gao et al., 6 Jul 2025). The system pre-fetches the top- documents and applies a second-stage reranking defined over sentence embeddings within each candidate document:
with , chosen empirically (Gao et al., 6 Jul 2025). Although described as reranking, this is a heuristic sentence-level distance mixture rather than a cross-encoder or learned reranker (Gao et al., 6 Jul 2025). The paper does not mention BM25, sparse retrieval, hybrid retrieval, or a learned ranking objective (Gao et al., 6 Jul 2025).
This design places SpiritRAG within a family of lightweight, dense-first RAG systems optimized for relatively small models and simple deployment. Compared with systems that emphasize more elaborate context engineering or graph-based retrieval, SpiritRAG’s retrieval stack is intentionally modest. A plausible implication is that its principal contribution lies less in retrieval novelty than in domain-specific archival grounding and interface design.
4. Generation, grounding, and interaction model
Generation is performed with instruction-tuned Qwen3 models served via vLLM (Gao et al., 6 Jul 2025). The evaluated generation backbones are Qwen3-0.6B and Qwen3-1.7B (Gao et al., 6 Jul 2025). The paper shows a simple prompt template:
“You are a helpful AI assistant. Use the following information to answer the user's question. User's question: {query} Relevant information from the retrieved documents: {retrieved_docs} Relevant information from the user uploaded PDF (optional): {parsed_pdf}”
This prompt reveals two important system properties. First, SpiritRAG is a conventional concatenative RAG system rather than an agentic or tool-using architecture (Gao et al., 6 Jul 2025). Second, it can incorporate user-provided PDFs at runtime, parsed and chunked “in real time,” then appended as additional grounded context during answer generation (Gao et al., 6 Jul 2025). The paper does not state that uploaded documents are inserted into the persistent vector store; they appear instead as transient prompt-grounding inputs (Gao et al., 6 Jul 2025).
Grounding is implemented primarily through retrieved document display rather than inline citation markup in the answer itself. The abstract states that answers are “linked to exact reference documents,” and the interface presents the most relevant retrieved documents in a side panel with metadata such as document title, key subjects, publication date, and available languages (Gao et al., 6 Jul 2025). Clicking a language opens the original PDF in a viewer (Gao et al., 6 Jul 2025). This provides document-level provenance and auditability, but not fine-grained claim-to-sentence citation alignment (Gao et al., 6 Jul 2025).
The interaction model is a chatbot-style web interface built with React.js on the frontend and Flask APIs on the backend (Gao et al., 6 Jul 2025). Users can ask free-form questions, inspect retrieved source documents, upload PDFs, switch dark mode, and download conversation history (Gao et al., 6 Jul 2025). The pilot deployment ran on a university cloud instance with an NVIDIA Tesla L4 GPU with 24 GB RAM, and the best setup is reported to respond in about 7 seconds on average (Gao et al., 6 Jul 2025). The system is characterized as “lightweight and easily deployed both locally or on cloud services, requiring minimal computation resources” (Gao et al., 6 Jul 2025).
5. Evaluation and empirical findings
The evaluation is based on 100 manually composed expert questions: 50 in health + religion/spirituality and 50 in education (Gao et al., 6 Jul 2025). The appendices list all 100 questions, which span List, Yes/No, Closed, Open-ended, and Open-ended* types, with an explicit marker for whether the question is time-bounded (Gao et al., 6 Jul 2025). This temporal dimension matters because one of the retrieval evaluation criteria is temporality (Gao et al., 6 Jul 2025).
Two domain experts specialized in religion/spirituality and education research evaluated both retrieved documents and generated answers using an “Eval” mode in the interface with five-point Likert ratings (Gao et al., 6 Jul 2025). For retrieval, the dimensions are Relevance, Accuracy, Usefulness, Temporality, and Actionability. For generation, the dimensions are Congruence, Coherence, Relevance, Creativity, and Engagement (Gao et al., 6 Jul 2025).
The results show a consistent advantage for stronger embedding and generation backbones. For health + religion/spirituality, retrieval with all-MiniLM-L6-v2 scores Relevance 3.78, Accuracy 4.45, Usefulness 3.66, Temporality 4.45, and Actionability 2.57, while Qwen3-Embedding-0.6B scores 4.26, 4.99, 3.89, 4.99, and 2.08 respectively (Gao et al., 6 Jul 2025). For education, all-MiniLM-L6-v2 scores 2.56, 2.57, 2.44, 4.70, and 2.38, whereas Qwen3-Embedding-0.6B scores 3.51, 3.43, 3.42, 4.75, and 3.39 (Gao et al., 6 Jul 2025).
Generation results show an even clearer gap between Qwen3-0.6B and Qwen3-1.7B. In health + religion/spirituality, Qwen3-0.6B scores Congruence 2.27, Coherence 3.29, Relevance 2.44, Creativity 1.94, and Engagement 2.06, while Qwen3-1.7B scores 3.41, 3.94, 4.18, 3.39, and 2.51 (Gao et al., 6 Jul 2025). In education, Qwen3-0.6B scores 2.42, 2.71, 2.23, 3.54, and 2.71, while Qwen3-1.7B scores 3.78, 3.76, 3.98, 3.92, and 4.06 (Gao et al., 6 Jul 2025).
The authors interpret these results as showing “considerable improvement” from Sentence-BERT to Qwen3-Embedding and a “significant and consistent improvement” in answer length and detail when moving from Qwen3-0.6B to Qwen3-1.7B (Gao et al., 6 Jul 2025). One notable nuance is that actionability does not necessarily track retrieval quality; the paper cautions that low actionability may partly reflect the corpus itself, since many UN resolutions are not directly action-oriented in an operational sense (Gao et al., 6 Jul 2025).
A representative qualitative example concerns the question, “What references are made to gender equality in relation to religion, spirituality across UN resolutions?” The stronger configuration retrieves and synthesizes a structured answer with concrete resolution references such as 75/26, 74/306, 36/55, 72/130, 69/312, 73/285, and 73/296, while the weaker configuration produces a more generic answer dominated by policy boilerplate (Gao et al., 6 Jul 2025). This example illustrates a central SpiritRAG failure mode: weaker retrieval and weaker generation broaden toward generic UN discourse instead of the narrower religion/spirituality framing the query requests (Gao et al., 6 Jul 2025).
6. Positioning, limitations, and relation to adjacent RAG research
SpiritRAG is best understood as a lightweight, domain-specific archival QA system rather than as a frontier agentic or secure RAG architecture (Gao et al., 6 Jul 2025). Its strengths lie in corpus curation, domain grounding, multilingual document access, metadata-aware source inspection, and expert-centered evaluation (Gao et al., 6 Jul 2025). It addresses a real problem in archival research: large institutional corpora are difficult to search for semantically fluid concepts such as religion and spirituality, and domain experts often rely on manual desk review or secondary literature instead of direct evidence access (Gao et al., 6 Jul 2025).
The limitations are also substantial. The paper does not report classical IR metrics such as precision, recall, or nDCG against labeled relevance judgments (Gao et al., 6 Jul 2025). It does not compare against BM25, hybrid retrieval, or the native UN archive search interface (Gao et al., 6 Jul 2025). The searchable text index excludes Arabic, Chinese, and Russian because of parsing limitations (Gao et al., 6 Jul 2025). Grounding is document-level rather than sentence-level, leaving residual hallucination risk (Gao et al., 6 Jul 2025). The corpus itself is limited to UN resolutions in selected domains and omits other relevant UN and multilateral archives, including WHO and UNESCO materials mentioned in the introduction (Gao et al., 6 Jul 2025).
In relation to broader RAG literature, SpiritRAG differs sharply from recent systems that emphasize federated privacy, multi-agent context transformation, or robustness-oriented synthetic training. “Supercharging Federated Intelligence Retrieval” proposes a secure federated RAG architecture in which retrieval stays local to private silos while aggregation and generation occur inside attested confidential compute environments, with Flower used as the orchestration layer and an optional cascading inference mode that uses a non-confidential third-party model only as auxiliary context (Stripelis et al., 26 Mar 2026). That work addresses confidentiality and cross-silo retrieval under adversarial infrastructure assumptions, which are concerns absent from SpiritRAG’s archival-search setting (Stripelis et al., 26 Mar 2026).
RAGShaper, by contrast, is primarily a data synthesis and trajectory elicitation framework for robust Agentic RAG. It constructs dense information trees with an InfoCurator, injects adversarial distractors at Perception and Cognition levels, and forces a teacher agent to navigate those distractors so that the resulting trajectories encode verification, recovery, and noise rejection behavior (Tao et al., 13 Jan 2026). SpiritRAG does not use an agentic retrieval loop or robustness-oriented supervision of this sort (Gao et al., 6 Jul 2025, Tao et al., 13 Jan 2026).
NightFeats provides yet another contrast. It decomposes answering into retrieval, curation, and composition phases governed by explicit intermediate representations and citation-preserving handoff contracts, including temporal-semantic reranking, bounded contradiction reconciliation, and citation-preserving composition (Fever et al., 21 Apr 2026). SpiritRAG does not define typed evidence objects or contradiction-aware fact curation; it remains closer to a standard retrieve-and-generate pipeline with document display as its main provenance mechanism (Gao et al., 6 Jul 2025, Fever et al., 21 Apr 2026).
These comparisons suggest a useful taxonomy. SpiritRAG is not a general solution to secure RAG, agentic retrieval, contradiction-aware synthesis, or hallucination detection. It is instead a specialized archival infrastructure system. A plausible implication is that future SpiritRAG-like systems could evolve in several directions already explored elsewhere: stronger multilingual parsing and retrieval, finer-grained citation, hybrid or reranked retrieval, robustness to ambiguous or noisy evidence, and possibly structured or agentic intermediate reasoning. The paper itself proposes expanding beyond the current UN-resolution scope to include a broader range of documents, “including religious texts,” with the goal of making “embedded spiritual knowledge” more accessible (Gao et al., 6 Jul 2025).
Overall, SpiritRAG occupies a distinctive niche within the RAG landscape: a practical, lightweight, domain-specific system for semantically difficult archival search over policy documents, evaluated by domain experts and grounded in direct document access rather than abstract benchmark optimization (Gao et al., 6 Jul 2025).