Catalog PyPI
PACKAGE EXPLORERView in registry

agent-git

PyPI

Git for AI Memory. Prevent hallucinations with save points.

Versions collected1
Direct dependencies0From release 0.2.0
Last observed20 Oct, 22:03 UTC

README

Version 0.2.0 documentation

🧠 AgentGit: The "Save Button" for AI Agents

Give your LLM the power to Undo.

AgentGit is a version control library designed for AI Agents (not just humans). It allows Agents to snapshot their own memory, recover from hallucinations, and manage their own state safely.

"Seamlessly integrates with OpenAI, Anthropic, LangChain, and OpenClaw."

🚀 Why?

Most Agents are fragile. If they write bad data to memory.md or state.json, it's permanent. AgentGit solves this by giving the Agent a Tool to save its work.

  • Auto-Save: Agent learns something new? -> commit()
  • Auto-Fix: Agent detects a mistake? -> checkout()

📦 Installation

pip install agent-git

🤖 Usage: The "AI-Native" Way

Don't run manual commands. Give the tools to your bot.

1. Integration with OpenAI / Anthropic

AgentGit comes with pre-built tool definitions. Just import and pass them to your model.

import openai
from agent_git import AgentGit, get_llm_tools

# 1. Initialize Memory
memory = AgentGit(root_dir="./agent_workspace")
memory.init()

# 2. Get the Tools (JSON Schema is built-in!)
tools = get_llm_tools() 

# 3. Give them to the Agent
response = openai.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Update my user profile to say I love Python."}],
    tools=tools  # <--- Agent can now call 'agent_git_commit' itself!
)

2. Integration with OpenClaw / Claude Code

AgentGit includes a Skill Definition that teaches autonomous agents how to use it.

from agent_git import get_skill_text

print(get_skill_text())
# Output:
# # Skill: AgentGit (Memory Version Control)
# Use this skill to save/restore memory states...
# - agent_git_commit(message, files)
# ...

⚡ What the Agent Does

Once equipped, your Agent handles the rest:

  1. The Agent Writes Memory:

    Agent: "I will update user_preferences.json."

  2. The Agent Commits (Automatically):

    Agent: "Calling agent_git_commit(message='Updated user preference', files=['user_preferences.json'])."

  3. The Agent Fixes Hallucinations:

    User: "Wait, I didn't say that!" Agent: "My apologies. Calling agent_git_checkout(commit_hash='PREVIOUS_HASH') to restore the correct state."

🛠 Manual CLI (For Humans)

You can still inspect what your Agent is doing:

# See the Agent's save history
agent-git log

# [93a8571] 🤖: Learned about Blender
# [a1b2c3d] 🤖: Updated project roadmap

🔮 Roadmap

  • LangChain Middleware: Auto-commit on every AgentFinish event.
  • AutoGPT Plugin: Drop-in persistence layer.
  • Remote Sync: Push agent memory to private GitHub repos.

Built by Moustapha Moussa for the Open Source AI Community.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.024 Feb 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
moustaphamoussa/agent-git

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:03 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:5cb949991ca9a70eeef9f3470ad6fd3f982ef502aae8504c96a8694a8e1dc016