datalevin/datalevin

A simple, fast and versatile Datalog database

What it solves

Datalevin provides a simple, fast, and durable Datalog database that serves as an alternative to SQL RDBMS and graph databases. It addresses the complexity of SQL by offering a more declarative and composable query language, while avoiding the complex temporal semantics found in some other Datalog implementations. It also solves the need for a versatile storage engine that can handle key-value pairs, documents, and vector embeddings within a single system.

How it works

Datalevin is built on a fork of LMDB (Lightning Memory-Mapped Database) to ensure high read performance and ACID compliance. It uses a cost-based query optimizer to improve execution plans for complex joins. For AI capabilities, it integrates llama.cpp for in-database text generation and embeddings, and uses a SIMD-accelerated library for vector indexing and search. It can be deployed as an embedded library (similar to SQLite) or as a networked client/server with Raft-based high availability.

Who it’s for

It is designed for developers who prefer Datalog's declarative nature over SQL, those building applications requiring graph queries or deductive reasoning, and AI developers needing an "AI-native" database with built-in vector search and LLM integration.

Highlights

  • Versatile Storage: Supports Datalog queries, key-value storage for EDN data, and document storage (JSON, EDN, Markdown) with automatic path indexing.
  • AI-Native: Includes a built-in local MCP server and supports in-DB embedding and text generation via llama.cpp.
  • High Performance: Features a novel cost-based query optimizer and asynchronous transaction mode for write-intensive workloads.
  • Broad Integration: Provides libraries for Java, Python, Node.js, and Clojure, and is compatible with Babashka pods.
  • Advanced Search: Includes a full-text search engine and SIMD-accelerated vector database features.

Related

  • Project
  • Project
  • Project
  • Project
  • Project