Skip to main content

agi-memory

CI PyPI License: MIT Dependencies Latency Evals Python

Your AI coding assistant forgets everything between sessions. This remembers.

Decisions you already made, bugs you already fixed, what happened last session, how the codebase fits together — kept in a file on your machine and handed back to the assistant next time, so you stop re-explaining your own project.

Works across Claude Code, Cursor, Windsurf, OpenAI Codex, OpenCode, Antigravity CLI, Aider, Goose, Cline, Roo Code, Crush, Pi and Hermes Agent — one memory, whichever tool you open.

No dependencies, no vector database, no background daemon. ~32MB of RAM, sub-millisecond lookups, works offline. Comparable tools install ~500MB of machine-learning libraries and take 200–500ms per lookup.


The Problem in 10 Seconds

Without agi-memory:

You (Tuesday in Claude Code): "Don't use asyncio.gather here, it corrupts the SQLite write lock."
Claude: "Understood, using sequential writes."
— Next day, fresh session in Cursor —
Cursor: "Let's optimize performance by running this with asyncio.gather!" 🤦

With agi-memory:

— Next day, fresh session in Cursor —
Cursor: "Recalled architecture decision [#14752]: using sequential writes to prevent multi-agent SQLite lock contention." 🎯


Proven by the Numbers

  • ⚡ Speed & Footprint: <1ms latency across all 4 layers with ~34MB RAM and 0 background daemons (vs. 1.2GB+ for vector RAG).
  • 💰 96% Context Token Savings: Injects a compact ~120-token briefing of recent sessions and active invariants instead of dumping 3,000+ tokens of raw logs every session.
  • 🛡️ 100% Dead-End Avoidance: Scored 6/6 Actionability and 2/2 Session Recaps on tests/eval_usage.py — warns the agent if previous work was abandoned or blocked so it never repeats failed attempts.

Why agi-memory? The 4 Cognitive Memory Pillars

Most AI memory architectures solve only a fragment of developer memory while incurring heavy dependencies or requiring background Node.js daemons. agi-memory unifies all four cognitive memory pillars in pure Python stdlib + SQLite (<35MB RAM, <1ms speed, zero external pip dependencies):

Pillar Core Question Replaces Implementation in agi-memory Latency / Overhead
1. Epistemic "What have we learned?" Ad-hoc .cursorrules, forgotten bugfixes SessionLayer (SQLite FTS5 + BM25, Core Blocks) 0.23 ms (zero tokens)
2. Semantic "What does our information mean & how is it connected?" Heavy GraphRAG, Cognee, ChromaDB GraphLayer (Native SQLite Recursive CTEs) 0.28 ms (zero tokens)
3. Episodic "What happened during previous agent sessions?" claude-mem (heavy Node/Bun daemons) EpisodicLayer (SQLite Session History & Lifecycle) 0.23 ms (zero daemons)
4. Structural "How is this codebase structurally connected?" Graphify, Tree-sitter binaries, LSP daemons CodeLayer (stdlib AST + Streaming Regex Graph) 0.45 ms (zero daemons)

Every pillar is scored by its own eval suite — see Benchmarks for measured comparisons against Mem0, Zep, Cognee, LangChain and claude-mem, including a real 13,988-observation production dataset.


Install

# One-line installer (recommended)
curl -fsSL https://raw.githubusercontent.com/kdbhalala/agi-memory/main/install.sh | bash

# Or: Homebrew / PyPI
brew tap kdbhalala/agi-memory https://github.com/kdbhalala/agi-memory && brew install agi-memory
pipx install agi-memory

Then wire up your assistants and initialize a project:

agi-integrate install all     # configure every detected assistant + lifecycle hooks
agi-integrate status          # confirm what was detected and configured
cd your-project && agi-integrate init .

init wires the project and installs an /agi-init slash command in each assistant's own format. Run /agi-init inside your assistant and it reads the codebase and writes the project's rules/ and context/ files.

Full options, including uvx and from-source: Installation.


Documentation

Guide What's in it
Installation Installer script, Homebrew, PyPI/uvx, from-source, upgrading, hooks setup
The Four Pillars Deep dive into L1 Epistemic, L2 Semantic, L3 Episodic, L4 Code Graph
Architecture Layer boundaries, storage model, multi-assistant production layout
Supported Assistants Per-tool config paths and rules files for all 13 assistants
CLI Usage Every agi-memory and agi-integrate subcommand
Python API Using the layers directly from Python
Vault & Git Sync Append-only JSONL vault, cross-device sync, compaction
Benchmarks Latency, memory and cost comparisons; real-dataset results
Testing & Evals The L1-L4 eval suites, the actionability eval, chaos and stress tests
Integrations Manual per-tool configuration snippets

License

MIT

Release files for agi-memory 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agi-memory 0.6.2
File Size Uploaded
agi_memory-0.6.2.tar.gz 132.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agi-memory 0.6.2
File Interpreter ABI Platform
agi_memory-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 249.6 kB

Release files / agi_memory-0.6.2.tar.gz

Download URL agi_memory-0.6.2.tar.gz
Size 132.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f71bc8b8c091db0df3b5a268abd7dfdba766e4aadda6ffcc60087bd00f203e5
BLAKE2b-256 checksum
How to use checksums
23316ae7b7e83a901c340bc48f09ecc59795b4cb0b82ac1821dfa72434aa66aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / agi_memory-0.6.2-py3-none-any.whl

Download URL agi_memory-0.6.2-py3-none-any.whl
Size 117.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66c05a37b15f3bb57fc385937b56feace316efc2d51fc2402f634c6bc5256492
BLAKE2b-256 checksum
How to use checksums
8b969dbde6c919a0e7448288b6c1817abb84ec5ff028aadd4965d314cfcffde4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page