Show HN: Dev-Mem – Local-first SQLite knowledge graph for AI coding agents Dev-Mem, a local-first SQLite knowledge graph released as the npm package dev-memo, gives AI coding agents including Claude Code, Codex, Cursor and OpenCode a persistent store of decisions, failed approaches, constraints and discoveries that survives session restarts and agent switches. The tool installs hooks into each agent's config directory (.claude/settings.json, .codex/hooks.json, .cursor/hooks.json, or an OpenCode plugin) and injects relevant stored context at session start, keeping all data on the user's machine with no server. Dev-Mem requires Node.js 22+ and an LLM API key for its extraction step, defaulting to claude-haiku-4-5, gpt-5-mini or gemini-3.5-flash, or any OpenAI-compatible endpoint such as Ollama. ██████╗ ███████╗██╗ ██╗ ███╗ ███╗███████╗███╗ ███╗ ██╔══██╗██╔════╝██║ ██║ ████╗ ████║██╔════╝████╗ ████║ ██║ ██║█████╗ ██║ ██║ ██╔████╔██║█████╗ ██╔████╔██║ ██║ ██║██╔══╝ ╚██╗ ██╔╝ ██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║ ██████╔╝███████╗ ╚████╔╝ ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║ ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ Persistent local knowledge store for AI coding agents Preserves development context and catches repeated mistakes across Claude Code, Cursor, Codex, and OpenCode. Dev-Mem gives AI coding agents Claude Code, Codex, Cursor, OpenCode a persistent local knowledge store that survives session restarts and agent switches. It records decisions, failed approaches, constraints, and discoveries your agent makes while coding, and injects the relevant ones at the start of each new session — so the next session doesn't re-investigate what the last one already figured out. Everything stays on your machine. No server, no network dependency beyond your existing LLM API key. - Node.js 22+ - An existing project with at least one of: .claude/ , .codex/ , or .cursor/ already present or a Claude Code project, which creates .claude/ automatically - An LLM API key for the extraction step — any ONE of: - ANTHROPIC API KEY Claude, default: claude-haiku-4-5 - OPENAI API KEY OpenAI, default: gpt-5-mini - GEMINI API KEY or GOOGLE API KEY Gemini, default: gemini-3.5-flash - DEV MEM LLM BASE URL pointed at any OpenAI-compatible endpoint Ollama, Groq, OpenRouter, LM Studio, DeepSeek — no API key required for local Ollama Install Dev-Mem globally to make the dev-memo command available everywhere: npm install -g dev-memo Then, run this once per project from the project root to wire the agent hooks: dev-memo install Or, if you prefer not to install globally, you can prefix all commands in this guide with npx dev-memo Dev-Mem automatically detects which agent directories exist in your project. However, since agents like Codex and Cursor do not auto-create their directories in every repository by default, you can explicitly specify your agent : dev-memo install codex or dev-memo install cursor | Agent Requested / Detected | What it installs | |---|---| | claude-code or nothing found | Claude Code hooks into .claude/settings.json and .claude/hooks/ SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd | | codex | Codex hooks into .codex/hooks.json and .codex/hooks/ SessionStart, PreToolUse, PostToolUse, Stop, SessionEnd | | cursor | Cursor hooks into .cursor/hooks.json and .cursor/hooks/ SessionStart, PreToolUse, PostToolUse, Stop | | opencode | OpenCode plugin into .opencode/plugins/dev-mem.ts and opencode.json | If multiple agent directories exist, hooks are installed for all of them. Example output — Claude Code only: dev-memo hooks installed agents: claude-code Example output — with Cursor detected: dev-memo hooks installed agents: claude-code, cursor Notice for Cursor : Cursor CLI lacks a reliable SessionEnd event. Dev-Mem uses an N-accumulated-events trigger default 10 instead. For a perfect flush when exiting, run your agent via: dev-memo wrap cursor-agent