GestaltDB Documentation
GestaltDB is a pure Python graph database toolkit for attributed graphs. It stores nodes, edges, labels, typed adjacency records, and indexes on embedded key-value backends such as LMDB, LevelDB, and RocksDB/PyRex.
Start with the quickstart if you want to create a graph and run a query. Use the topic pages for backend selection, serializers, Cypher syntax, ingestion, sampling, and benchmarks.
User Guide
- Installation
- Quickstart
- Storage Backends
- Serializers
- Compatibility, Migration, and Recovery
- Temporal Version History
- Assertions, Corrections, and Retractions
- Atomic Logical Batches
- As-Of Resolution and Traversal
- Consistent Read Views
- End-to-End Temporal Knowledge Workflow
- Index Maintenance
- Migrating
TimeIndexedEdge - Epistemic Claims and Provenance
- Positive Horn Rules
- Incremental Truth Maintenance and Explanations
- Current Limits
- Bounded Modal and Epistemic Evaluation
- Typed Traversal and Sampling
- Cypher Queries
- Basic Result Shape
- Node Scans
- Typed Relationship Traversal
- Bitemporal Matches
- Writes
- Node Constraints
- Filtering
- Extended Expressions
- Scalar Functions
- Temporal Values
- Projection and Result Shaping
- Chained MATCH Clauses
- WITH and Variable Scope
- OPTIONAL MATCH
- UNWIND
- UNION
- CALL Subqueries
- Registered Procedures
- Aggregation and Implicit Grouping
- Current Limitations
- Visualization
- Performance and Benchmarks
- Practical Recommendations
- Install Benchmark Dependencies
- Backend Benchmarks
- Columnar Ingestion Benchmarks
- Structured JSON Entity Ingestion
- End-to-End Ingestion Insights
- Transaction-Capable RocksDB Benchmark
- RocksDB Tuning and Compaction Benchmarks
- External Graph Database Benchmarks
- Benchmark Caveats
- Notebook Usage
API Reference
- API Reference
- Graph Models and Database
- Temporal Semantics
- Temporal Version History
- Epistemic Claims
- Positive Horn Rules
- Modal Evaluation
- Consistent Read Views
- Sampling Configuration
- Sampling Engine
- Sampling Snapshots
- Sampled Batches
- Sampling Negatives
- Sampling Feeders
- Columnar Ingestion
- Cypher Queries
- Key-Value Stores
- Serializers
- Visualization IR
- Visualization Artifacts and API
Quick Example
from gestaltdb.graphdb import Edge, GraphDB, Node
from gestaltdb.kvstores import LMDBStore
from gestaltdb.serializers import PickleSerializer
graph_db = GraphDB(LMDBStore(path="graph_lmdb_example"), PickleSerializer())
alice = Node(node_id="alice", labels=["Person"], properties={"name": "Alice"})
bob = Node(node_id="bob", labels=["Person"], properties={"name": "Bob"})
graph_db.put_node(alice)
graph_db.put_node(bob)
graph_db.put_edge(Edge(
edge_id="alice-knows-bob",
source="alice",
target="bob",
properties={"type": "knows", "since": 2024},
))
result = graph_db.query('MATCH (a:Person {name: "Alice"}) MATCH (a)-[:knows]->(b) RETURN a.id, b.name')
print(result.records)
graph_db.close()