Skip to main content

GAIT: git-like versioning for AI turns, commits, and context

Project description

gait

An open source version and source control system, inspired by Git, for Artificial Intelligence Agents

Git-Like Version Control for AI Conversations

GAIT is an open-source, Git-inspired version control system for AI conversations, prompts, and long-lived memory.

It treats AI context as versioned infrastructure, not disposable chat logs.

Think of GAIT as Git for reasoning, not files.

Why GAIT Exists

AI workflows don’t behave like filesystems:

Conversations evolve over time

Some context should persist, some should not

Bad turns must be reversible

Experiments should not pollute production memory

Prompt changes need safe branching and rollback

Traditional chat tools collapse history, memory, and state into one fragile stream.

GAIT separates them — while keeping everything inspectable, versioned, and reversible.

What GAIT Lets You Do

Record user ↔ assistant turns as immutable objects

Commit conversation state to branches

Pin important turns into explicit, long-lived memory

Resume conversations safely (or start fresh automatically)

Branch, merge, and experiment without losing context

Rewind history and memory independently

Chat interactively with local LLMs while versioning every turn

Core Concepts Turns

A turn is a single user + assistant interaction.

User: "What is GAIT?" Assistant: "GAIT is Git for AI conversations."

Turns are immutable

Content-addressed

Stored once, referenced everywhere

Commits

A commit references one or more turns and has parents, metadata, and a branch.

Normal commits contain turns

Merge commits contain no turns

Commits form a DAG (just like Git)

This allows safe history traversal, branching, and merges.

Memory (HEAD+ Memory)

Memory is explicitly pinned context that survives across turns.

Key properties:

Memory is opt-in

Only pinned turns enter memory

Memory is versioned independently from commits

Memory has its own reflog

This prevents accidental context bloat and hallucination drift.

Repository Layout

GAIT stores everything in a .gait/ directory:

.gait/ ├── HEAD ├── objects/ # content-addressed objects (turns, commits, memory) ├── refs/ │ ├── heads/ # branches │ └── memory/ # branch memory refs ├── turns.jsonl # turn → commit log └── memory.jsonl # memory reflog

No magic. Everything is inspectable.

Installation (Dev / Editable) python -m venv GAITING source GAITING/bin/activate pip install -e .

This installs the gait CLI into your virtual environment.

(PyPI packaging coming next.)

Quick Start Initialize a repo gait init

Record a turn gait record-turn
--user "What is GAIT?"
--assistant "GAIT is Git for AI conversations."

This:

Stores the turn

Creates a commit

Advances HEAD

Pin important context into memory gait pin --last --note "baseline definition"

Pinned turns now become part of HEAD+ memory.

gait memory

View history gait log gait show HEAD

Interactive Chat (Local LLMs)

GAIT includes an interactive chat mode that records every turn automatically.

gait chat

Supported local providers

GAIT auto-detects local LLMs in this order:

Ollama — 127.0.0.1:11434

Foundry Local — 127.0.0.1:63545

LM Studio — 127.0.0.1:1234

No flags required in the common case.

Defaults & safety

If history exists → GAIT resumes automatically

If HEAD is empty → GAIT starts fresh (no crash)

Memory is injected only if pinned

Resume can be disabled with --no-resume

Environment overrides export GAIT_PROVIDER=openai_compat export GAIT_BASE_URL=http://127.0.0.1:1234 export GAIT_DEFAULT_MODEL=gemma-3-4b

Branching & Experiments

Create and switch branches directly from the CLI:

gait branch experiment gait checkout experiment

Branches:

Inherit commit history

Optionally inherit memory (--no-inherit-memory)

Are perfect for prompt and reasoning experiments

Inside gait chat, you can also:

/branches /branch new-idea /checkout new-idea

(No context loss.)

Merging gait merge experiment

Optional memory merge:

gait merge experiment --with-memory

Memory merges:

Deduplicate pinned turns

Preserve provenance

Are logged in the memory reflog

Revert vs Reset (Important) gait revert — safe undo gait revert gait revert --also-memory

Moves HEAD to the parent commit

Optionally rewinds memory correctly

Best for interactive usage

gait reset — power tool gait reset gait reset --hard

reset → move HEAD only

reset --hard → move HEAD + memory

Best for timeline surgery and cleanup.

Memory Reflog (The Secret Sauce)

Every memory mutation is logged with:

Timestamp

Branch

HEAD commit at the time

Old memory → new memory

Reason (pin, unpin, merge, revert, reset)

This makes memory auditable, reversible, and safe.

Context Export (Agent-Ready) gait context --json

Produces a structured context bundle:

{ "schema": "gait.context.v0", "branch": "main", "memory_id": "...", "pinned_items": 2, "items": [...] }

Designed for:

LLM prompts

Agent frameworks

MCP (future)

What GAIT Is Not (Yet)

❌ File version control

❌ Automatic memory

❌ Hosted SaaS

❌ MCP server (coming)

GAIT is intentionally small, explicit, and correct.

Philosophy

History is cheap. Memory is intentional. Reversibility is non-negotiable.

GAIT treats AI context like production infrastructure — not chat logs.

gaithub - remote hub for gait repositories

Remote Repository (gaithub – Early Access)

GAIT supports an experimental remote repository backend called gaithub.

This enables pushing, pulling, and cloning GAIT repositories over HTTP — similar to how Git talks to GitHub — but purpose-built for AI context, turns, commits, and memory.

Temporary Cloud Run Endpoint

While DNS and permanent hosting are being finalized, gaithub is currently running on Google Cloud Run at:

https://gaithub-960937205198.us-central1.run.app

⚠️ Important

This endpoint is temporary

It may be reset, redeployed, or replaced without notice

A stable domain name and authentication model are on the roadmap

Using gaithub as a Remote

You can treat this endpoint as a GAIT remote for early testing.

Add it as a remote:

gait remote add cloud https://gaithub-960937205198.us-central1.run.app

Push a repository:

gait push cloud --owner john --repo my-ai-project

Clone from the remote:

gait clone https://gaithub-960937205198.us-central1.run.app
--owner john
--repo my-ai-project
--path ./my-ai-project-clone

Verify the clone:

cd my-ai-project-clone gait status gait log --limit 5 gait verify

Roadmap: gaithub

Planned improvements include:

Stable DNS (e.g. gaithub.ai or similar)

Authentication & authorization

Forks and pull requests (GAIT-native, not Git)

Remote memory policies

Hosted public and private repositories

MCP-compatible remote context export

Remote sync is intentionally not required for GAIT’s core philosophy — but when used, it enables collaboration, backup, and distributed agent workflows.

Status

Version: 0.0.1

State: Core model stable, active development

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gait_ai-0.0.2.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gait_ai-0.0.2-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file gait_ai-0.0.2.tar.gz.

File metadata

  • Download URL: gait_ai-0.0.2.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0b1

File hashes

Hashes for gait_ai-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6536752ad29c5ae32f4698615b7530b35bb653daf48ea8b30f96d07808ea5693
MD5 d4116653bc0b3e8c5d806ab1e33418b1
BLAKE2b-256 1ecdc98841c09550bdd35cc7f61d25fa693e16a1b9102267be904b7d407e6b63

See more details on using hashes here.

File details

Details for the file gait_ai-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gait_ai-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 40.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0b1

File hashes

Hashes for gait_ai-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f2c4078790f3b75f6692cd05b2c4ee68a686126c188fe661e4d3624d4fcde3a
MD5 120166b5b2c56c1a19a7e728b2732638
BLAKE2b-256 989f3dd7bffaf92e6671f48e3bc8a93450b018f4a93cb8c8c6f40b2587b77233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page