TrustGraph
key conceptsbeginner

What is a Context Backend?

A context backend manages, stores, and retrieves the structured knowledge that AI agents use to answer questions reliably. Learn how TrustGraph compares to Supabase as a context backend—and why zero third-party dependencies changes the equation.

7 min read
Updated 3/12/2026
Daniel Davis
#context graph#context graphs#context-backend#trustgraph#supabase#knowledge-graphs#ai-agents#self-hosted#no-api-keys

Every AI application that answers questions from your data needs a place to put that data and a mechanism to retrieve it intelligently. That infrastructure layer is the context backend.

The term is gaining traction—Foundation Capital describes it as a core component of the context graph stack—but it is often conflated with simpler concepts like a vector store or a database. A vector store is one component of a context backend. A context backend is the full system.

This guide explains what a context backend actually does, how different tools compare, and why TrustGraph was built from first principles to solve this problem without third-party dependencies.

The Problem a Context Backend Solves

Large language models have a knowledge cutoff and a context window. They do not know your internal data, your customers, your products, or events after their training date. To answer reliably, they need context—structured, relevant, verifiable information injected into the prompt at inference time.

The naive solution is to paste text chunks into the prompt. This is what early RAG (Retrieval-Augmented Generation) did: split documents into chunks, embed them as vectors, retrieve the top-k by cosine similarity, and stuff them into the context window. It works for simple factual lookups. It fails for:

  • Multi-hop reasoning: "Which of our customers are affected by this supplier's delivery problem?" requires traversing relationships, not matching text.
  • Temporal reasoning: "Is this information still accurate?" requires tracking when facts were established and whether they have changed.
  • Precision at scale: Semantic similarity retrieves approximately relevant chunks. Ontology-constrained graph retrieval retrieves exactly the right entities.
  • Auditability: "Where did this answer come from?" is not answerable from a vector index.

A context backend addresses all of these. It manages a persistent knowledge store, extracts structured context on demand, and delivers it to the LLM in a format that grounds responses in verifiable facts.

What a Context Backend Must Do

A complete context backend handles four responsibilities:

ResponsibilityWhat it means
IngestionProcess raw documents, databases, and APIs into structured knowledge
StoragePersist entities, relationships, and metadata in queryable form
RetrievalExtract query-relevant context efficiently at inference time
DeliveryFormat context for LLM consumption (token-efficient, ranked, grounded)

Vector stores handle one dimension of storage and retrieval. A full context backend handles all four.

TrustGraph as a Context Backend

TrustGraph was built to be a purpose-built context backend. It has been open source for over eighteen months and has users running knowledge graphs at billion-node scale.

Architecture

TrustGraph runs as a set of containerized services:

docker compose up -d

# Services started:
# ✓ pulsar           — message bus
# ✓ graph-store      — Apache Cassandra triplestore
# ✓ vector-store     — embeddings (Qdrant or Pinecone)
# ✓ agent-manager    — LLM orchestration
# ✓ workbench        — UI at localhost:8888

Every component runs in your environment. There are no required external API calls, no SaaS accounts, no data leaving your infrastructure unless you configure an external LLM endpoint.

No Third-Party Dependencies

This is the most operationally significant property of TrustGraph. Most AI frameworks—LangChain, LlamaIndex, and others—are coordination layers that call external services. Using them typically requires:

  • An OpenAI, Anthropic, or Google API key
  • A vector database SaaS account (Pinecone, Weaviate, etc.)
  • A managed embedding service
  • Often: a managed database tier

TrustGraph requires none of these. You bring:

  • An LLM: Any supported provider, or vLLM, TGI, Ollama, LM Studio, or Llamafiles for fully local inference
  • Your data: Documents, structured databases, or API feeds

TrustGraph handles everything else internally. For air-gapped environments, regulated industries, or organizations with strict data residency requirements, this is not a convenience feature—it is a requirement.

Knowledge Graph + Vector Store, Unified as a Context Graph

TrustGraph maintains two complementary stores that work together:

  1. Custom Multi-model store (Cassandra): Entities and relationships as RDF triples. Supports multi-hop traversal, ontology-constrained queries, and temporal metadata in addition to row/columnar data.

  2. Vector store (Qdrant): Dense vector embeddings for semantic similarity search.

At retrieval time, TrustGraph combines both: vector search identifies candidate entities, graph traversal enriches them with relationships and provenance, and the resulting context graph is delivered to the LLM.

TrustGraph vs. Supabase: A Direct Comparison

Supabase is a widely used open-source application backend built on PostgreSQL. It supports authentication, real-time subscriptions, storage, and—via the pgvector extension—basic vector similarity search. Many developers reach for it when building AI features because it is familiar and fast to set up.

Here is where the tools diverge:

CapabilityTrustGraphSupabase
Primary purposeAI context backendGeneral application backend
Data modelKnowledge graph (RDF triples)Relational (PostgreSQL tables)
Vector searchYes (Qdrant / Pinecone)Yes (pgvector)
Relationship traversalMulti-hop graph traversalSQL joins (no native graph)
Ontology supportOWL ontologies for semantic precisionNone
Provenance trackingPer-triple source and confidenceNot built-in
Temporal contextNative temporal metadataManual schema design required
LLM integrationBuilt-in agent manager and flowsExternal (you wire it yourself)
Third-party API keysNone requiredNone required
Self-hostedYes (Docker / Kubernetes)Yes (Docker)
Air-gapped deploymentYes (with Ollama)Requires external LLM integration
Document ingestion pipelineBuilt-in (GraphRAG, Ontology RAG)Not included
Open sourceYes (Apache-licensed components)Yes (Apache 2.0)

When Supabase Makes Sense

Supabase is the right choice when you need a general application backend with light AI features. If your use case is "store user data and do occasional semantic search on some text," Supabase with pgvector is straightforward and well-documented.

Supabase is also a reasonable starting point if your team is already familiar with PostgreSQL and your AI feature is not a core product function.

When TrustGraph Makes Sense

TrustGraph is the right choice when:

  • Your AI system needs to reason across relationships, not just retrieve similar text
  • Data privacy and residency matter: no data leaves your infrastructure
  • You are building for a domain with complex ontologies (healthcare, legal, financial, security)
  • You need provenance: your users or compliance team needs to know where answers came from
  • You are operating at scale: billion-node graphs are a validated capability
  • You want a complete pipeline, not a database you assemble a pipeline around

The No-API-Key Advantage

Most AI infrastructure articles treat API key management as a footnote. It is not. Consider what API keys imply:

  • Data leaves your environment every time an API is called
  • Cost is variable and external: a traffic spike means an unexpected invoice
  • Availability depends on third-party uptime: if OpenAI has an outage, so do you
  • Compliance scope expands: each external service is a data processor you must account for

TrustGraph eliminates this exposure for the storage and retrieval layer entirely. You may still call an external LLM provider for inference (or use Ollama locally), but the knowledge graph, vector index, and retrieval logic are entirely self-contained.

For enterprise and government use cases, this is often the deciding factor.

Getting Started

The fastest path to a running context backend is the TrustGraph configuration builder:

npx @trustgraph/config
# → Select your LLM provider (or Ollama for local)
# → Select deployment target (Docker / Kubernetes)
# → Generates docker-compose.yaml and INSTALLATION.md

docker compose up -d
# → 6 services healthy in under 2 minutes

The workbench at localhost:8888 provides a UI for loading documents, querying the graph, and testing agent responses.

Watch: What Is a Context Graph?

Understanding what a context backend delivers requires understanding what a context graph is. Watch this overview:

What is a Context Graph?

Related Guides

Resources