Skip to main content

Self-curating coding preference memory for Claude Code

Project description

Engram

Self-curating coding preference memory for Claude Code.

Engram learns your coding preferences passively during Claude Code sessions, stores them with semantic deduplication, and automatically injects relevant preferences into future sessions — scoped to the language, framework, and repository you're working in.

Quick Start

# Install dependencies
just setup

# Start development server
just dev

# Open the web UI
open http://localhost:3777

How It Works

  1. During coding sessions — when you give feedback like "don't mock the database" or "use frozen dataclasses", Claude Code stores it via the engram MCP server
  2. Between sessions — engram deduplicates, resolves conflicts, and organizes preferences using semantic search and LLM-driven analysis
  3. At session start — a Claude Code hook injects relevant preferences into your CLAUDE.md, scoped to the project's languages and repo

Setup

Prerequisites

  • Python 3.11+
  • uv
  • just
  • An Anthropic API key (set as ANTHROPIC_API_KEY environment variable)

Installation

git clone https://github.com/DannyMor/engram.git
cd engram
just setup

# Install as background service + Claude Code hook
just install

Claude Code MCP Configuration

Add to your Claude Code settings:

{
  "mcpServers": {
    "engram": {
      "url": "http://localhost:3777/mcp"
    }
  }
}

Commands

Command Purpose
just dev Run in foreground with auto-reload
just start / just stop Manage background service
just status Check if service is running
just logs Tail service logs
just install / just uninstall Install/remove service + hook
just check Run lint + typecheck + tests

Configuration

Configuration lives at ~/.engram/config.yaml. Editable via the web UI settings page or directly.

llm:
  provider: anthropic
  model: claude-sonnet-4-6
  api_key_env: ANTHROPIC_API_KEY

embedder:
  provider: fastembed
  model: BAAI/bge-small-en-v1.5

storage:
  path: ~/.engram/data

Web UI

Open http://localhost:3777 to:

  • Browse preferences with search, scope filtering, and tag filtering
  • Chat with the curation agent for bulk cleanup, conflict review, and proactive suggestions
  • Configure LLM provider and model settings

Architecture

Single Python process serving:

  • MCP endpoint at /mcp (HTTP transport for Claude Code)
  • REST API at /api/* (backend for web UI and injection hook)
  • Static web UI at / (Alpine.js + Tailwind CSS)

Memory backend: Mem0 with embedded Qdrant (local vector storage) and fastembed (local embeddings).

Development

just dev        # Start dev server with auto-reload
just test       # Run tests
just lint       # Run ruff
just typecheck  # Run pyright
just check      # All three

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

engramd-0.1.0.tar.gz (180.5 kB view details)

Uploaded Source

Built Distribution

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

engramd-0.1.0-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: engramd-0.1.0.tar.gz
  • Upload date:
  • Size: 180.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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":true}

File hashes

Hashes for engramd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2db9d54c5467e2cdc6915f9a6502a77bb910eca3ba4ec272998b6fc294ae478f
MD5 5fd8a1f16448105c0e832fc6685a2337
BLAKE2b-256 0345447c4a0ea83eef5263e9d362c1eab00d08c5caea85dded22a33e13c8b5d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: engramd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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":true}

File hashes

Hashes for engramd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 769e3381d22fbd938a96a99461559a6eadf2f630d3f8b3efd8e08c7caf5cfdb8
MD5 b00d4595eb2ab94b79a28d7cf66afa41
BLAKE2b-256 05e3f2a259fd8ff814037d47948c36052030e61bea637187e6b6970a292ff20c

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