Retrieval · Theological research

RAG for theological research: keeping citations visible.

Retrieval can help an AI find relevant passages. A trustworthy research product must also let the reader inspect, save, and reuse the evidence.

By Matthew TuccioAugust 20268 min read

A theological corpus is a difficult place for a confident chatbot. Concepts develop across books, familiar words carry specialized meanings, and an answer that sounds coherent may still misrepresent the source. Retrieval-augmented generation can reduce that problem—but retrieval alone does not make an answer reliable.

The more useful product question is not simply whether an AI can answer from a collection of texts. It is whether a reader can see what the answer relied on, return to the original passage, retain useful evidence, and continue the investigation without losing where each claim came from.

Retrieval is not the same as authority

Retrieval-augmented generation, commonly shortened to RAG, combines a generative model with material retrieved from an external collection. Instead of depending only on the model’s general training, the application searches a controlled corpus and gives relevant passages to the model as working context.

That architecture can make an answer more specific and reduce unsupported invention. It does not turn the model into an authority. Retrieval can miss an important passage, surface a superficially similar one, or provide a fragment whose meaning depends on material around it. The generated explanation can still overstate what its sources establish.

The product principle: the model may help find and explain evidence, but the original text remains the object a reader must be able to inspect.

Citations must be part of the interface

A citation appended to the end of generated prose is better than no citation, but it is only the beginning. For research, the citation needs to function as an interface: it should identify the work and passage, connect the claim to the retrieved excerpt, and let the reader move directly from interpretation back to source.

In a Swedenborg corpus, paragraph numbers are more useful than invented page references because editions and layouts vary. A reference such as Arcana Coelestia §2893 identifies the source unit independently of the screen or printed edition. When that reference is connected to the visible passage, the reader can assess whether the explanation is supported, partial, or misleading.

A controlled corpus changes the research problem

Open-web search is useful for discovery, but it mixes primary texts, commentary, summaries, and pages of uncertain provenance. A controlled research corpus narrows the problem. The product knows which works it contains, how they are divided, and which identifiers belong to each passage.

Ask Swedenborg currently works with a corpus described as 28 volumes of Swedenborg’s writings alongside Bible material. Swedenborg’s works are divided into passages and indexed for semantic retrieval, so a reader can investigate a concept without already knowing the exact wording or paragraph number. The Bible is stored separately as structured text for exact reference lookup and cross-corpus research.

Semantic similarity is valuable here because theological relationships are not always expressed with one repeated keyword. But similarity is a retrieval signal, not a conclusion. The product still needs to expose what was found and allow the human researcher to judge its relevance.

A relational database and a vector index do different jobs

The project uses both a relational database and a vector index because the two corpora need different retrieval paths. They are complementary, not competing databases.

Swedenborg’s works are held in the vector index. Each passage is represented numerically with its source metadata so a question can retrieve material that is related by meaning even when it does not repeat the user’s words. This supports conceptual research across many volumes when the reader does not know Swedenborg’s terminology, the relevant work, or the paragraph number in advance.

The Bible is stored in MariaDB as structured, exact text. That makes chapter-and-verse lookup deterministic and supports direct questions such as “open John 3:16” or “show the biblical text connected to this reference.” The relational layer is also suited to application records whose identities and relationships must remain stable, such as bookmarks, notes, and saved research.

A research response can therefore bring together two kinds of evidence: semantically retrieved Swedenborg passages from the vector corpus and exact Bible passages from MariaDB. The vector layer helps answer which Swedenborg passages may be relevant? The relational layer answers which biblical text was explicitly requested or referenced? The interface then presents both with their own stable source labels rather than pretending they came from one undifferentiated search.

Normalize the question without rewriting its intent

Retrieval quality also depends on what happens before the search. Users may enter inconsistent capitalization, extra punctuation, abbreviated work titles, alternative spellings, or Bible references in different formats. English and German questions may express the same concept with very different surface language. Passing every raw string directly into retrieval makes the evidence search less predictable.

An input-normalization layer can clean that variation while preserving both the original question and the user’s meaning. It can standardize whitespace and reference formats, recognize known work names or abbreviations, identify the query language, and separate a direct Bible lookup from a broader conceptual question. A query containing a chapter-and-verse reference should not be treated in precisely the same way as an open-ended question about providence, freedom, or correspondences.

Normalization should make the route to evidence clearer, not make the system pretend the user asked a different question. Preserving the raw and normalized forms also makes retrieval behavior easier to inspect and improve when an expected passage is not found.

The useful loop continues after the answer

Many RAG demonstrations end when the model produces cited prose. A research product should continue. A useful passage may answer one part of a question, contradict another passage, introduce a biblical reference, or become evidence in a larger investigation. If the result disappears with the conversation, the researcher must start again.

A stronger workflow is:

This turns a chatbot exchange into a research loop. The AI answer is no longer the final artifact. The lasting artifact is the body of evidence the reader has reviewed and organized.

Writing should inherit the research trail

The next risk appears when saved passages move into writing. A writing assistant can quickly transform research into commentary, a study paper, or sermon notes, but fluency can again obscure the boundary between source, interpretation, and new prose.

Source-grounded drafting should carry the selected passages, their identifiers, and the researcher’s notes into the writing context. Generated claims should remain reviewable against that material. The goal is not merely to make drafting faster; it is to avoid losing the evidence relationships built during research.

The current Ask Swedenborg Writing Assistant is an early, limited implementation of this direction. Saved passages can be selected and reused in a writing context. The longer-term architectural opportunity is to retain an investigation as a structured object connecting questions, claims, Swedenborg passages, Bible passages, citations, notes, and their relationships. That remains development direction rather than a finished public capability.

What visible citations cannot solve

Good citations do not guarantee a good interpretation. They do not decide whether a translation is adequate, whether a passage is representative, or how competing readings should be weighed. They also do not remove the need to read beyond the retrieved excerpt.

What they do provide is a more honest boundary. The application can show its working material, the reader can challenge the explanation, and the research can continue from something more durable than generated confidence.

That is the practical value of RAG in a specialized theological corpus: not an automated authority, but a constrained path from question to source, from source to saved evidence, and from evidence to accountable writing.

Explore the Ask Swedenborg brief

See how corpus search, visible citations, saved research, and source-grounded writing fit together in the current application.

Read the product brief →

More research: Browse all articles and product briefs →