Skip to content
sammyjdevPublic

About

Agent-agnostic context engine that gives AI coding agents continuous memory across sessions, tools, and machines.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

962 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AXON

AXON — context orchestration for AI coding agents

Same context, any AI coding agent.

Agent-agnostic eXecution and cONtext Network.

Every time you switch coding agents — from Claude Code to Codex to Cursor — or resume a project after a few days away, your AI assistant starts blank. AXON solves this by capturing context at the moments it crystallises (git commits, session boundaries) and surfacing it on demand over MCP or a plain .axon/context.md file that any agent can read. One install, continuous memory, any agent.


What AXON keeps

AXON is the memory of the work you do with coding agents: the decisions you make, the lessons from mistakes, a digest of each session and the activity history of Claude Code, Codex and agy. It does not index or embed code - agents read code with their own tools, and AXON holds what the code cannot say (dec-138). No commit and no MCP tool calls an LLM. The one LLM call left is the optional vault hook (vault/til_promoter), which sends TILs straight to a local Ollama model, so that hook needs Ollama running.


Quickstart

AXON is not yet on PyPI. Install from source:

git clone https://github.com/sammyjdev/axon.git
cd axon
pip install -e .

axon doctor reports the whole stack.

Declare the machine. AXON captures nothing until this has run once on the machine.

axon bootstrap --identity --restricted-root <dir or none> --work-projects <names or none>

Work that runs under the restricted root is not captured: git hooks skip, axon note and axon adr add refuse, MCP write tools are denied (DENY_RESTRICTED_TREE_WRITE), and conversations, activity run and activity import are skipped. Rerun axon install-hooks in each repo so the hooks show this.

If a git repository contains the restricted root (in its main folder or in a worktree), its git hooks are skipped for commits, pulls and rebases in ordinary git setups, from any folder or linked worktree. The next two paragraphs give examples of what can still be captured; they are not a complete list. A separate clone kept elsewhere is another repository and is captured.

Unusual git setups can still be captured. Examples: a repository made with --separate-git-dir whose main folder holds the restricted root, used from another folder with --git-dir or GIT_DIR, or, when that git directory is itself named .git, used through a linked worktree; a .git that is a symlink, used from another folder with --git-dir; a bare repository used with --work-tree on a folder that holds the restricted root, for commits made in one of its linked worktrees; and a worktree moved with mv, not git worktree move, so that it now holds the restricted root, for commits made in the repository's other folders until git worktree repair, run with the new path, records the move. Run that repair right away: git gc can drop the old record the next time it runs (its 3-month default counts from the last change of the worktree index, not from the move), and then the repair fails and those commits are still captured. Do not use setups like these with the restricted root. Git hooks need git 2.36 or later: on an older git with a restricted root set, every hook capture on the machine is skipped as unclear.

A commit made inside the restricted root can also still be captured after git carries it to a repository outside, for example by pull, merge, rebase, cherry-pick or commit --amend: when a clone kept elsewhere pulls or amends it, or when a branch committed in a worktree kept inside the root is merged in an outside folder. Hooks judge where they run, not where a commit was first made.

Conversations are checked only by where they ran (the recorded folders and their git repository), never by which files were opened: a session started outside the restricted root, or in a folder that contains it, that reads or edits files inside is stored. Do that work in a session started inside the restricted root.

Old conversations are judged by today's folders and settings, and axon activity backfill has no date filter: take such files out before running it, and do not resume them.

AXON also refuses when it cannot prove a location is outside it: another disk or mount, a mount below the restricted root or your work, a filesystem other than ext, XFS, Btrfs, tmpfs or overlay, or a name differing only in letter case. There is no override.

Initialize AXON in a repo (installs its git hooks):

axon init /path/to/your-repo

Register the MCP server with your coding agent. For Claude Code, add this to your project's .claude/settings.json:

{
  "mcpServers": {
    "axon": {
      "command": "axon",
      "args": ["serve"]
    }
  }
}

axon serve runs the MCP server over stdio. Once registered, tools such as axon_get_context, get_session_memory, axon_capture, axon_handoff, axon_search, axon_record_lesson, axon_search_lessons and axon_health are available inside your agent session (full list).

Every tool is classified by risk (read / write / destructive) and emits structured trace records under a shared trace_id for tool-latency and success-rate dashboards. A destructive tool requires AXON_ALLOW_DESTRUCTIVE=1 (or true / yes / on) as a consent token; none ships today. Writes to a RESTRICTED context (ctx=work) are always denied with DENY_RESTRICTED_TOOL_WRITE. See ADR-013 and dec-109.


How it works

flowchart LR
    subgraph Capture
        GE[signal commits\narch: / decision: / Lesson:]
        SH[session hooks\nstart / end]
    end

    subgraph Storage
        PG[(PostgreSQL\nsessions, decisions, lessons, activity)]
    end

    subgraph Recall
        MCP[MCP tools\naxon_get_context\naxon_search\naxon_handoff]
        CF[.axon/context.md\nfile fallback]
    end

    subgraph Agents
        CC[Claude Code]
        CX[Codex]
        CU[Cursor]
    end

    GE --> PG
    SH --> PG
    PG --> MCP
    PG --> CF
    MCP --> CC
    MCP --> CX
    MCP --> CU
    CF  --> CX
    CF  --> CU
