Skip to content

RAG with citations, hybrid search and GraphRAG

DocsGPT answers from your documents and cites its sources: click a numbered citation to read the exact passage, then open the file in Knowledge. Retrieval is classic vector, hybrid keyword + vector or GraphRAG, set per source and testable before anyone relies on it.

citations: title · source · page · citation reader · classic · hybrid (bm25 + vector) · graphrag · test retrieval

Last updated:

app.docsgpt.cloud — Chat
app.docsgpt.cloud — Chat

Cited answers, every passage one click away

Answers carry numbered citations. Click one and the citation reader opens beside the chat with the exact passage, the file and the knowledge it came from; Open in Knowledge takes you to the document itself.

Every citation names the title, source and page of the passage it points to. The sources panel lists every passage behind an answer, and files synced from your tools say where they came from, such as "From Google Drive". The model is instructed to answer only from what it retrieved and to say when your documents do not cover the question.

Formulas render properly in answers, so regulatory and financial maths reads as written.

numbered citations · citation reader · open in knowledge · from google drive

app.docsgpt.cloud — Chat › Sources
A chat answer with ten sources; the Sources panel beside it lists each cited document with the start of its passage, and source 7, Pricing guidelines 2026.docx, is marked From Google Drive.
app.docsgpt.cloud — Chat › Sources
A chat answer with ten sources; the Sources panel beside it lists each cited document with the start of its passage, and source 7, Pricing guidelines 2026.docx, is marked From Google Drive.

Three retrievers

Retrieval is chosen per source. Classic vector similarity runs on any vector store; hybrid BM25 + vector and GraphRAG run on pgvector. One question searches every knowledge source an agent uses, with optional query rephrasing and an optional LLM prescreen before the cited answer.

GraphRAG can be switched on when a source is added or later. Until its graph is built, the source keeps answering through classic retrieval.

Classic retrieval uses vector similarity and suits short factual lookups. Hybrid adds BM25 keyword search to vector search for exact terms, codes and names. GraphRAG builds an entity and relationship graph over the source and traverses it with Personalized PageRank for questions that span many documents.

DocsGPT retrievers: method and best use
 MethodBest for
Classicvector similarityshort factual lookups
HybridBM25 keyword + vectorexact terms, codes, names
GraphRAGentity and relationship graph, traversed with Personalized PageRankquestions spanning many documents

graphrag graph · built when added or later · resumable · no graph yet → classic retrieval

Retrieval pipeline
  1. 01Questionuser or agent
  2. 02Rephraseoptional
  3. 03Retrieverclassic · hybrid · graphrag
  4. 04PrescreenLLM relevance filter · optional
  5. 05Answerwith citations
Text version

A question from a user or an agent is optionally rephrased, then passed to the retriever set for each source: classic, hybrid or GraphRAG. An optional prescreen uses an LLM to keep only the relevant chunks, and the answer is generated with citations.

Per-source retrieval settings

Each source carries its own retrieval settings, so a contracts library and a wiki can be tuned differently and still be searched together.

Search exposure decides how an agent sees a source: pre-fetched into the context before the model runs, or offered as a search tool the agent calls when it needs to.

app.docsgpt.cloud — Knowledge › Source settings
Source settings for a contracts library: Retriever set to Hybrid, 6 chunks to retrieve, Rephrase query before search on, Search exposure set to Pre-fetch into context and LLM prescreen off; below, the chunking strategy set to Recursive with maximum and minimum tokens per chunk.
app.docsgpt.cloud — Knowledge › Source settings
Source settings for a contracts library: Retriever set to Hybrid, 6 chunks to retrieve, Rephrase query before search on, Search exposure set to Pre-fetch into context and LLM prescreen off; below, the chunking strategy set to Recursive with maximum and minimum tokens per chunk.

Per-source settings

retriever
classic · hybrid · graphrag
chunks to retrieve
6 by default
query rephrasing
on / off
search exposure
pre-fetch into context · agent searches as a tool
prescreen
LLM relevance filter on retrieved chunks
chunking
strategy · max and min tokens per chunk

Test retrieval before you rely on it

