Graph RAG

Next-generation Retrieval Augmented Generation combining knowledge graphs, vector embeddings, full-text search, and temporal context — all in a single database query.

Vector-Only RAG Is Hitting a Wall

Retrieval Augmented Generation transformed how LLMs access knowledge. But the first generation of RAG — chunk documents, embed them, retrieve by cosine similarity — has fundamental limitations. When you treat documents as isolated vectors, you lose the structure: the relationships between entities, the hierarchy of concepts, the temporal evolution of facts.

The result: hallucinations, incomplete answers, and an inability to reason across connected information. Ask a vector-only system "Which researchers at Stanford published papers on the technique used by the company that acquired our competitor?" and it falls apart — that's a 4-hop graph traversal, not a similarity search.

Research consistently shows 20-35% improvement in retrieval precision and up to 65% reduction in hallucinations when knowledge graph context supplements vector similarity. Cedars-Sinai's ESCARGOT system achieved 94.2% accuracy on multi-hop medical reasoning versus 49.9% with standard RAG — nearly doubling performance by adding graph structure.

The industry has a name for this: Graph RAG. But most implementations require stitching together 3-5 separate databases plus ETL pipelines. ArcadeDB handles the entire pipeline in a single engine.

Where Vector-Only RAG Falls Short

  • No relationship awareness: Can't traverse entity connections between documents
  • Single-hop only: Unable to perform multi-hop reasoning through entity networks
  • Flat retrieval: Treats all text as isolated vectors without semantic organization
  • No temporal context: Can't answer "what changed since last quarter?"
  • Infrastructure sprawl: Separate vector DB + graph DB + search engine + sync pipelines
  • Stale context: ETL delays mean the LLM reasons over outdated data

How Graph RAG Connects the Dots

User Query Vector Search Full-Text Search Graph Traversal Doc Chunk A Doc Chunk B Person Alice Concept RAG works_at Org Acme Keyword Exact Match ArcadeDB Enriched Context → LLM → Answer Single query, single database

One Database for the Entire RAG Pipeline

Graph RAG enhances traditional vector retrieval by adding structured knowledge graph context. Instead of retrieving isolated chunks, you retrieve chunks and their connected entities, relationships, and community structure — giving the LLM far richer context for reasoning.

ArcadeDB is the only database that handles the entire Graph RAG pipeline natively in a single engine:

  • Vector search (JVector): DiskANN + HNSW hybrid with SIMD acceleration, powered by the same engine behind DataStax Astra DB
  • Graph traversal: Multi-hop reasoning through knowledge graph relationships in constant time per hop
  • Full-text search: Keyword matching, fuzzy search, and entity name resolution alongside semantic search
  • Document storage: Raw chunks, metadata, and embeddings as first-class objects
  • Time-series context: Track when facts were added, modified, or superseded — unique to ArcadeDB

No ETL pipelines between systems. No synchronization delays. No consistency gaps. One query, one database, one result.

Building the Knowledge Graph

Every Graph RAG system starts with knowledge graph construction. The pipeline: chunk your documents, generate embeddings via an LLM, extract entities and relationships, and store everything in the database. Neo4j, Memgraph, and ArangoDB all offer this — but each requires separate systems for vectors, full-text, or documents.

With ArcadeDB, the entire knowledge model — document chunks with embeddings, entity vertices, relationship edges, and full-text indexes — lives in a single transactional database. New documents are searchable across all models immediately. No batch reindexing, no sync pipelines.

  • Document chunks with vector embeddings indexed via JVector
  • Entity vertices (Person, Concept, Organization) with typed relationships
  • MENTIONS edges linking chunks to the entities they reference
  • Full-text indexes on entity names and chunk content
  • Timestamps on every record for temporal-aware retrieval

Define the Knowledge Graph Schema

-- Document chunks with embeddings
CREATE DOCUMENT TYPE Chunk;
CREATE PROPERTY Chunk.content STRING;
CREATE PROPERTY Chunk.source STRING;
CREATE PROPERTY Chunk.embedding
  VECTOR(1536);
CREATE VECTOR INDEX ON Chunk(embedding)
  LSM TYPE COSINE;

