Skip to main content

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

Project description

๐Ÿซ›๐Ÿ‘ฃ 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.
  • 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

# 1. Install JJ (required, one-time)
bash scripts/install-jj.sh

# 2. Install dependencies
uv sync

Quick Start

Set up your data repo

# 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)
bash scripts/bootstrap-data-repo.sh fava-trails-data

Register the MCP server

Add to ~/.claude.json (Claude Code) or claude_desktop_config.json (Claude Desktop):

{
  "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"
      }
    }
  }
}

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 uv run --directory /path/to/fava-trails fava-trails-server"
      ]
    }
  }
}

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

Cross-Machine Sync

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

Setting up a second machine

On the second machine:

# 1. Install JJ
bash scripts/install-jj.sh

# 2. Clone the SAME data repo
git clone https://github.com/YOUR-ORG/fava-trails-data.git

# 3. Initialize JJ colocated mode + track remote
cd fava-trails-data
jj git init --colocate
jj bookmark track main@origin

# 4. Clone the engine
git clone https://github.com/YOUR-ORG/fava-trails.git

# 5. Install engine dependencies
cd fava-trails && uv sync

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

That's it. 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
โ”‚   โ”œโ”€โ”€ trail.py               โ””โ”€โ”€ trails/
โ”‚   โ”œโ”€โ”€ config.py                  โ””โ”€โ”€ default/
โ”‚   โ””โ”€โ”€ vcs/                           โ””โ”€โ”€ thoughts/
โ”‚       โ””โ”€โ”€ jj_backend.py                 โ”œโ”€โ”€ drafts/
โ””โ”€โ”€ scripts/                              โ”œโ”€โ”€ decisions/
    โ”œโ”€โ”€ install-jj.sh                     โ”œโ”€โ”€ observations/
    โ””โ”€โ”€ bootstrap-data-repo.sh            โ””โ”€โ”€ preferences/
  • Engine (fava-trails) โ€” stateless MCP server, Apache-2.0
  • 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)

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.4.tar.gz (52.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.4-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fava_trails-0.4.4.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fava_trails-0.4.4.tar.gz
Algorithm Hash digest
SHA256 0966e6ba9709b3dc1b393edd400724528b4a2bde39546ee45dea8838a6222369
MD5 9b11b8df2e760e0908831a9056ab25ce
BLAKE2b-256 9976d73d32485b75c9d9e990031d8de394ae9b258619dec17d6d43c1db501e71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fava_trails-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fava_trails-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 57504417cd4a9fe244f0a2312cb2ec2761857c99355cc4ee2648b4ee3106274c
MD5 4634ebaa0e7163d46c61a7c0bd5a889a
BLAKE2b-256 e660ce2431ee934f78439391f7e41e2a436f8a60745200985606535ad2e0f609

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