Ask a question and see exactly which chunks the real pipeline finds, in order, with their scores, token counts, the retriever used and how long it took. Try different settings for the test without saving them, then keep what works.

The same search is open to your own apps through the Search API, and to Claude, Cursor and other MCP clients through DocsGPT's search_docs tool (API, MCP & Widgets). Every retrieval step also shows up in the run's execution trace.

test retrieval · scores · retriever · latency · search api · mcp search_docs

app.docsgpt.cloud — Knowledge › Test retrieval
Test retrieval on a contracts library: the question Who approves net 60 payment terms? returns 6 chunks with hybrid retrieval in 92 ms, each listed with its file, score and token count.
app.docsgpt.cloud — Knowledge › Test retrieval
Test retrieval on a contracts library: the question Who approves net 60 payment terms? returns 6 chunks with hybrid retrieval in 92 ms, each listed with its file, score and token count.

Graph view

For sources with GraphRAG on, the graph view shows the entities and relationships DocsGPT extracted: the structure the retriever follows when a question spans many documents. Pick an entity to see what it connects to and how many chunks mention it.

Filter by entity type, search for a name, or switch to the entity and file lists. Building the graph is covered on Knowledge.

entities · relationships · mentioned in n chunks · personalized pagerank

app.docsgpt.cloud — Knowledge › Knowledge graph
The knowledge graph of a source with 309 entities and 888 relationships: entity-type filters above the graph, one company selected with its connections highlighted, and a side panel with its summary, connection count and relationships.
app.docsgpt.cloud — Knowledge › Knowledge graph
The knowledge graph of a source with 309 entities and 888 relationships: entity-type filters above the graph, one company selected with its connections highlighted, and a side panel with its summary, connection count and relationships.

How it runs privately

Retrieval, BM25 and graph traversal run inside your PostgreSQL/pgvector instance, and embeddings are computed locally through FastEmbed on ONNX Runtime. Nothing about how answers are retrieved requires an external service.

Four deployment postures, one code base. Compare deployment options →

Inside your network

  • postgresql / pgvector
  • bm25 · vector · graph traversal
  • fastembed · onnx runtime embeddings
  • test retrieval · traces

managed · on-premises · air-gapped

Cloud

Arc53 operates the database and embedding service; retrieval runs in Arc53's cloud.

Air-gapped

Identical retrieval on your own PostgreSQL/pgvector with local embeddings and a local LLM, hybrid and GraphRAG included, with no external network.

Example

2.5M+ pages · 6 languages

Multilingual EU-law research over 2.5M+ pages, answers in 6 EU languages with full source citations, 100–200 ms retrieval.

Source: LexEU

Next: how documents get in · embeddings and vector stores · legal research with citations · compare with Glean · deployment options · pricing

Frequently asked questions

How does RAG reduce hallucinations?

The model answers from passages retrieved from your documents and cites them, so anyone can open the exact passage behind an answer. It is instructed to say when the documents do not cover a question rather than guess, and Test retrieval lets you check what a question finds before people rely on it.

What is GraphRAG?

GraphRAG is retrieval over a graph of entities and relationships extracted from documents, so a question can follow links across many documents instead of matching one passage. DocsGPT builds that graph with an LLM pass over the source, when it is added or later, and traverses it with Personalized PageRank for multi-hop questions.

Can I turn GraphRAG on for a source I have already added?

Yes. The graph is built over the whole source, and the run can be resumed if it is interrupted. DocsGPT shows an estimate of the work before it starts, and until the graph exists the source keeps answering through classic retrieval.

What is hybrid search in RAG?

Hybrid search combines BM25 keyword matching with vector similarity, so exact terms, codes and names are found even when their embedding is weak. In DocsGPT it is a per-source setting.

Does hybrid search need a special database?

Yes: hybrid and GraphRAG run on pgvector (PostgreSQL). Classic retrieval works on any supported vector store.

Can one question search all my sources?

Yes. An agent searches every knowledge source it uses with one question and returns one answer, with each citation pointing back to its own document.

See DocsGPT on your documents

A 30-minute demo on your use case, or a free on-premises review with an engineer.