Skip to main content

Repo memory for AI agents — every memory has a source, every source gets verified.

Project description

agentic-memory

Open-source repo memory for AI agents — every memory has a source, every source gets verified.

Why

AI agents forget everything between sessions. Existing memory layers (mem0, Zep, LangMem) store text in vector DBs but can't tell you where that knowledge came from or whether it's still true.

agentic-memory enforces a simple rule: No evidence, no memory.

Every memory must cite its source (file path + line number, git commit, URL). Before an agent uses a memory, the citation is automatically re-validated. Stale memories get flagged, not silently served.

How it works

from agentic_memory import Memory, FileRef

mem = Memory("./my-project")

# Store a memory — citation is required
mem.add(
    "This project uses ruff for linting with line-length=120",
    evidence=FileRef("pyproject.toml", lines=(15, 20)),
)

# Query — returns answer + citation status
result = mem.query("What linter does this project use?")
print(result.answer)     # "ruff with line-length=120"
print(result.citations)  # [FileRef("pyproject.toml", L15-20, status=VALID)]

# Validate all memories — find what's gone stale
stale = mem.validate()
# [StaleMemory("ruff config", reason="file content changed at L15")]

Design Principles

  1. No Evidence, No Memoryadd() without a citation raises an error
  2. Validate Before Usequery() re-checks citations by default
  3. Decay What's Stale — confidence drops when evidence changes; invalid memories are deprioritized

Evidence Types

Type What it tracks Validation method
FileRef File path + line range Check file exists, content matches
GitCommitRef Commit SHA + file Verify commit exists in history
URLRef Web URL HTTP HEAD check + content hash
ManualRef Human-provided note No auto-validation (always trusted)

Features

  • Repo-scoped — each repository gets its own memory namespace
  • Local-first — SQLite storage, no external services required
  • Citation-backed — every memory traces back to a verifiable source
  • Auto-validation — stale evidence is detected before it misleads your agent
  • Confidence scoring — memories with invalid citations get deprioritized
  • CLI includedam add, am query, am validate, am status

Installation

pip install agentic-memory

CLI Usage

# Add a memory with file evidence
am add "Uses pytest for testing" --file tests/conftest.py --lines 1-10

# Query memories
am query "What test framework?"

# Validate all memories
am validate

# Show memory status
am status

Roadmap

  • Core SDK — add / query / validate with citation enforcement
  • CLI tool
  • MCP Server — use with Claude Code and other MCP clients
  • Admission control — LLM-based scoring to filter low-value memories
  • REST API server
  • LangChain / LlamaIndex integration
  • Web dashboard

Compared to

mem0 Zep LangMem agentic-memory
Vector search Yes Yes Yes Yes
Forced citations No No No Yes
Source validation No No No Yes
Staleness detection No No No Yes
Repo-scoped No No No Yes
Self-hosted Yes Yes Yes Yes

License

MIT

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

memcite-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

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

memcite-0.1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file memcite-0.1.0.tar.gz.

File metadata

  • Download URL: memcite-0.1.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for memcite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4ced0bacc60b7117f4dd9fb01348f5c778f4b3c1526cbad8ad8d5d3aab9d96c
MD5 cf8b10316b0ec1faaf94852bc0d10944
BLAKE2b-256 c80dfc188343fb81a5bf4342d80dc75404c6985ac5e2b2a56dd10ec331a53622

See more details on using hashes here.

File details

Details for the file memcite-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: memcite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for memcite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcb51fcf45d8981cf37d77156ddb5299785c543e00124970789b50053fe5422d
MD5 47ea020c46df0d7cba68259fd58730f5
BLAKE2b-256 c073085aefce7325c5160937d54bde01ac07e5b77d9dcdca5c40adae5ca63936

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