-- Knowledge graph entities
CREATE VERTEX TYPE Entity;
CREATE VERTEX TYPE Person EXTENDS Entity;
CREATE VERTEX TYPE Concept EXTENDS Entity;
CREATE VERTEX TYPE Organization
  EXTENDS Entity;

-- Semantic relationships
CREATE EDGE TYPE MENTIONS;
CREATE EDGE TYPE RELATES_TO;
CREATE EDGE TYPE WORKS_AT;
CREATE EDGE TYPE AUTHORED;

Hybrid Vector + Graph Retrieval

Find semantically similar chunks, then enrich with entity context through graph traversal — in one query:

-- Step 1: Vector search for relevant chunks
MATCH (chunk:Chunk)
WHERE chunk.embedding.cosineDistance(
  $queryVector) < 0.4

-- Step 2: Graph traversal for entities
OPTIONAL MATCH
  (chunk)-[:MENTIONS]->(entity:Entity)

-- Step 3: Multi-hop for related chunks
OPTIONAL MATCH
  (entity)<-[:MENTIONS]-(related:Chunk)
WHERE related <> chunk

RETURN chunk.content,
  chunk.source,
  chunk.embedding.cosineDistance(
    $queryVector) AS score,
  collect(DISTINCT entity.name)
    AS entities,
  collect(DISTINCT related.content)
    AS related_context
ORDER BY score ASC
LIMIT 10

One query returns: similar chunks + their entities + related chunks through shared entities — all the context an LLM needs.

Hybrid Retrieval: Best of Both Worlds

The power of Graph RAG lies in combining two complementary retrieval strategies. Vector search finds semantically similar content — great for "what does this mean?" questions. Graph traversal finds structurally connected content — essential for "how is this related to that?" questions.

In ArcadeDB, these aren't separate systems with a merge layer in between. They're a single Cypher query that executes in the same transaction, on the same data, with results composed at the database level — not in application code.

The query on the left demonstrates hybrid retrieval: it starts with vector similarity to find relevant document chunks, then enriches each chunk with entities discovered through graph traversal, and finally finds related chunks that share entities with the original results (multi-hop). The LLM receives not just similar text, but structured context about what entities appear, how they're connected, and what other documents discuss the same entities.

Industry benchmarks show hybrid retrieval improves accuracy by 15-25% on domain-specific corpora compared to vector-only or keyword-only approaches.

Multi-Hop Reasoning: Following the Chain

The most valuable questions require connecting information across multiple documents. "Which researchers at Stanford have published papers on the technique used by the company that acquired our competitor?" requires traversing 4+ hops through the knowledge graph. Vector search alone cannot answer this.

ArcadeDB's graph engine makes multi-hop reasoning a first-class operation. Each hop takes constant time regardless of database size — O(1) per hop. A 5-hop traversal across 10 million entities completes in milliseconds.

  • Entity-bridge retrieval: Find documents connected through shared entities even when they have low vector similarity
  • Community detection: Discover clusters of related entities for global summarization
  • Path explanation: Return the exact traversal path so the LLM can explain how information is connected
  • Depth control: Adjust traversal depth per query — shallow for speed, deep for thoroughness

Multi-Hop Entity-Bridge Query

-- Find documents connected through
-- entity chains (multi-hop)
MATCH (direct:Chunk)
WHERE direct.embedding
  .cosineDistance($queryVector) < 0.4

-- Bridge through shared entities
MATCH (direct)-[:MENTIONS]->
  (entity:Entity)<-[:MENTIONS]-
  (related:Chunk)
WHERE related <> direct

RETURN
  direct.content AS source,
  entity.name AS bridge,
  entity.@class AS entity_type,
  related.content AS connected,
  related.source AS connected_doc
LIMIT 20

Discovers documents you'd never find through vector similarity — because they share an entity, not vocabulary.

Agentic RAG: One Connection, All Models

// Agent step 1: vector search
MATCH (c:Chunk)
WHERE c.embedding
  .cosineDistance($q) < 0.35
RETURN c.content, c.source
LIMIT 5

// Agent step 2: graph expansion
MATCH (c:Chunk {source: $found})
  -[:MENTIONS]->(e:Entity)
  -[:RELATES_TO]->(related)
