explaingit

2arons/agent-git

11RustAudience · developerComplexity · 3/5ActiveLicenseSetup · easy

TLDR

Rust library that stores AI agent knowledge as Git commits, so notes, preferences, and context get branching, merging, and history for free.

Mindmap

mindmap
  root((agent-git))
    Inputs
      Entry id
      Content text
      Tags
    Outputs
      Commit hash
      Query results
      Entry history
    Use Cases
      Agent memory store
      Versioned preferences
      Branching experiments
    Tech Stack
      Rust
      Git
      Cargo

Things people build with this

USE CASE 1

Persist AI agent memory as commits inside a Git repo

USE CASE 2

Branch and merge experimental agent contexts safely

USE CASE 3

Query stored knowledge by tag, date, or content pattern

USE CASE 4

Audit how an agent's knowledge changed over time

Tech stack

RustGitCargo

Getting it running

Difficulty · easy Time to first run · 30min

Needs a working Rust 1.70+ toolchain and Git installed on the host.

MIT license, free to use, modify, and redistribute commercially with attribution.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me a minimal Rust example that initializes a KnowledgeRepo with agent-git and stores three tagged entries
Prompt 2
Write a wrapper around agent-git that exposes store and query as an HTTP API for a Python agent
Prompt 3
Build a CLI on top of agent-git that lets me list, branch, and merge agent knowledge from the terminal
Prompt 4
Add a JSON metadata sidecar to each agent-git Entry without breaking existing query filters
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.