Features

Built for Serious Data Layers

An AI-first database framework with built-in skills, powerful privacy modeling, and guardrails that prevent destructive operations.

Declarative Data Modeling

Define your entire data model in a simple, readable format. Specify field types, defaults, required constraints, and indexing — then let MoleculeDB generate everything from API endpoints to storage logic.

atom(
    "FileAtom",
    [field("name", required=True),
     field("path", required=True),
     field("size", required=True),
     field("owner", required=True,
           indexable=index_query_type.EQUALITY),
     field("description"),
     field("status", default="active")],
    [],
    {},
)

Connected Data

Model real-world relationships between your data types. Edges support direction, cardinality, and automatic lifecycle management — so deleting a parent can cascade, restrict, or orphan related records.

atom(
    "MediaAtom",
    [field("label", required=True),
     field("owner", required=True,
           indexable=index_query_type.EQUALITY)],
    [edge("MediaFileEdge", "FileAtom",
          edge_direction.BOTH)],
    {},
)

Privacy & Access Control

Build powerful privacy models with chainable access policies. Control exactly who can read what — by ownership, role, group membership, or any custom logic. Policies are evaluated on every read, giving you field-level and record-level privacy out of the box.

def check(schema, data, key, ctx):
    ctx_name = ctx.get("name", "")
    if ctx_name == "":
        return deny("no context provided")
    data_owner = data.get("owner", "")
    if ctx_name == data_owner:
        return allow("owner matched")
    return deny("owner mismatch")

Data Integrity & Versioning

Every write is automatically versioned, preventing lost updates and enabling full change history. Concurrent writers never silently overwrite each other — conflicts are detected and surfaced immediately.

# Create (version must be 1)
$ atom_cli set --schema FileAtom \
    --key photo-001 --version 1 \
    --json '{"name":"beach.jpg"}'

# Update (version must be current + 1)
$ atom_cli set --schema FileAtom \
    --key photo-001 --version 2 \
    --json '{"name":"sunset.jpg"}'

# Conflict! (stale version)
$ atom_cli set ... --version 1
  Error: VERSION_CONFLICT

AI-First Database Development

MoleculeDB is designed from the ground up for AI agents. Pre-written skills guide LLMs through schema creation, access policy setup, and context configuration — turning complex database tasks into simple, guided workflows. The declarative architecture means AI agents work with high-level definitions instead of raw SQL or imperative code, dramatically reducing the risk of destructive operations like accidental deletes or schema corruption.

# AI agent creates a new schema
/create-atom
> Name: UserProfile
> Fields: name (required), email (required),
>         role (default="viewer")

# AI agent adds access control
/create-checker
> Policy: owner-match
> Rule: only the user can read their profile

# AI agent configures auth context
/create-context
> Fields: user_id, role

Secure Identity & Authentication

Every request carries cryptographically signed identity context. Access policies can inspect caller identity, roles, and custom claims — ensuring data access is always authenticated and tamper-proof.

# Config: atom_config.json
{
  "backend": "FileSystem",
  "context_proto": "./context.proto",
  "port": 50051
}

# Pass context with CLI
$ atom_cli get --schema FileAtom \
    --key photo-001 --json \
    --ctx name=alice \
    --ctx role=admin

Developer-Friendly CLI

Manage your data directly from the command line. Full CRUD, querying, edge operations, and JSON output make development and debugging fast.

# CRUD operations
$ atom_cli set --schema MyData \
    --key item-001 --version 1 \
    --json '{"title":"Hello"}'

$ atom_cli get --schema MyData \
    --key item-001 --json

$ atom_cli delete --schema MyData \
    --key item-001

# Query by indexed field
$ atom_cli query --schema MyData \
    --field owner --value alice --json

# Edge operations
$ atom_cli set --field MediaFileEdge \
    media-001 file-001
$ atom_cli get --field MediaFileEdge \
    media-001

Interested in MoleculeDB?

We're building the next generation of schema-driven data infrastructure. Register to stay updated.