feder-cr/git-ai
Git designed for AI agents.
gitai – Git‑style version control built for AI agents
What it is
- An open‑source server‑centric VCS that follows the design described in Anthropic’s Scion paper. It keeps the familiar Git data model but moves most operations (history queries, merges, conflict resolution, etc.) to a stateless server that can scale to thousands of short‑lived coding agents.
- The server stores commits in a relational DB (SQLite or PostgreSQL) and object packs in any object‑storage backend (local files, S3, GCS, Azure). Clients talk to the server via gRPC.
- The project is a clean‑room re‑implementation of the Scion ideas and is MIT‑licensed. It is a fork of GitLab’s Gitaly RPC server, so all standard Git plumbing RPCs still work.
Key concepts & features
| Feature | How it helps AI agents |
|---|---|
Always‑online clients (graft clone, graft sparse) |
Agents fetch only the objects they need instead of cloning the whole repo, saving bandwidth and latency. |
| Server‑side history API | Blame, path history, ancestry, and code‑search are computed once per commit on the server and memoised, eliminating costly client‑side walks. |
Landing without a merge queue (UserLand) |
A change is rebased onto the tip and landed via a compare‑and‑swap; concurrent lands are batched into a single reference update, so many agents can land simultaneously. |
| Pluggable conflict resolution | When a land conflicts, the server can invoke any LLM provider (or a deterministic tool) through a version‑neutral protocol to auto‑resolve it. |
| Changeset log | Every reference update is recorded with operation type and actor, giving agents a linear, watchable stream of repository activity. |
| Stateless, scalable storage | Write‑ahead log in SQLite/PostgreSQL + content‑addressed packs in object storage; any server node can rebuild the repo cache, enabling horizontal scaling. |
Post‑land verification (graft‑verify) |
Runs tests on the new tip, bisects failures, and automatically reverts the offending change. |
| Agent‑centric security | Per‑agent tokens, RPC allow‑lists, and branch policies control what each agent may read or write. |
Caching tiers (graft‑cache) |
Daemon and regional caches store immutable objects, verified on read, to reduce storage‑backend load. |
| Review & approval rules | Semantic rules let simple comment‑only changes require fewer approvals than logic‑changing ones, making automated review lightweight. |
Typical use‑cases
- Massive code‑generation pipelines where hundreds of LLM‑driven agents produce small patches continuously.
- Continuous integration for AI‑generated code that needs rapid landing, automatic testing, and fast rollback.
- Multi‑agent development environments (e.g., swarm‑coding, pair‑programming bots) that share a single branch without merge‑queue bottlenecks.
- Enterprise setups that already use GitLab/Gitaly and want to add an AI‑agent‑friendly layer without abandoning existing tooling.
Current status
- Version 0.1.0 (first public release). All listed Scion ideas are implemented and covered by unit, end‑to‑end, multi‑node, crash and fuzz tests.
- Interfaces are still pre‑1.0 and may change; known gaps such as garbage‑collection of object packs are documented.
Getting started
# clone and build (requires Go 1.26, a C toolchain, Meson & Ninja)
git clone https://github.com/feder-cr/git-ai.git
cd git-ai
make build # builds server, CLI, tools into _build/bin
# run the quick‑start demo (spins up a server, cache daemon, two agents, a land)
examples/graft/quickstart.sh
# use the CLI
./_build/bin/graft --help
- To run a production server, edit
examples/graft/config.toml(or provide your own) and start with_build/bin/gitaly serve config.toml. - Add a
[graft.storage]section to point the server at a database and object‑storage backend, then import existing Git repos in shadow mode before switching to authoritative mode.
Documentation & deeper reading
- Quick‑start & config reference:
doc/graft/QUICKSTART.md,doc/graft/CONFIGURATION.md - Architecture & storage design:
ARCHITECTURE.md,STORAGE.md - Detailed docs on landing, conflict resolution, derived data, review, search, verification, monitoring (“superfans”), security, benchmarks, fuzzing, and roadmap are all in the
doc/graft/folder.
Community
- Open to contributions: file issues, start design discussions, submit PRs with tests and a brief rationale.
- The project encourages community‑driven evolution of the design documents (
PLAN*.md).
License
- MIT license (see
LICENSE).
gitai aims to give AI‑driven development teams the same reliability and performance guarantees that Git provides for humans, while removing the human‑centric bottlenecks that make large‑scale agent coding impractical.
Related
- Project
- Project
- Project
- Project