Skip to main content

FAVA Trails ๐Ÿซ›๐Ÿ‘ฃ โ€” Federated Agents Versioned Audit Trail. VCS-backed memory for AI agents via MCP.

Project description

PyPI License Tests Python

FAVA Trails

Federated Agents Versioned Audit Trail โ€” VCS-backed memory for AI agents via MCP.

Every thought, decision, and observation is stored as a markdown file with YAML frontmatter, tracked in a Jujutsu (JJ) colocated git monorepo. Agents interact through MCP tools โ€” they never see VCS commands.

Why

  • Supersession tracking โ€” when an agent corrects a belief, the old version is hidden from default recall. No contradictory memories.
  • Draft isolation โ€” working thoughts stay in drafts/. Other agents only see promoted thoughts.
  • Trust Gate โ€” an LLM-based reviewer validates thoughts before they enter shared truth. Hallucinations stay contained in draft.
  • Full lineage โ€” every thought carries who wrote it, when, and why it changed.
  • Crash-proof โ€” JJ auto-snapshots. No unsaved work.
  • Engine/Fuel split โ€” this repo is the engine (stateless MCP server). Your data lives in a separate repo you control.

Install

Prerequisites

Install Jujutsu (JJ) โ€” FAVA Trails uses JJ as its VCS engine:

fava-trails install-jj

Or install manually from jj-vcs.github.io/jj.

From PyPI (recommended)

pip install fava-trails

From source (for development)

git clone https://github.com/MachineWisdomAI/fava-trails.git
cd fava-trails
uv sync

Quick Start

Set up your data repo

New data repo (from scratch):

# Create an empty repo on GitHub (or any git remote), then clone it
git clone https://github.com/YOUR-ORG/fava-trails-data.git

# Bootstrap it (creates config, .gitignore, initializes JJ)
fava-trails bootstrap fava-trails-data

Existing data repo (clone from remote):

fava-trails clone https://github.com/YOUR-ORG/fava-trails-data.git fava-trails-data

Register the MCP server

Add to your MCP client config:

  • Claude Code CLI: ~/.claude.json (top-level mcpServers key)
  • Claude Desktop: claude_desktop_config.json

If installed from PyPI:

{
  "mcpServers": {
    "fava-trails": {
      "command": "fava-trails-server",
      "env": {
        "FAVA_TRAILS_DATA_REPO": "/path/to/fava-trails-data",
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

If installed from source:

{
  "mcpServers": {
    "fava-trails": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--directory", "/path/to/fava-trails", "fava-trails-server"],
      "env": {
        "FAVA_TRAILS_DATA_REPO": "/path/to/fava-trails-data",
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

For Claude Desktop on Windows (accessing WSL):

{
  "mcpServers": {
    "fava-trails": {
      "command": "wsl.exe",
      "args": [
        "-e", "bash", "-lc",
        "FAVA_TRAILS_DATA_REPO=/path/to/fava-trails-data OPENROUTER_API_KEY=sk-or-v1-... fava-trails-server"
      ]
    }
  }
}

The Trust Gate uses OpenRouter to review thoughts before promotion. Get a free API key at openrouter.ai/keys. The default model (google/gemini-2.5-flash) costs ~$0.001 per review.

Use it

Agents call MCP tools. Core workflow:

save_thought(trail_name="myorg/eng/my-project", content="My finding about X", source_type="observation")
  โ†’ creates a draft in drafts/

propose_truth(trail_name="myorg/eng/my-project", thought_id=thought_id)
  โ†’ promotes to observations/ (visible to all agents)

recall(trail_name="myorg/eng/my-project", query="X")
  โ†’ finds the promoted thought

Agents interact through MCP tools โ€” they never see VCS commands. JJ expertise is not required.

Cross-Machine Sync

FAVA Trails uses git remotes for cross-machine sync. The fava-trails bootstrap command sets push_strategy: immediate which auto-pushes after every write.

Setting up a second machine

# 1. Install FAVA Trails
pip install fava-trails

# 2. Install JJ
fava-trails install-jj

# 3. Clone the SAME data repo (handles colocated mode + bookmark tracking)
fava-trails clone https://github.com/YOUR-ORG/fava-trails-data.git fava-trails-data

# 4. Register MCP (same config as above, with local paths)

Both machines push/pull through the same git remote. Use the sync MCP tool to pull latest thoughts from other machines.

Manual push (if auto-push is off)

cd /path/to/fava-trails-data
jj bookmark set main -r @-
jj git push --bookmark main

NEVER use git push origin main after JJ colocates โ€” it misses thought commits. See AGENTS_SETUP_INSTRUCTIONS.md for the correct protocol.

Architecture

fava-trails (this repo)        fava-trails-data (your repo)
โ”œโ”€โ”€ src/fava_trails/           โ”œโ”€โ”€ config.yaml
โ”‚   โ”œโ”€โ”€ server.py  โ†โ”€โ”€ MCP โ”€โ”€โ†’โ”œโ”€โ”€ .gitignore
โ”‚   โ”œโ”€โ”€ cli.py                 โ””โ”€โ”€ trails/
โ”‚   โ”œโ”€โ”€ trail.py                   โ””โ”€โ”€ myorg/eng/project/
โ”‚   โ”œโ”€โ”€ config.py                      โ””โ”€โ”€ thoughts/
โ”‚   โ”œโ”€โ”€ trust_gate.py                      โ”œโ”€โ”€ drafts/
โ”‚   โ””โ”€โ”€ vcs/                               โ”œโ”€โ”€ decisions/
โ”‚       โ””โ”€โ”€ jj_backend.py                  โ”œโ”€โ”€ observations/
โ””โ”€โ”€ tests/                                 โ””โ”€โ”€ preferences/
  • Engine (fava-trails) โ€” stateless MCP server, Apache-2.0. Install via pip install fava-trails.
  • Fuel (fava-trails-data) โ€” your organization's trail data, private.

Configuration

Environment variables:

Variable Read by Purpose Default
FAVA_TRAILS_DATA_REPO Server Root directory for trail data (monorepo root) ~/.fava-trails
FAVA_TRAILS_DIR Server Override trails directory location (absolute path) $FAVA_TRAILS_DATA_REPO/trails
FAVA_TRAILS_SCOPE_HINT Server Broad scope hint baked into tool descriptions (none)
FAVA_TRAILS_SCOPE Agent Project-specific scope from .env file (none)
OPENROUTER_API_KEY Server API key for Trust Gate LLM reviews (get one) (none โ€” required for propose_truth)

The server reads $FAVA_TRAILS_DATA_REPO/config.yaml for global settings. Minimal config.yaml:

trails_dir: trails          # relative to FAVA_TRAILS_DATA_REPO
remote_url: null            # git remote URL (optional)
push_strategy: manual       # manual | immediate

When push_strategy: immediate, the server auto-pushes after every successful write. Push failures are non-fatal.

See AGENTS_SETUP_INSTRUCTIONS.md for full config reference including trust gate and per-trail overrides.

Development

uv run pytest -v          # run tests
uv run pytest --cov       # with coverage

Docs

Contributing

See CONTRIBUTING.md for setup instructions, how to run tests, and PR expectations.

See CHANGELOG.md for release history.

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

fava_trails-0.4.11.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

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

fava_trails-0.4.11-py3-none-any.whl (61.9 kB view details)

Uploaded Python 3

File details

Details for the file fava_trails-0.4.11.tar.gz.

File metadata

  • Download URL: fava_trails-0.4.11.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fava_trails-0.4.11.tar.gz
Algorithm Hash digest
SHA256 eecd1bd760dcdbd6e136c6cc6e708ed135922dd66f79ef10d36870e2f6471831
MD5 f1eaba4546c6eef9a89a31cc3873bcc9
BLAKE2b-256 cf3511c49cf8a454f051ffc7d563e14a289d9e4f576d4b61fd8c767ec4aa9dec

See more details on using hashes here.

Provenance

The following attestation bundles were made for fava_trails-0.4.11.tar.gz:

Publisher: release.yml on MachineWisdomAI/fava-trails

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fava_trails-0.4.11-py3-none-any.whl.

File metadata

  • Download URL: fava_trails-0.4.11-py3-none-any.whl
  • Upload date:
  • Size: 61.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fava_trails-0.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a68b5211701108edc1be91fa36903e4c04a37492a54521e8b9d1cf9285d3826e
MD5 9824fa10dafcfe66521e7f936eef6d8b
BLAKE2b-256 2ffb23a99a0ef7e9b49666d18cfb41be01314aacf6ac8a6b2a699b35cb704240

See more details on using hashes here.

Provenance

The following attestation bundles were made for fava_trails-0.4.11-py3-none-any.whl:

Publisher: release.yml on MachineWisdomAI/fava-trails

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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