# GitLord

A Python library that stores an AI agent's execution history as Git commits, so every prompt, response and tool call is a version-controlled, inspectable, replayable and forkable event.

GitLord represents an AI agent's execution history as a Git repository. Each turn, such as a user prompt, an assistant response, a tool call, a tool result or a subagent result, becomes a commit on a branch under refs/agents/, so Git primitives such as branches, diffs and refs stand in for agent timelines, behavior changes and agent identity.

It lets a failed run be rewound to an earlier checkpoint and retried on a new branch, lets alternative approaches be explored as separate forks with their own history, and lets subagents run on their own branches with results passed back to the parent through Git trailers. History can be queried by turn, agent, token count, error or semantic similarity. A log repository holds turn history and metadata separately from the workspace repository holding the agent's actual files.

It is a Python package, installable with optional MCP server, LiteLLM routing and ChromaDB vector-index support.

Website: https://github.com/yashneil75/gitlord
