Persist AI agent memory as commits inside a Git repo
Branch and merge experimental agent contexts safely
Query stored knowledge by tag, date, or content pattern
Audit how an agent's knowledge changed over time
Needs a working Rust 1.70+ toolchain and Git installed on the host.
agent-git is a Rust library that stores knowledge for AI agents inside a Git repository. The idea is that anything an agent learns, such as user preferences, task notes, or experimental context, gets written as an entry and committed, so it carries the version history, branching, and merging behaviour that Git already provides. The README shows the shape of the API. You initialise a knowledge repo at a folder path, create an Entry with an ID, content text, and a list of tags, then call store on the repo to persist it. Each store returns a commit hash, which means every change to the knowledge base is a real Git commit you can inspect later. Querying happens through a small builder. You start a query on the repo, narrow it down by tag, by a since date, or by a content pattern, then call execute to get back the matching entries. The example loops over the results and prints the entry ID and content, which is a typical pattern for feeding context back into an agent. Branching is part of the design, not an afterthought. The README shows calling branch with a name like experiment/new-context to try out a different line of knowledge, and there is a merge method to bring a branch back into the current line. There is also a history method on the repo for retrieving the past versions of a single entry by ID. Installation is one cargo install agent-git command. The project is MIT licensed and the README invites contributors to open an issue before sending large pull requests.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.