Docs and articles

R-70

Technology

Tessera DB Tutorial: Build a GraphRAG Retrieval System End to End

Ingest documents, auto-embed them, run hybrid vector + keyword + graph retrieval fused with Reciprocal Rank Fusion, and assemble LLM context with provenance — all in one engine.

PAR2 Labs

August 29, 2026

6 min

Tessera DB Tutorial: Build a GraphRAG Retrieval System End to End

This tutorial builds a working GraphRAG retrieval pipeline. By the end you'll have a document store with semantic, keyword, and graph search, fused into a single ranked result list with provenance, ready to feed an LLM prompt.

01

Before you start

Tier

01

Hybrid retrieval (fusing vector and keyword search) is available in Community. The deeper GraphRAG path — adding graph proximity and lineage-backed provenance — is an Enterprise capability.

02

What we're building

A small policy-document retrieval system. Each document references other documents (a "see also" graph). A query against this system returns the most relevant documents using three signals:

Vector similarity — semantic match on document text.

Keyword relevance (BM25) — exact-term anchors.

Graph proximity — documents linked to highly-ranked hits.

03

What we're building — fusing the signals

We fuse all three with Reciprocal Rank Fusion, so a document strong in any signal rises to the top — no score normalisation needed.

04

Step 1: Configure an embedder

Point Tessera at an embedding provider — a hosted model or a local one. From then on, any document you insert has its text embedded automatically. For quick local testing you can start with a deterministic stand-in embedder and swap in a real model before you care about retrieval quality.

05

Step 2: Ingest documents

Insert each policy document as an entity with a title and body. The body text triggers auto-embedding on insert, and it's indexed for keyword search at the same time. No separate vector pipeline and no separate search service did any of this.

The graph dimension other RAG systems lack is here because Tessera was tracking it anyway.

06

Step 3: Add 'see also' links as graph facts

A "see also" relationship is its own fact connecting a source document to a target document. Adding these lights up the graph dimension automatically: a traversal from any document walks its see-also network. Model the links you know — wire-transfer policy to sanctions policy, sanctions policy to suspicious-activity reporting, and so on.

cypher

// Walk two hops out from one document along the see-also graph
MATCH (d:PolicyDoc {doc_id: 'POL-001'})-[:SeeAlso*1..2]-(related:PolicyDoc)
RETURN DISTINCT related.doc_id, related.title

07

Step 4: Run a hybrid query

Take a vague, natural-language question — "what do we need to do for a large transfer to a foreign account?" — and run it through the pipeline. Tessera embeds the question the same way it embedded the documents, scores keyword relevance, walks the see-also graph out from the strongest hits, and fuses the three rankings into one list.

The document about wire-transfer limits ranks first (semantic and keyword hit); the sanctions-screening policy follows because it's graph-proximal to it and shares keywords; related policies surface through their graph links even when their wording doesn't match the question.

08

Step 5: Tune the weights

The fusion is weighted, and sensible defaults lean on semantics first, then keywords, then graph proximity. Shift the balance to fit your corpus:

Highly technical corpora — lean harder on keywords; exact matches (drug names, error codes) matter more than paraphrase.

Conversational corpora — lean on semantics; users paraphrase what's actually written.

Densely-linked corpora — lean on graph proximity; a document's neighbours are usually highly relevant.

09

Step 6: Assemble LLM context with provenance

Feed the ranked results into your prompt. Because every retrieved fact is traceable to its source through native lineage, the context you build isn't just relevant passages — it's passages your AI can cite. A graph-aware assembly can also include each hit's top neighbours, giving the model contextual stitching pure vector retrieval can't provide.

10

What you have now

A working RAG pipeline that combines three retrieval signals over the same store — no separate vector database, no separate search service, no sync between them — and every answer traceable to the facts that produced it. The graph dimension other RAG systems lack is here because Tessera was tracking it anyway.

Key Takeaways

01

Configured an embedder so every inserted document is embedded and keyword-indexed on write.

02

Modelled "see also" links as graph facts and walked them with Cypher.

03

Run a hybrid query that fuses vector, keyword and graph rankings with Reciprocal Rank Fusion, and tuned the weights for your corpus.

04

Assembled LLM context from results that trace back to their sources through lineage.


PAR2 Labs · Technology

Talk to us

One copy of the data, five ways to read it.