Lix is in alpha · Follow progress to v1.0

Embeddable version control system for AI agents

Lix is a version control system that can be imported as a library. Use it to, for example, enable human-in-the-loop workflows for AI agents like diffs and reviews.

90k+
Weekly downloads
MIT
Open Source
PythonRustGo
import { openLix, InMemoryEnvironment } from "@lix-js/sdk";
import { plugin as json } from "@lix-js/plugin-json";

const lix = openLix({
environment: new InMemoryEnvironment(),
providePlugins: [json]
})
dependencies
http
2.1
db
3.0
lix
1.0

Fits into your tech stack

Import Lix and get branching, diff, and rollback without changing your architecture.

config.json
title
DraftFinal
price
1012

Tracks semantic changes

Lix stores semantic changes via plugins. Diffs, blame, and history are queryable via SQL.

12:03edit config.json
12:04update data.xlsx
12:05
approved
12:06edit report.pdf

Human in the loop for agents

Agents propose changes in isolated versions. Humans review, approve, and merge.

README.mdfrom opral/lix
View on GitHub

Lix

Embeddable version control system

97k weekly downloads on NPM Discord GitHub Stars X (Twitter)

[!NOTE]

Lix is in alpha · Follow progress to v1.0 →


Lix is an embeddable version control system that enables Git-like features such as history, versions (branches), diffs, or blame for any file format.

What makes Lix unique:

  • Embeddable - Works on top of your existing SQL database.
  • Tracks deltas - Changes are semantically tracked and queryable via SQL.
  • Supports any file format - Tracks changes in .docx, .pdf, .json, etc. via plugins.

📖 How does Lix compare to Git? →


Use cases

  • AI agent sandboxing - Agents making changes to files can be tracked, diffed, and rolled back.
  • Context management - Knowing what changed and why for better humant/agent performance.
  • In-app version control - Branching and merging, audit trails, embedded in applications.

When to use & not to use lix

Use lix if your app or agent is modifying documents e.g. Word, PDFs, etc. Don't use lix if your main use case is not modifying documents, or the documents are on off generated artifacts that do not change.

Getting started

JavaScript JavaScript · Python Python · Rust Rust · Go Go

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

const lix = await openLix({
  environment: new InMemorySQLite()
});

await lix.db.insertInto("file").values({ path: "/hello.txt", data: ... }).execute();

const diff = await selectWorkingDiff({ lix }).selectAll().execute();

Semantic change (delta) tracking

Unlike Git's line-based diffs, Lix understands file structure through plugins. Lix sees price: 10 → 12 or cell B4: pending → shipped, not "line 4 changed" or "binary files differ".

JSON file example

Before:

{"theme":"light","notifications":true,"language":"en"}

After:

{"theme":"dark","notifications":true,"language":"en"}

Git sees:

-{"theme":"light","notifications":true,"language":"en"}
+{"theme":"dark","notifications":true,"language":"en"}

Lix sees:

property theme:
- light
+ dark

Excel file example

The same approach works for binary formats. With an XLSX plugin, Lix shows cell-level changes:

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 sees:

-Binary files differ

Lix sees:

order_id 1002 status:

- pending
+ shipped

How Lix Works

Lix uses SQL databases as query engine and persistence layer. Virtual tables like file and file_history are exposed on top:

SELECT * FROM file_history
WHERE path = '/orders.xlsx'
ORDER BY created_at DESC;

When a file is written, a plugin parses it and detects entity-level changes. These changes (deltas) are stored in the database, enabling branching, merging, and audit trails.

┌─────────────────────────────────────────────────┐
│                      Lix                        │
│                                                 │
│ ┌────────────┐ ┌──────────┐ ┌─────────┐ ┌─────┐ │
│ │ Filesystem │ │ Branches │ │ History │ │ ... │ │
│ └────────────┘ └──────────┘ └─────────┘ └─────┘ │
└────────────────────────┬────────────────────────┘
                         │
                         ▼
┌─────────────────────────────────────────────────┐
│                  SQL database                   │
│            (SQLite, Postgres, etc.)             │
└─────────────────────────────────────────────────┘

Read more about Lix architecture →

Learn More

Blog posts

License

MIT