RETURN related.name, related.@class

// Agent step 3: full-text lookup
SELECT FROM Chunk
WHERE content CONTAINSTEXT
  $entityName

// Agent step 4: temporal check
SELECT content, indexed_at
FROM Chunk
WHERE source = $doc
ORDER BY indexed_at DESC
LIMIT 1

Same connection — Cypher for graphs, SQL for analytics. The agent picks the right tool for each reasoning step.

Agentic RAG: AI Agents That Think and Retrieve

RAG is evolving from static "retrieve-and-respond" pipelines to Agentic RAG — AI agents that plan reasoning steps, dynamically choose retrieval strategies, and iteratively refine context. 57% of organizations are now deploying agents for multi-stage workflows.

An agent might start with a vector search, discover an entity, traverse the graph to find related documents, run a full-text search for a specific term, then check time-series data to see how a metric changed. With separate databases, each step requires a different connection, query language, and data format.

With ArcadeDB, the agent uses one connection and one query language. Cypher for graph patterns, SQL for analytics and full-text, and both can access vectors — all in the same session. This dramatically simplifies agent tool definitions and reduces latency per reasoning step.

ArcadeDB is compatible with LangChain, LlamaIndex, and other agent frameworks through its HTTP API, Postgres wire protocol, and JDBC driver.

Temporal Context: When Facts Change

Knowledge isn't static. Policies get updated, products evolve, organizational structures change, research is superseded. A RAG system that can't distinguish current from outdated information will confidently present stale facts as truth.

ArcadeDB's native time-series capabilities add a temporal dimension that no other Graph RAG platform offers:

  • Recency filtering: Retrieve only chunks indexed after a specific date
  • Version tracking: Both old and new versions stored — the LLM can see how information changed
  • Temporal aggregation: time_bucket() shows how often a topic was mentioned over time
  • Freshness scoring: Weight more recent chunks higher in retrieval ranking
  • Change detection: Alert when entity relationships change significantly

For enterprise RAG dealing with compliance documents, product specs, or policy manuals, temporal awareness isn't a nice-to-have — it's essential for avoiding costly mistakes.

Temporal-Aware Retrieval

-- Only retrieve current chunks
MATCH (c:Chunk)
WHERE c.embedding.cosineDistance(
  $queryVector) < 0.4
  AND c.indexed_at > '2025-01-01'
RETURN c.content, c.source
ORDER BY c.indexed_at DESC
LIMIT 10

-- Track concept evolution over time
SELECT
  time_bucket('1M', c.indexed_at)
    AS month,
  count(*) AS mentions,
  last(c.content) AS latest
FROM Chunk c
JOIN MENTIONS m ON c = m.out
WHERE m.in.name = 'GraphRAG'
GROUP BY month
ORDER BY month

Triple Hybrid: Vector + Graph + Full-Text

-- Combine all three retrieval modes
SELECT
  content, source,
  embedding.cosineDistance($q)
    AS vector_score,
  SEARCH_INDEX(content, $keyword)
    AS text_score,
  out('MENTIONS').size()
    AS entity_count,
  -- Weighted composite score
  (0.5 * (1 - vector_score)
   + 0.3 * text_score
   + 0.2 * entity_count / 10)
    AS composite_rank
FROM Chunk
WHERE embedding.cosineDistance($q) < 0.5
  OR content CONTAINSTEXT $keyword
ORDER BY composite_rank DESC
LIMIT 10

Full-Text Search: Precision When Semantics Aren't Enough

Vector search excels at semantic similarity but struggles with exact matches. "What does section 4.2.1 of the compliance manual say?" — semantic search returns chunks about compliance in general. Full-text search finds the exact section.

ArcadeDB's built-in full-text search engine complements vector retrieval:

  • Keyword + semantic: Combine CONTAINSTEXT with vector distance in the same query
  • Entity name matching: Instant lookup by name, abbreviation, or synonym
  • Fuzzy matching: Find "Retrieval Augmented Generation" even when the user types "retreival augmented gen"
  • Composite scoring: Weight vector, full-text, and entity-count signals for optimal retrieval

The combination of vector similarity (semantic), full-text (keyword), and graph traversal (structural) creates a retrieval system that handles every type of question — vague exploratory queries, precise factual lookups, and complex relational questions.

Graph RAG Applications

Enterprise Knowledge Base

Internal documentation, policies, and tribal knowledge made searchable through graph-connected retrieval. Agents answer employee questions with traced, verifiable sources.

Legal & Compliance

Regulations, case law, and contracts interlinked through entity graphs. Multi-hop traversal reveals how regulatory changes cascade across related documents and obligations.

Healthcare & Biomedical

Medical literature, drug interactions, and clinical guidelines linked through biomedical ontologies. Cedars-Sinai achieved 94.2% accuracy on multi-hop medical reasoning with Graph RAG.

Customer Support AI

Product docs, support tickets, and KB articles connected through product entities. Agents resolve tickets using the full relationship context of the customer's situation.

Scientific Research

Papers, authors, institutions, and methods connected in a research knowledge graph. Discover related work through author networks, shared methodologies, and citation chains.

Financial Intelligence

Earnings reports, SEC filings, and news connected through company and executive entity graphs. Temporal context tracks how financial narratives evolve quarter over quarter.

Platform Comparison for Graph RAG

Capability Neo4j Memgraph ArangoDB ArcadeDB
Native graph
Vector search Bolt-on New (3.0) Basic JVector
Full-text search Basic Built-in
Document store
Time-series
Cypher support AQL only
SQL support AQL only
ETL needed Yes (ext. vector) Yes Partial None
License AGPL BSL SSPL Apache 2.0

Why ArcadeDB for Graph RAG

Neo4j pioneered Graph RAG but requires external vector databases (Pinecone, Weaviate) for production-grade search. Memgraph added vector search only in v3.0. ArangoDB uses a proprietary query language (AQL). TigerGraph uses GSQL and has no native full-text search.

ArcadeDB is the only platform that delivers the complete Graph RAG stack in a single engine:

  • Zero data movement: No ETL pipelines, no sync delays, no consistency gaps
  • Single-query retrieval: Vector similarity + graph traversal + full-text matching in one Cypher/SQL statement
  • Real-time indexing: New documents immediately searchable across all models
  • Standard languages: Cypher, SQL, Gremlin — not a proprietary language
  • Lower cost: One system instead of five, with no commercial license fees

Apache 2.0 — Forever

RAG systems are becoming the backbone of enterprise AI. You need to trust that the database powering them won't change its licensing terms. Neo4j is AGPL. Memgraph is BSL. ArangoDB switched from Apache 2.0 to SSPL. ArcadeDB is Apache 2.0 forever — no bait-and-switch, no source-available restrictions. Deploy it anywhere, embed it in your product, fork it if you want.

Production Success Story

"We migrated our RAG system from a separate vector database + Elasticsearch setup to ArcadeDB. The ability to combine document vectors with entity relationships in a single query transformed our AI assistant's accuracy. Our LLM can now reason about how documents relate through shared entities, dramatically reducing nonsensical answers. We've consolidated 4 database systems into 1, cutting infrastructure costs by 70% while achieving better results."

— Chief Data Officer, Enterprise AI Company
(Details limited by confidentiality agreement)

Results Achieved:

  • 92% improvement in answer accuracy vs. vector-only RAG
  • 65% reduction in hallucinations through graph context
  • Sub-50ms query latency for hybrid retrieval (10M documents)
  • 4 database systems consolidated into 1
  • 70% reduction in infrastructure costs

Industries Using Graph RAG

  • Enterprise AI: Internal knowledge assistants, document Q&A, process automation
  • Legal & Compliance: Contract analysis, regulatory tracking, case research
  • Healthcare: Clinical decision support, drug discovery, medical literature review
  • Financial Services: Research analysis, risk assessment, compliance monitoring
  • Education: Intelligent tutoring, curriculum-aware Q&A, research assistants
  • Customer Support: Context-aware ticket resolution, product knowledge agents

Ready to Build Graph RAG Applications?

Start building advanced RAG systems today with ArcadeDB. Combine knowledge graphs, vector search, full-text matching, and temporal context in a single unified database. No infrastructure sprawl — just intelligent retrieval.