Skip to main content

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

# One-line install
curl -sSL https://raw.githubusercontent.com/AI-Provenance/ai-dev-memory/main/scripts/install.sh | bash

Or install manually:

# 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.

Metadata

Release files for devmemory 0.3.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 devmemory 0.3.2
File Size Uploaded
devmemory-0.3.2.tar.gz 149.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for devmemory 0.3.2
File Interpreter ABI Platform
devmemory-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 232.2 kB

Release files / devmemory-0.3.2.tar.gz

Download URL devmemory-0.3.2.tar.gz
Size 149.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9920bd8d7866509aa84d57120622324b0c32059f1d32f9d78f61565c499d1ee5
BLAKE2b-256 checksum
How to use checksums
d165d4b3b9ac5b77e1e2a3d88f573641060df366354b1ed75535914a812f7e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / devmemory-0.3.2-py3-none-any.whl

Download URL devmemory-0.3.2-py3-none-any.whl
Size 82.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46b8967de475bbf41c575c4f3174bc8966f0160fbedf9ac9b0544f1897bbefa9
BLAKE2b-256 checksum
How to use checksums
c47f1dbc5905fbaff4f7729cc546c19d0aaa4b3a30102d0192d199a05cc6fffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.33

2 release files

0.1.32

2 release files

0.1.31

2 release files

0.1.30

2 release files

0.1.29

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.26

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

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