GoatDB: The Realtime State Layer for Human-Agent Collaboration
📚 Documentation • ⚡ Benchmarks • 💬 Discussions • 👋 Discord
GoatDB is the realtime state layer for human-agent collaboration: humans, AI agents, tools, and devices share the same live, durable state. Under the hood it is an embedded, distributed document database providing verifiable state continuity — TypeScript-first, with React hooks included.
Inspired by distributed version control systems, GoatDB brings Git-like features to databases: cryptographically signed commits and deterministic structural merges. In secure mode (default), every write produces a signed commit in a durable commit graph—the authoritative source of repository state.
What makes GoatDB different?
- Works offline: Full local replicas of each opened repository; changes sync automatically when reconnected
- Reactive local reads: Queries run in memory, update incrementally as data changes
- Structural merge: Git-style three-way merge at the field level for concurrent edits
- Signed provenance: In secure mode (default), every commit is signed with Ed25519; verify which session wrote what — GoatDB proves the session key, not actor identity
- Bounded recovery: An available authorized replica retaining relevant history can restore a crashed server
See the Architecture page for the full architecture and current network topology.
GoatDB is under active development. Star ⭐️ our project if you like the approach!
[!WARNING] Please keep in mind that GoatDB is still under active development and therefore full backward compatibility is not guaranteed before reaching v1.0.0. For more details, see the FAQ.
Quick Start
Deno (recommended):
deno add jsr:@goatdb/goatdb
deno run -A jsr:@goatdb/goatdb init # scaffold a new project
Node.js (24+):
npx jsr add @goatdb/goatdb
npx -y @goatdb/goatdb init # scaffold a new project
Basic Usage
import { DataRegistry, GoatDB } from '@goatdb/goatdb';
const kSchemaTask = {
ns: 'task',
version: 1,
fields: {
text: { type: 'string', required: true },
done: { type: 'boolean', default: () => false },
},
} as const;
DataRegistry.default.registerSchema(kSchemaTask);
const db = new GoatDB({ path: './data' });
await db.readyPromise();
const item = db.create('/data/todos', kSchemaTask, {
text: 'Hello, GoatDB!',
});
item.set('done', true);
React Integration
GoatDB includes React hooks for reactive, offline-capable UIs. See the React documentation.
See the tutorial for more examples.
Contributing
We welcome contributions! See the contributing guide for setup instructions and guidelines.
License
GoatDB is licensed under the MIT License.