Skip to main content
Kuzu is an embedded graph database designed for fast analytical queries, offering an in-process alternative to client-server databases like Neo4j.

Installation

Install Graphiti with Kuzu support:

Configuration

Database Location

Kuzu can run in-memory or persist to disk:

Concurrency Control

Control the number of concurrent queries:

Driver Implementation

The KuzuDriver (graphiti_core/driver/kuzu_driver.py:135) provides:
  • Embedded Architecture: Runs in-process, no separate server needed
  • Schema Enforcement: Explicit schema defined at startup
  • Fast Analytics: Optimized for analytical graph queries
  • DuckDB Integration: Built on DuckDB’s columnar storage

Connection Parameters

Schema Definition

Kuzu requires an explicit schema. Graphiti defines the following node and relationship types:

Node Tables

  • Episodic: Episode nodes with content and metadata
  • Entity: Entity nodes with embeddings and summaries
  • Community: Community nodes for entity groupings
  • RelatesToNode_: Edge representation as nodes (workaround for Kuzu limitations)
  • Saga: Saga nodes for episode sequencing

Relationship Tables

  • RELATES_TO: Entity relationships
  • MENTIONS: Episodic to Entity connections
  • HAS_MEMBER: Community membership
  • HAS_EPISODE: Saga to Episode connections
  • NEXT_EPISODE: Episode sequencing
The schema is automatically created during driver initialization (graphiti_core/driver/kuzu_driver.py:54).

Edge Representation

Kuzu currently doesn’t support fulltext indexes on edge properties. Graphiti works around this by representing RELATES_TO edges as intermediate nodes:
This allows fulltext search on relationship facts while maintaining query compatibility.

Complete Example

When to Use Kuzu

Choose Kuzu if you:
  • Need an embedded database (no separate server)
  • Want fast analytical queries over large graphs
  • Prefer simpler deployment (single process)
  • Are building desktop or edge applications
  • Need DuckDB-compatible analytics
Choose Neo4j/FalkorDB if you:
  • Need client-server architecture
  • Require production-ready clustering
  • Want extensive ecosystem support
  • Need dynamic schema updates

Performance Characteristics

  • Write Performance: Optimized for batch writes
  • Read Performance: Excellent for analytical queries and graph traversals
  • Storage: Columnar storage for efficient compression
  • Memory: Lower memory footprint than in-memory databases

Index Management

Kuzu’s schema-based approach means indices are defined during schema creation. The build_indices_and_constraints() method is a no-op for Kuzu, as indices are built automatically from the schema.

Production Considerations

  • Database Path: Use absolute paths for persistent databases
  • Concurrency: Tune max_concurrent_queries based on workload
  • Backups: Copy the database directory for backups
  • Version Compatibility: Kuzu is under active development; test version upgrades carefully
  • Schema Changes: Require database recreation (no dynamic schema evolution)