AaronDB

Hex

AaronDB is a local, embedded Datalog database for the BEAM. Its documented Stable labels are narrow local contracts backed by committed tests, bounded failure behavior where relevant, reproducible harnesses, and CI; see the evidence index.

"Simplicity is not about making things easy. It is about untangling complexity." — Rich Hickey

Current release line: v4.2.0 certifies the embedded-core-v1 structural closure: local Datalog domain models and deterministic algorithms with mechanically enforced pure-to-adapter boundaries. Sharding, distributed/HA, storage/transport, and MCP surfaces remain experimental; see Feature Maturity, Project Boundaries, and the certification profile.

AaronDB is a BEAM-native temporal Datalog engine written in Gleam. Its strongest shape is a fact-oriented database core built around a transactor actor, immutable-style state transitions, in-memory indexes, and a custom query engine.

This repository also contains local search, graph analytics, federation, cognitive, sharding, and MCP extensions. Their supported contracts are deliberately narrow; read docs/feature_maturity.md and docs/project_boundaries.md before adopting non-core features.

Core Model

  1. Facts, not objects: data is represented as datoms.
  2. Actor-owned writes: a transactor process serializes state transitions.
  3. Query over values: reads execute against database state snapshots.
  4. Storage is pluggable: the engine is decoupled from persistence adapters.

What Is Solid Today

Maturity Snapshot

AreaStatusNotes
Core DB API (aarondb)StablePrimary strength of the repository
Query DSL and pull APIsStableBacked by passing tests
Vector / HNSWStable (local approximate)Deterministic evidence and exact-oracle comparison; no universal SLA
BM25Stable (local primitive)Immutable, sequential, caller-owned Analyzer v1 index
Graph analyticsStable (local bounded API)Directed graph model; bounded APIs are the supported path for arbitrary data
Local federationStable (local fail-fast reads)Named in-runtime sources, provenance, typed failure; no partial results
Temporal querying and diffStable (local bounded API)Transaction-time, valid-time, and bitemporal snapshots plus deterministic bounded diffs; legacy unbounded APIs are compatibility-only
Reactive subscriptionsStable (local mailbox delivery)Serialized initial/delta/unsubscribe ordering; consumers own mailbox draining
Cognitive memoryStable (local explicit-fact solver)Explicit relevance facts with deterministic lifecycle semantics; no learned ranking or external retrieval
Virtual predicatesStable (bounded local adapters)Typed local adapter results and row bounds; no remote transport or forced interruption
Sharding and distributed queriesLocal BetaOne-runtime scatter/gather only: no remote membership, failover, transactional migration, or exact global Avg/Median
Raft and HA claimsInactive stubPure leader-election state machine exists but is not wired into the engine (election-only; no log replication)
Mnesia persistenceRecovery-orientedInitialization preserves incompatible schemas and returns an error; explicit backup/migration/reset is required
MCP server and agent toolingLocal BetaLocal stdio JSON-RPC adapter exposes three implemented tools; no network listener or remote authentication

Explicitly local means exactly that

The Stable labels above are contracts for one BEAM runtime and stated, reproducible local evidence. They do not claim remote federation, replication, high availability, failover, migration, quorum, coordinated writes, global snapshots, distributed graph processing, or universal latency/memory/recall guarantees.

Installation

Add the current release to your gleam.toml:

[dependencies]
aarondb = "4.2"

What 4.2.0 Changes

AaronDB 4.2.0 certifies embedded-core-v1: a deliberately bounded structural profile for local Datalog domain data and deterministic algorithms. The profile is executable: it rejects forbidden effectful imports, unapproved pure-module dependencies, malformed certification metadata, and generated/runtime artifacts.

It does not promote sharding, Raft, HA, remote federation, storage/transport, MCP, lifecycle/upgrade/rollback, or broader cluster claims. Those surfaces remain experimental until their own candidate-SHA evidence profiles pass. See CHANGELOG.md for the full release notes.

Basic Usage

Create an in-memory database:

import aarondb
let db = aarondb.new()

Transact facts:

import aarondb
import aarondb/fact.{EntityId, Str, Uid}
let assert Ok(_state) = aarondb.transact(db, [
#(Uid(EntityId(101)), "user/name", Str("Alice")),
#(Uid(EntityId(101)), "user/role", Str("Admin")),
])

Query with the DSL:

import aarondb
import aarondb/q
let query =
q.select(["name"])
|> q.where(q.v("e"), "user/role", q.s("Admin"))
|> q.where(q.v("e"), "user/name", q.v("name"))
|> q.to_clauses()
let results = aarondb.query(db, query)

Use temporal and pull APIs:

import aarondb
import aarondb/fact
let history = aarondb.history(db, fact.Uid(fact.EntityId(101)))
let entity = aarondb.pull(db, fact.Uid(fact.EntityId(101)), aarondb.pull_all())

Documentation

Current Recommendation

Treat AaronDB first as a temporal Datalog engine with a strong in-memory core. The v4.1 local contracts are ready for their stated use, but distributed features remain deliberately separate work—not marketing adjectives.