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.
// 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)
$ xdb get xdb://com.example/posts/p-1#title
{ "_id": "p-1", …, "title": "Hello" }
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.
make site-demo
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.
The xdbjson, xdbproto, and xdbstruct encoders convert each format to tuples and back.
The store validates each value against the schema and sets the record version. Every backend gets the same rules.
The driver for your backend writes the tuples as a map in memory, a JSON file, a Redis hash, or a SQLite row.
Resource commands follow xdb <resource> <action> <URI> [flags]. Use describe to discover supported actions, payload types, filters, and error codes.
Install the Go binary, which includes the CLI and daemon.
go install github.com/xdb-dev/xdb/cmd/xdb@latest
Create the config and start the daemon with SQLite. Select another backend in the config if needed.
xdb init
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.
Declare fields and types, select a validation mode, and add indexes and constraints.
Create a schema from a Go struct, a protobuf message, or a JSON Schema file.
Filters, version checks, dry runs, bulk data, and change streams.
How each driver stores a tuple, and how to select one in the config.
Discover the CLI at runtime, parse its errors, and pipe JSON between commands.
Build a store in your own service and serve it over JSON-RPC.