# Dev-Mem

> Local-first persistent memory for AI coding agents that records decisions, failed approaches and conventions and injects them into later sessions.

Dev-Mem is an open-source, MIT-licensed command-line tool published on npm as dev-memo. It gives AI coding agents such as Claude Code, Codex, Cursor and OpenCode a persistent local knowledge store that survives session restarts and agent switches. The README additionally lists Antigravity support. It records decisions, failed approaches, constraints and discoveries, then injects the relevant ones into later sessions.

## What It Is

Dev-Mem is a memory layer for coding agents. It installs lifecycle hooks into each agent's configuration, records tool calls and git state to a local event log, and turns that log into typed knowledge nodes (Decision, FailedApproach, Constraint, Discovery, Convention, OpenIssue) with evidence pointers such as commits and files. Data is stored in a local SQLite graph inside a `.dev-mem/` directory, with no server and no background daemon.

## How Memory Gets Captured and Injected

At session end, events are compacted and a single batched LLM call extracts knowledge nodes. The call can use an already-authenticated host CLI, a direct API key (Anthropic, OpenAI, Gemini), or an OpenAI-compatible endpoint such as Ollama. At session start and on prompt submission, a scoring pass selects the most relevant nodes within a token budget and injects them as structured context with confidence and recency. Mid-session regression checks warn when files tied to past failed approaches are about to be edited. Secrets such as API keys and `<private>` tagged content are redacted before storage.

## Curation, Git Sharing and MCP

Commands such as `list`, `search`, `review`, `approve`, `edit` and `forget` let users curate memories, while `bootstrap` seeds starter nodes from Git reverts and rule files like AGENTS.md and CLAUDE.md. `dev-memo sync` exports curated nodes to `.dev-mem/shared.jsonl` so teams can share knowledge through Git. `stats` and `view` show telemetry and an offline HTML graph explorer. A zero-daemon MCP server (`dev-memo mcp`) exposes query, regression-check, remember and resolve tools over stdio, and a bundled GitHub Action can add memory context to pull requests.

## Known Limitations

Cursor and OpenCode lack a reliable session-end event, so extraction relies on periodic checkpoints or the `dev-memo wrap` command. Corrupted local state is not repaired automatically.

## Features
- Persistent local SQLite knowledge graph of decisions, failed approaches, constraints, conventions and discoveries
- Automatic context injection at session start and prompt time
- Regression warnings for files tied to past failed approaches
- Secret and private-tag redaction before storage
- Bootstrap from Git reverts and agent rule files
- Interactive review and curation of memories
- Team sharing via .dev-mem/shared.jsonl and MEMORY.md synced through Git
- Zero-daemon MCP server with query, check_regression, remember and resolve tools
- Offline HTML graph explorer and ROI stats
- GitHub Action for PR context
- Parallel git worktree memory sharing
- Flexible extraction backend: host CLI, API key, or local Ollama

## Integrations
Claude Code, Codex, Cursor, OpenCode, Antigravity, Claude Desktop, Anthropic API, OpenAI API, Gemini API, Ollama, Groq, OpenRouter, LM Studio, DeepSeek, GitHub Actions, Git

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, CLI

## Pricing
Open Source

## Version
0.4.1

## Links
- Website: https://www.npmjs.com/package/dev-memo
- Documentation: https://github.com/HarsH-1877/Dev-Mem#readme
- Repository: https://github.com/HarsH-1877/Dev-Mem
- EveryDev.ai: https://www.everydev.ai/tools/dev-mem
