Skip to main content

DevMemory is a long‑term memory for AI coding agents. Make AI knowledge searchable.

Project description

DevMemory 🧠🚀

CI PyPI License: MIT

Track which AI wrote which line of code.

DevMemory automatically captures AI code attribution and makes it queryable. Know which AI tool wrote what, see diffs, and integrate with Sentry for AI-attributed error tracking.


Quick Start

# 1. Install
pip install devmemory

# 2. Setup in your repo (one-time)
cd your-project
devmemory install --mode local

# 3. That's it! Make commits normally
git commit -m "feat: new login"
# ✓ AI attribution auto-synced to SQLite

# 4. Query attributions anytime
devmemory attribution lookup src/main.py 42
devmemory attribution lookup src/main.py 42 --diff  # Show git diff

Everything is automatic — no manual sync needed. After installation, every commit automatically syncs AI attribution data to local SQLite.


What You Get

🔍 Line Attribution

See who wrote any line of code:

devmemory attribution lookup src/auth.py 15

# Output:
# File: src/auth.py
# Line: 15
# Commit: abc123
# ✓ AI-generated
# Tool: opencode
# Model: opencode/trinity-large
# Prompt ID: 7a66807c780f

📝 Git Diff Integration

See the actual changes when the line was added:

devmemory attribution lookup src/auth.py 15 --diff

# Shows:
# - Which commit modified the line
# - Full git diff with syntax highlighting
# - Target line marked with "<<< TARGET LINE"

📜 Attribution History

View all commits that touched a file:

devmemory attribution history src/auth.py

🚨 Sentry Integration

Errors in production show which AI wrote the buggy code:

import sentry_sdk
from devmemory.sentry import create_before_send

sentry_sdk.init(
    dsn="YOUR_SENTRY_DSN",
    before_send=create_before_send(),
)

Sentry events automatically include:

  • ai_tool — which AI wrote the code
  • ai_model — which model was used
  • commit_sha — which commit introduced it
  • prompt_id — link back to the original prompt

Installation Details

Prerequisites

  • Python 3.10+
  • Git AI — auto-installs AI attribution tracking

Setup Steps

# Install DevMemory
pip install devmemory

# Initialize in your repo
devmemory install --mode local

# What this does:
# ✓ Installs git hooks (auto-sync on every commit)
# ✓ Creates .devmemory/attributions.db (SQLite)
# ✓ Configures git-ai for prompt capture

After Installation

Just work normally:

  • Make changes with AI tools (Cursor, Claude, OpenCode etc.)
  • Git AI captures attribution automatically
  • DevMemory syncs to SQLite after each commit
  • Query anytime with devmemory attribution commands

No manual sync needed — it's all automatic!


Commands

Attribution Commands

Command Description
devmemory attribution lookup <file> <line> Who wrote this line?
devmemory attribution lookup <file> <line> --diff Show git diff for this line
devmemory attribution show <file> All attributions for a file
devmemory attribution list List all tracked files
devmemory attribution history <file> Commit history for a file

Utility Commands

Command Description
devmemory status Check system health
devmemory sync --latest Manual sync (only if needed)

How It Works

  1. Capture: Git AI tracks which AI tool wrote each line
  2. Store: DevMemory stores attributions in local SQLite (.devmemory/attributions.db)
  3. Auto-sync: Git hooks sync after every commit — zero manual work
  4. Query: CLI commands query SQLite instantly, offline

Data stays local — works offline, no cloud required.


Cloud Mode COMING SOON...

For teams wanting advanced features:

  • Semantic search across codebase
  • Team analytics dashboard
  • AI agent context integration
  • Shared attribution database
devmemory install --mode cloud --api-key YOUR_KEY

Get API key at aiprove.org


Requirements

  • Python 3.10+
  • Git AI — auto-installed during setup
  • SQLite — included with Python

Stop wondering "who wrote this?" — DevMemory knows.

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

devmemory-0.3.1.tar.gz (149.7 kB view details)

Uploaded Source

Built Distribution

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

devmemory-0.3.1-py3-none-any.whl (82.4 kB view details)

Uploaded Python 3

File details

Details for the file devmemory-0.3.1.tar.gz.

File metadata

  • Download URL: devmemory-0.3.1.tar.gz
  • Upload date:
  • Size: 149.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for devmemory-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8a6cc17c98c97a8d131de0eb8ce5ade1f2414127e4ebfa0f86fb41b45e55cc15
MD5 be278f1e8f6b6b35e7f309da1698bd39
BLAKE2b-256 cedff1ed5e940ebac311cba8dff4989109a3a513babb23416501d30d8cf7c90d

See more details on using hashes here.

File details

Details for the file devmemory-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: devmemory-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 82.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for devmemory-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9763b2cd299e12cc9d33be3ce4ba48c556f1392bea9cc751d06a03d118288bd2
MD5 b217173d170220151c183c6e61d76280
BLAKE2b-256 f8161282cf0248759b68a4715b2684f72af30086ecc4c9453588635d6feb62cd

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