---
title: 'SpiritRAG: Archival QA for UN Resolutions'
url: https://www.emergentmind.com/topics/spiritrag
type: topic
---

# SpiritRAG: Archival QA for UN Resolutions

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 [2507.04395]. 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 [2507.04395]. 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 [2603.25374], [2601.08699], [2606.11199].

## 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 [2507.04395]. 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 [2507.04395].

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” [2507.04395]. 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 [2507.04395].

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 [2507.04395]. 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 [2507.04395]. 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 [2507.04395]. The paper states that this yielded “nearly 7,500 UN resolution documents across seven languages”: Arabic, Chinese, English, French, German, Russian, and Spanish [2507.04395].

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 [2507.04395]. Some resolutions belong to both domains [2507.04395].

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` [2507.04395]. 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 [2507.04395].

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” [2507.04395]. 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 [2507.04395]. 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 [2507.04395]. The paper says that crawled documents in English, French, German, and Spanish were parsed into structured JSON with paragraph chunks using Docling [2507.04395]. Arabic, Chinese, and Russian were not parsed because sufficiently high-quality PDF parsers were unavailable for those languages [2507.04395]. This means the searchable text index is based on only four languages even though seven-language document availability and metadata are retained [2507.04395].

The chunking strategy is paragraph-based rather than fixed-token sliding windows [2507.04395]. 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 [2507.04395]. Two retriever backbones are evaluated: all-MiniLM-L6-v2 and Qwen3-Embedding-0.6B [2507.04395].

The retrieval formulation is given explicitly. For a user query \(q\), SpiritRAG computes a query embedding \(\mathbf{e}_q\). Each stored document embedding is \(\mathbf{e}_d \in \mathbf{E}^{|D| \times m}\), where \(m\) is the embedding dimension and \(D\) is the corpus [2507.04395]. First-stage retrieval uses cosine similarity,

$$
\text{cos\_sim}(\mathbf{e}_q, \mathbf{e}_d) = \frac{\mathbf{e}_q \cdot \mathbf{e}_d}{||\mathbf{e}_q|| \cdot ||\mathbf{e}_d||}.
$$

Documents are then ranked in descending cosine similarity [2507.04395]. The system pre-fetches the top-\(n\) documents and applies a second-stage reranking defined over sentence embeddings within each candidate document:

$$
r(D_i;q) = \alpha \cdot \max_{s \in D_i}(L_2(\mathbf{e}_q, \mathbf{e}_s)) + (1-\alpha) \cdot \operatorname*{avg}_{s \in D_i}(L_2(\mathbf{e}_q, \mathbf{e}_s)),
$$

with \(\alpha = 0.7\), chosen empirically [2507.04395]. Although described as reranking, this is a heuristic sentence-level distance mixture rather than a cross-encoder or learned reranker [2507.04395]. The paper does not mention BM25, sparse retrieval, hybrid retrieval, or a learned ranking objective [2507.04395].

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 [2507.04395]. The evaluated generation backbones are Qwen3-0.6B and Qwen3-1.7B [2507.04395]. 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 [2507.04395]. Second, it can incorporate user-provided PDFs at runtime, parsed and chunked “in real time,” then appended as additional grounded context during answer generation [2507.04395]. The paper does not state that uploaded documents are inserted into the persistent vector store; they appear instead as transient prompt-grounding inputs [2507.04395].

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 [2507.04395]. Clicking a language opens the original PDF in a viewer [2507.04395]. This provides document-level provenance and auditability, but not fine-grained claim-to-sentence citation alignment [2507.04395].

The interaction model is a chatbot-style web interface built with React.js on the frontend and Flask APIs on the backend [2507.04395]. Users can ask free-form questions, inspect retrieved source documents, upload PDFs, switch dark mode, and download conversation history [2507.04395]. 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 [2507.04395]. The system is characterized as “lightweight and easily deployed both locally or on cloud services, requiring minimal computation resources” [2507.04395].

## 5. Evaluation and empirical findings

The evaluation is based on 100 manually composed expert questions: 50 in health + religion/spirituality and 50 in education [2507.04395]. 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 [2507.04395]. This temporal dimension matters because one of the retrieval evaluation criteria is temporality [2507.04395].

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 [2507.04395]. For retrieval, the dimensions are Relevance, Accuracy, Usefulness, Temporality, and Actionability. For generation, the dimensions are Congruence, Coherence, Relevance, Creativity, and Engagement [2507.04395].

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 [2507.04395]. 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 [2507.04395].

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 [2507.04395]. 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 [2507.04395].

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 [2507.04395]. 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 [2507.04395].

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 [2507.04395]. 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 [2507.04395].

## 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 [2507.04395]. Its strengths lie in corpus curation, domain grounding, multilingual document access, metadata-aware source inspection, and expert-centered evaluation [2507.04395]. 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 [2507.04395].

The limitations are also substantial. The paper does not report classical IR metrics such as precision, recall, or nDCG against labeled relevance judgments [2507.04395]. It does not compare against BM25, hybrid retrieval, or the native UN archive search interface [2507.04395]. The searchable text index excludes Arabic, Chinese, and Russian because of parsing limitations [2507.04395]. Grounding is document-level rather than sentence-level, leaving residual hallucination risk [2507.04395]. 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 [2507.04395].

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 [2603.25374]. That work addresses confidentiality and cross-silo retrieval under adversarial infrastructure assumptions, which are concerns absent from SpiritRAG’s archival-search setting [2603.25374].

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 [2601.08699]. SpiritRAG does not use an agentic retrieval loop or robustness-oriented supervision of this sort [2507.04395], [2601.08699].

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 [2606.11199]. 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 [2507.04395], [2606.11199].

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 [2507.04395].

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 [2507.04395].

Source: https://www.emergentmind.com/topics/spiritrag