Easy for humans · Exact for agents

Think in tuples.
Storage is a detail.

XDB stores data as tuples: a path, an attribute, and a typed value. Read and write them from Go or the CLI. Keep them in memory, files, Redis, or SQLite.

$ go install github.com/xdb-dev/xdb/cmd/xdb@latest
go · one tuple
// A path, an attribute, and a typed value.
t := core.NewTuple(
    "com.example/posts/p-1", "title", "Hello")

t.URI()    // xdb://com.example/posts/p-1#title
t.AsStr()  // "Hello", nil

// The same call on memory, files, Redis, or SQLite.
err := st.PutTuples(ctx, t)
shell · the same tuple from the CLI
$ xdb get xdb://com.example/posts/p-1#title
{ "_id": "p-1", …, "title": "Hello" }
fig. 0anatomy of a tuple
Example

Real sessions, replayed.

The scenarios and the data come from the agent task evals: a store, a household ledger, and an issue tracker. Each command and its output come from a real run of the CLI.

recorded by make site-demo

      
    
How it works

Everything passes through tuples.

Data comes in as JSON, protobuf messages, or Go structs. XDB converts it to tuples, checks them against your schema, and hands them to the driver for your backend. Reads take the same path in reverse.

fig. 1formats in, backends out
1Convert

The xdbjson, xdbproto, and xdbstruct encoders convert each format to tuples and back.

2Check

The store validates each value against the schema and sets the record version. Every backend gets the same rules.

3Write

The driver for your backend writes the tuples as a map in memory, a JSON file, a Redis hash, or a SQLite row.

Agents

A CLI agents can inspect.

Resource commands follow xdb <resource> <action> <URI> [flags]. Use describe to discover supported actions, payload types, filters, and error codes.

fig. 2the grammar
Get started

Create your first record.

1Install

Install the Go binary, which includes the CLI and daemon.

go install github.com/xdb-dev/xdb/cmd/xdb@latest
2Init

Create the config and start the daemon with SQLite. Select another backend in the config if needed.

xdb init
3Write

Define a schema and write a record. Use xdb describe to look up other operations.

xdb schemas create xdb://com.example/posts \
  --json '{"fields":{"title":{"type":"string"}}}'
xdb records create xdb://com.example/posts/p-1 \
  --json '{"title":"Hello"}'

Next: the get-started guide covers reads and version checks, and xdb context prints the agent guide.

Guides

Pick the guide for your task.