Graph databases

Choose and configure an OpenCypher-compatible graph database when self-hosting ctx|.

When self-hosting this service, you need to configure an OpenCypher-compatible graph database for knowledge graphs, RAG, and related workloads. This guide helps you choose and configure one of the supported engines.

Quick Start (FalkorDB)

The easiest way to get started is FalkorDB, which is included as a Docker container in the default stack. No extra setup required—just run:

docker compose --profile deploy up -d

The backend connects to FalkorDB via the native driver at redis://falkordb:6379 by default. For host-based deployments, point GRAPH_DB_URI at your FalkorDB instance (e.g. redis://localhost:6379) or you can use any OpenCypher compatible database via Bolt driver.

Supported Engines

You can use any of these OpenCypher-compatible engines. FalkorDB uses its native driver (Redis protocol); others use Bolt.

EngineBest forNotes
FalkorDBEasy start, multi-tenant SaaSOpen-source. Included in Docker Compose. Graphs auto-create.
Neo4j EnterpriseEnterprise multi-tenantRequires CREATE DATABASE per org (admin).
Neo4j CommunityCost-conscious multi-tenantOne database per instance. Use instance-per-tenant.
MemgraphEnterprise, real-timeEnterprise edition for multi-database.
NeptuneAWS-hostedManaged service. Single graph per cluster.

Set GRAPH_DB_PROVIDER to match your engine. Tenancy mode is inferred automatically.

Environment Variables

VariableRequiredDefaultDescription
GRAPH_DB_URINoredis://falkordb:6379FalkorDB: redis://host:6379. Others: Bolt URI (e.g. bolt://host:7687).
GRAPH_DB_USERNodefault / neo4jUsername for auth.
GRAPH_DB_PASSWORDNo""Password for auth.
GRAPH_DB_PROVIDERNofalkordbEngine: falkordb, neo4j-enterprise, neo4j-community, memgraph, neptune.
GRAPH_DB_URI_<orgSlug>Yes (instance-per-tenant)Per-org URI. Required when using Neo4j Community or Neptune. No fallback to GRAPH_DB_URI.

Example (FalkorDB, Docker network):

GRAPH_DB_URI=redis://falkordb:6379
GRAPH_DB_PROVIDER=falkordb

Example (Neo4j Community, instance-per-tenant, org slugs acme, piedpiper):

GRAPH_DB_URI=bolt://neo4j.example.com:7687
GRAPH_DB_URI_acme=bolt://neo4j-acme.example.com:7687
GRAPH_DB_URI_piedpiper=bolt://neo4j-piedpiper.example.com:7687
GRAPH_DB_USER=neo4j
GRAPH_DB_PASSWORD=yourpassword
GRAPH_DB_PROVIDER=neo4j-community

Example (Neptune):

GRAPH_DB_URI=bolt://your-cluster.region.neptune.amazonaws.com:8182
GRAPH_DB_PROVIDER=neptune

Tenancy Modes

All setups are multi-tenant: each organisation’s graph data must be isolated from others. The service infers the tenancy strategy based on provider defined in GRAPH_DB_PROVIDER.

Database-per-tenant (shared instance)

Providers: FalkorDB, Neo4j Enterprise, Memgraph

These engines support multiple graphs or databases within a single instance, with strong isolation between them. One shared instance serves many orgs; each org gets its own graph/database (e.g. org_abc123). The service passes the org’s database name when executing queries, so data stays isolated at the database layer.

Instance-per-tenant (separate instance per org)

Providers: Neo4j Community, Neptune

Neo4j Community and Neptune do not support multiple databases or graphs within a single instance—each instance has one logical graph. To achieve per-org isolation, the service uses instance-per-tenant: each org must have its own database instance. Queries are routed to the correct instance based on the org, so isolation is enforced by the deployment topology rather than by the database engine.

Set GRAPH_DB_URI_<orgSlug> for each org (e.g. GRAPH_DB_URI_acme, GRAPH_DB_URI_piedpiper). There is no fallback to GRAPH_DB_URI—each org must have its own URI configured.

Engine-Specific Setup

FalkorDB

  • Docker: falkordb/falkordb:latest. Uses Redis protocol on port 6379 by default.
  • URI: redis://host:6379 (native driver, recommended for production).
  • User: default
  • Password: Empty by default. With Redis --requirepass, use that password.

Neo4j

  • URI: bolt://host:7687
  • User: neo4j
  • Password: Set via GRAPH_DB_PASSWORD or NEO4J_AUTH (Docker).

Memgraph

  • URI: bolt://host:7687
  • User: Typically memgraph or as per your deployment.
  • Enterprise: Use memgraph provider for database-per-tenant.

Neptune

  • URI: Your cluster’s Bolt endpoint (e.g. bolt://cluster.region.neptune.amazonaws.com:8182).
  • Auth: IAM or standard auth per your cluster config. See AWS Neptune docs.