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)

❌ Remote sync (gaithub in progress)

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.

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.1.tar.gz (34.8 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.1-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gait_ai-0.0.1.tar.gz
  • Upload date:
  • Size: 34.8 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.1.tar.gz
Algorithm Hash digest
SHA256 2042ef995b40f09cb997daea29a7f8d6dd14038c3b538eaa3beed4cbf08e0e90
MD5 d2108ec38d999f477f54fcc6bf12da37
BLAKE2b-256 1f7789388d334cbcef0b369ed9c39bce64dcb7d735fde330e844705d4d5b50c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gait_ai-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 39.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55d6f9380846c040665c991b290f4d79707e7428bf701d8a562d8f66880214bf
MD5 9dc48973d199d98c2f33b709629b7697
BLAKE2b-256 d8643022bde6b03f6aff8a86d70fa663eccbcfc533f40054571485aa97edf07e

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