Skip to main content

Engram — AI agent memory system with SQLite+FTS5, MCP integration, and quality gates. Canonical distribution (formerly published as 'memorytrace').

Project description

Engram

Persistent memory for AI agents, backed by SQLite + FTS5.

Install

pip install engram-ms

Optional extras:

pip install "engram-ms[llm]"
pip install "engram-ms[semantic]"
pip install "engram-ms[mcp]"
pip install "engram-ms[full]"

The memorytrace distribution name is the legacy alias still on PyPI: pip install memorytrace installs the same engine.

Simple CLI

The default CLI is engram. python -m engram is equivalent.

engram init
engram save "Minseong Jeong is the CTO of Galaxy Corp"
engram find "CTO"
engram who "Minseong Jeong"
engram remember "Minseong Jeong" "Interested in AI and robotics"
engram status

Advanced CLI

Use engram-advanced when you need structured options, JSON output, or a custom DB path.

engram-advanced --db ~/.engram/memory.db search "Galaxy Corp" --max-results 5
engram-advanced --json health

Python SDK

from engram.integrations.sdk import EngramSDK

with EngramSDK() as sdk:
    sdk.start_session("assistant")
    sdk.store("Minseong Jeong is the CTO of Galaxy Corp")
    sdk.add_fact("Minseong Jeong", "Interested in AI and robotics")
    result = sdk.search("Galaxy")
    print(result.to_agent_context())

Source Checkout Compatibility

A repo-local python mem ... wrapper is kept for backward compatibility in source checkouts. It forwards to the same simple CLI as engram, but it is not installed as a packaged console script.

Related packages

The engram namespace on PyPI is reserved for small, focused tools that share this memory model. Sibling packages currently published from this workspace:

Package Status Purpose
engram-ms canonical (0.0.x placeholder, full engine in 0.1.x) The engram-named distribution — preferred install
memorytrace legacy alias The original distribution name; same engine

Docs

  • docs/04-usage-guide/01-quickstart.md
  • docs/01-project-analysis/05-cli-commands.md
  • docs/01-project-analysis/09-setup-guide.md

Workspace Skill

A workspace-local skill package for generating a static project wiki tree lives at .agents/skills/engram-tree.

Generate the site with:

python tools/run_engram_tree.py
python .agents/skills/engram-tree/scripts/build_engram_tree.py --project-root . --output-dir dist/engram-tree

Install the skill for Claude Code and Codex with:

python tools/install_engram_tree_skill.py --dry-run
python tools/install_engram_tree_skill.py --create-missing

Bridge to Claude Code / Codex CLI (engram-ctx)

After pip install engram-ms, register engram-ctx as a memory bridge in your CLI of choice:

# Claude Code
engram-ctx install claude-code

# Codex CLI
engram-ctx install codex

Both installers are idempotent. They register:

  • MCP server engram exposing engram_ctx_index, engram_ctx_search, engram_ctx_stats, engram_ctx_doctor, engram_ctx_purge (in addition to the existing memory_* tools).
  • Lifecycle hooks SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, Stop. Large tool outputs (>500 chars) are auto-indexed into tool_observations (PII-masked, head/tail truncated). Recall via engram_ctx_search.
  • Skill engram-context with caveman-style output compression and routing rules.

For non-hook MCP clients (Cursor, Copilot CLI, OpenCode), use engram.integrations.mcp_middleware.EngramContextMiddleware directly.

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

engram_ms-1.5.1.tar.gz (409.5 kB view details)

Uploaded Source

Built Distribution

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

engram_ms-1.5.1-py3-none-any.whl (231.8 kB view details)

Uploaded Python 3

File details

Details for the file engram_ms-1.5.1.tar.gz.

File metadata

  • Download URL: engram_ms-1.5.1.tar.gz
  • Upload date:
  • Size: 409.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for engram_ms-1.5.1.tar.gz
Algorithm Hash digest
SHA256 664e02699944a451854927debfd708f9060b3463e92fc6b648751ec02d247787
MD5 7c4f3cb412f40faecc31f367509ab664
BLAKE2b-256 61f0161c4965c945ea9f6cb49b7c0bf34ce006f7f490c743494c3c7b0f8f3227

See more details on using hashes here.

File details

Details for the file engram_ms-1.5.1-py3-none-any.whl.

File metadata

  • Download URL: engram_ms-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 231.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for engram_ms-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3fcf5db70068fe0ca9f2c086e188643de405ae7b2da1b5761d933e3686b2fc0
MD5 3a78a683edeff7a685f3a9bba53bb45b
BLAKE2b-256 015f952e942c1a609bcc3e697c53a1e13da9dd57c415e8e5f3bf3e71663be1d0

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