Loading

Capture is event-driven only — signal commits and agent session start/end. No background timer, no idle cost (see dec-104). A commit is captured only when it says so: an arch: / decision: subject or an ADR-Decision: trailer becomes a draft decision, a Lesson: trailer a lesson draft (dec-110).

Storage is a single PostgreSQL instance: sessions, decisions, ADRs and activity history live there (dec-121), and lessons are found with Postgres full-text search. SQLite, Redis, Qdrant, mem0 and pgvector were retired. Neo4j was evaluated and dropped separately (dec-101).

The primary transport is MCP (stdio). A .axon/context.md file in the repo is kept in sync as a fallback for agents without MCP support (dec-103).


Use cases

Agent handoff without context loss

You spend an afternoon with Claude Code, push a branch, then continue the work in Codex the next day. Without AXON, Codex starts cold. With AXON, the MCP tool axon_handoff supplies Codex with the decisions and open questions from the previous session — no copy-pasting required.

Multi-day project continuity

On a project that spans weeks, the important context is not your last five messages but the architectural decisions made three sprints ago. AXON captures decisions from signal commits and explicit captures into Postgres, so axon_search and axon_get_context return what actually matters, not stale history.

Architecture docs from captured decisions

axon export adr and axon export architecture write the captured decisions as structured Markdown notes to an Obsidian vault, turning captured context into living documentation.


How AXON compares

The closest tools are other cross-agent memory/compression layers, not the editing agents (Aider, Cline) whose histories are built-in and single-agent:

AXON claude-mem Headroom Supermemory
Primary goal Decision capture + cross-agent continuity Auto-capture of all session activity Token compression layer Hosted cross-agent memory API
What it captures Decisions at crystallisation points (git / session) Every tool use, continuously Whatever passes through (compresses it) Facts / observations via API
Reversible compression No (removed, dec-137) No Yes (CCR cache) No
Decision capture Yes (commit signals and explicit captures, no LLM) No No (failure-driven learn) No
Governance Per-tool risk class + restricted ctx (ADR-013) <private> tags A/B holdouts / measured savings Access controls
Works across agents Yes (MCP + file fallback) Yes (MCP) Yes (wrap / proxy) Yes (plugins)
Self-hosted Yes Yes Yes Hosted-first

The crowded part of this space is raw recall — tools like agentmemory and Hindsight publish strong LongMemEval scores and optimise for that directly. AXON does not compete on that axis. Its defensible niche is the intersection none of the above combine: capturing decisions (not every keystroke) at git and session boundaries, and gating every MCP tool by risk class with a full audit trail. If you want the best raw recall benchmark, those tools win; if you want decisions and architecture to survive across agents and months, auditably, that is AXON.


Measured results

Current: lesson search after dec-138

dec-138 replaced pgvector with Postgres full-text search. Measured on 2026-10-15 over the 41 real lessons:

Full-text search pgvector
Trigger queries with the expected lesson first 41 of 41 33 of 41
Time per search about 5 ms about 600 ms
English task queries, expected lesson in the top 5 20 of 20 20 of 20
English task queries, expected lesson first 15 of 20 19 of 20
Portuguese queries, expected lesson in the top 5 3 of 5 5 of 5

Note: these figures are kept as measured on 2026-10-15. The original set (the 41 lessons, the 41 trigger queries, the 20 English task queries and the 5 Portuguese queries) was not preserved, so they cannot be reproduced today. The English trigger and task full-text figures will be re-measured on a rebuilt set in F1.1 (embedded storage, #217); pgvector was retired in dec-138 and the Portuguese queries wait for F1.4.

The embeddings table held 578 MB of a 610 MB database. dec-138 removes it, and with it the need for a provider key and a pgvector image.

Test suite: 1528 passed, 3 skipped (python3 -m pytest -q, CI full-suite job, 2026-11-27).

Older figures describe retired subsystems; they are in the git history (git show f898c82d:docs/METRICS.md).


Documentation

Document Contents
CLAUDE.md Architecture decisions, code conventions, agent rules
docs/ADR.md Active architectural decision records
docs/METRICS.md Recomputed performance metrics manifest (dated)
docs/ARD.md Architectural requirements
docs/USAGE_GUIDE.md CLI workflows
docs/VAULT_SETUP.md Obsidian vault bootstrap (stale: describes removed pb commands)
docs/decisions/ Individual decision records (dec-100 to dec-138)
docs/decisions/dec-138-stop-code-vectors.md Code vectorization stopped; AXON is the memory of agent work
docs/decisions/dec-109-tool-tracing-and-risk-gating.md Tool risk classes, policy gate, tracing middleware

Contributing

Start from tests. The repo uses TDD: bugfixes begin with a regression test, features need testable acceptance criteria before implementation.

pytest tests/ -q

See CLAUDE.md for code conventions and agent rules.


Author

Built by sammyjdev, Senior AI Engineer (Forward Deployed).


License

Apache-2.0 — see LICENSE.

About

Agent-agnostic context engine that gives AI coding agents continuous memory across sessions, tools, and machines.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages