Skip to content

opral/lix

Repository files navigation

Lix

Embeddable version control system for AI agents

weekly downloads on NPM Discord GitHub Stars X (Twitter)

Lix gives AI agents versions, branches, checkpoints, reviewable changes, rollback, merging, immutable history, and SQL-queryable context for non-code files like PDF, DOCX, XLSX, CSV, JSON, and agent-generated work.

  • Runs in process. Import it as a library and run it inside your worker, service, CLI, or app. No daemon, no protocol.
  • Works for any file format. Track changes as entities across files, structured data, and custom formats.
  • Real-time multiplayer. Give agents and tools shared versions, branches, and live change history.
  • Bring your own backend. Start in memory, then plug into SQLite, Postgres, S3, Cloudflare, or your own adapter.
  • SQL interface. Agents can query history and changes without rereading whole files.

Getting started

JavaScript JavaScript · Python Python · Rust Rust · Go Go

npm install @lix-js/sdk
import { openLix, SqliteBackend } from "@lix-js/sdk";

const lix = await openLix({
  backend: new SqliteBackend({ path: "app.lix" }),
});

await lix.fs.writeFile("/notes/status.txt", new TextEncoder().encode("draft"));

const main = await lix.activeBranchId();

const draft = await lix.createBranch({ name: "Explore" });

await lix.switchBranch({ branchId: draft.id });

await lix.fs.writeFile(
  "/notes/status.txt",
  new TextEncoder().encode("ready for review"),
);

await lix.switchBranch({ branchId: main });

const changes = await lix.execute(
  "SELECT schema_key, count(*) AS count FROM lix_change GROUP BY schema_key",
);

Why Lix?

Git is great for code. Non-code files need semantic change tracking.

AI agents are creating explosive demand for version control: isolated workspaces, checkpoints, versions, reviewable changes, and rollback.

Git works well for source code, but it cannot meaningfully track many non-code files by default. Agents increasingly operate on files where the useful diff is a spreadsheet cell, document clause, generated JSON property, CSV row, PDF section, or agent action.

Lix is built to make those domain-level changes queryable, reviewable, and mergeable.

How does Lix compare to Git? →

What Lix provides

Import as a library

Import Lix and open it inside your worker, service, CLI, or app. No daemon, no protocol.

import { openLix, SqliteBackend } from "@lix-js/sdk";

const lix = await openLix({
  backend: new SqliteBackend({ path: "app.lix" }),
});

ACID transactions

Write files, blobs, and history in one transaction.

const tx = await lix.beginTransaction();

try {
  await tx.fs.writeFile("/spec.docx", body);
  await tx.fs.writeFile("/spec.png", image);
  await tx.commit();
} catch (error) {
  await tx.rollback();
  throw error;
}

Parallel branches. No worktrees.

Give every agent its own isolated branch without creating Git-style multi-checkout worktrees.

const main = await lix.activeBranchId();

const copy = await lix.createBranch({ name: "Copy draft" });
const pricing = await lix.createBranch({ name: "Pricing draft" });
const qa = await lix.createBranch({ name: "QA draft" });

await lix.switchBranch({ branchId: copy.id });
await lix.fs.writeFile("/landing.md", copyDraft);

await lix.switchBranch({ branchId: pricing.id });
await lix.fs.writeFile("/plans.json", priceModel);

await lix.switchBranch({ branchId: qa.id });
await lix.fs.writeFile("/checks/report.json", testRun);

await lix.switchBranch({ branchId: main });

Semantic changes

Unlike Git's line-based diffs, Lix can track structured entities: XLSX rows, DOCX clauses, JSON properties, app records, and more.

const changes = await lix.execute(`
  SELECT created_at, schema_key, entity_pk, snapshot_content
  FROM lix_change
  ORDER BY created_at DESC
  LIMIT 20
`);

For example, an agent edits an orders spreadsheet:

Before:
| order_id | product  | status  |
| -------- | -------- | ------- |
| 1001     | Widget A | shipped |
| 1002     | Widget B | pending |

After:
| order_id | product  | status  |
| -------- | -------- | ------- |
| 1001     | Widget A | shipped |
| 1002     | Widget B | shipped |

Git can only tell you the file changed:

-Binary files differ

Lix can expose the row field that changed:

order_id 1002 status:

- pending
+ shipped

Read more about semantic changes →

SQL interface

Agents burn fewer tokens and keep cleaner context when version-control questions are answered with SQL instead of whole-file rereads.

Claude Code asks: Which orders changed status in this branch? Executing SQL

const rows = await lix.execute(`
  SELECT created_at, schema_key, entity_pk, snapshot_content
  FROM lix_change
  ORDER BY created_at DESC
  LIMIT 20
`);

Every change, across every file and every branch, is a row in lix_change. Filter by branch, file, schema, or time without re-reading whole files.

Bring your own backend

Start in memory, then plug Lix into the infrastructure your app already runs.

SQLite SQLite · Postgres Postgres · S3 S3 · Cloudflare Workers Cloudflare Workers · Supabase Supabase

const lix = await openLix({
  backend: new SqliteBackend({ path: "app.lix" }),
});

How Lix works

Lix runs in-process inside your app.

It owns the version-control model: files, blobs, versions, history, transactions, and semantic changes. You plug it into whatever backend you need: in-memory, SQLite, Postgres, S3, Cloudflare, or your own adapter.

SQL is the query interface on top. Agents can ask what changed without rereading whole files.

┌─────────────────────────────────────────────────┐
│                  Your runtime                   │
│        agent worker · server · CLI · app         │
│                                                 │
│   ┌─────────────────────────────────────────┐   │
│   │                  Lix                    │   │
│   │  Filesystem · Versions · History · SQL  │   │
│   └────────────────────┬────────────────────┘   │
│                        │                        │
└────────────────────────┼────────────────────────┘
                         ▼
┌─────────────────────────────────────────────────┐
│                    Backend                      │
│      SQLite, Postgres, S3, Cloudflare, custom   │
└─────────────────────────────────────────────────┘

Read more about Lix architecture →

What you can build with Lix

  • AI agent filesystems - isolated workspaces, versioned explore steps, semantic change history, and rollback when a run goes sideways.
  • Version control for Postgres & SQLite - time-travel and versioned schemas on top of an existing database. Reviewable migrations. Diffable rows.
  • Apps with version control - add versions, review, rollback, and history to editors, CMSs, design tools, internal ops apps, and AI-native products.
  • Review for AI-generated changes - surface what an agent actually changed at the entity level. Approve, request edits, or revert by symbol instead of patch.

Roadmap

v0.6: Lix SDK (current)

  • Importable SDK
  • ACID transactions across state, blobs, and history
  • Parallel sessions and versions
  • Entity-level change tracking, queryable via SQL
  • Stable physical storage layout
  • Pluggable backend interface

v0.7: Lix CLI

  • CLI for creating, inspecting, and scripting Lix repositories

v0.8: file plugin API

  • Finalized file plugin API for DOCX, XLSX, CAD, PDF, and code

v0.9: merge conflicts

  • Merge conflicts as first-class citizens

v0.10: working changes

  • Working changes and checkpointing

Learn More

Blog posts

License

MIT

About

Version control system for AI agents

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages