{
  "markdown": "<div align=\"center\">\n\n<img src=\"https://raw.githubusercontent.com/AiDimag/aidimag/main/assets/logo.svg\" alt=\"AI Dimag Logo\" width=\"120\" height=\"120\">\n\n# AI Dimag — Verified Memory for AI Coding Agents\n\n**Your coding agent forgets your codebase. AIDimag doesn't.**\n\n[![npm version](https://img.shields.io/npm/v/aidimag?color=blue&logo=npm)](https://www.npmjs.com/package/aidimag)\n[![CI](https://github.com/AiDimag/aidimag/actions/workflows/ci.yml/badge.svg)](https://github.com/AiDimag/aidimag/actions/workflows/ci.yml)\n[![VS Code Marketplace](https://img.shields.io/badge/VS%20Code-v1.0.6-blue?logo=visualstudiocode)](https://marketplace.visualstudio.com/items?itemName=aidimag.aidimag-vscode)\n[![JetBrains Marketplace](https://img.shields.io/jetbrains/plugin/v/33030?label=JetBrains&logo=jetbrains&color=blue)](https://plugins.jetbrains.com/plugin/33030-ai-dimag)\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-6366f1?logo=modelcontextprotocol)](https://registry.modelcontextprotocol.io/?q=aidimag)\n[![aidimag MCP server](https://glama.ai/mcp/servers/AiDimag/aidimag/badges/score.svg)](https://glama.ai/mcp/servers/AiDimag/aidimag)\n[![Product Hunt](https://img.shields.io/badge/Product%20Hunt-AI%20Dimag-da552f?logo=producthunt&logoColor=white)](https://www.producthunt.com/products/ai-dimag?utm_source=other&utm_medium=social)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Documentation](https://img.shields.io/badge/docs-aidimag.com-blue)](https://aidimag.com)\n[![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org)\n\n[**Documentation**](https://aidimag.com) • [**Why AIDimag?**](https://aidimag.com/why-aidimag) • [**Getting Started**](https://aidimag.com/getting-started) • [**Use Cases**](https://aidimag.com/use-cases) • [**Benchmarks**](https://aidimag.com/benchmarks) • [**AI Dimag Cloud**](https://cloud.aidimag.com) • [**Pricing**](https://aidimag.com/pricing)\n\n</div>\n\n---\n\n## What is AI Dimag?\n\n**AI Dimag** is a memory system **for software engineering** — not a general-purpose \"AI memory\" app. It gives any MCP-compatible agent (Claude, Cursor, Copilot, Windsurf…) a **persistent memory of your codebase** that survives across sessions — decisions, conventions, gotchas, failed approaches, **guardrails**, and reusable **skills** — stored as **falsifiable claims with grounding evidence** in `.aidimag/` next to your code.\n\nThe subject of memory is your **repository**, not your preferences or chat history. Every capability — evidence, git-hook verification, guardrails, pre-commit checks, path-scoped recall, session scratchpad — exists to serve day-to-day development work.\n\n### The Difference: Claim-and-Verify, Not Store-and-Retrieve\n\nMost memory systems **store** text and **retrieve** whatever is similar later — a stored fact is assumed true forever. That's dangerous in a codebase, where a confidently-retrieved stale fact is *worse* than no memory at all.\n\nEvery AI Dimag memory carries **evidence** (a shell check, an anchored commit, a test) that `dim verify` re-runs against the current repo — automatically, via git hooks, on every pull, checkout, and rebase. Beliefs that stop being true go **STALE** instead of silently misleading your AI.\n\n### Works with Every AI Tool\n\n- **MCP tools** (Claude, Cursor, etc.) get real-time memory via the MCP server\n- **Non-MCP tools** (Copilot, Windsurf, etc.) get static context files (`.cursorrules`, `CLAUDE.md`, `AGENTS.md`, etc.)\n\n<div align=\"center\">\n<img src=\"https://raw.githubusercontent.com/AiDimag/aidimag/main/assets/hero-illustration.svg\" alt=\"AI Dimag Flow\" width=\"600\">\n</div>\n\n## Install\n\n```sh\nnpm install -g aidimag\n```\n\nRequires Node 22+. Ships two equivalent binaries: `dim` (short) and `aidimag`.\n\n## Quick Start\n\n```sh\ncd your-repo\ndim init                    # creates .aidimag/, installs additive git hooks\ndim bootstrap               # optional: LLM-survey the repo into a starter memory set\ndim review                  # approve what enters memory (nothing is stored unreviewed)\n\ndim remember \"All DB access goes through src/db/store.ts\" -k INVARIANT -p src \\\n  -e \"STATIC_CHECK:! grep -rl better-sqlite3 src --include=*.ts | grep -v store.ts\"\ndim recall db access\ndim verify                  # re-run all evidence; stale beliefs get flagged\ndim brief                   # session-start briefing: in-scope memory, guardrails, gaps\n\n# For non-MCP tools (Copilot, Cursor without MCP, etc.):\ndim generate-context --format all --auto   # creates .cursorrules, CLAUDE.md, AGENTS.md, etc.\n```\n\n### One-command setup\n\n```sh\ndim setup --yes              # init + git hooks + MCP configs for detected agents + context files\ndim setup-ollama             # install Ollama + pull a free local embedding model for semantic search\ndim doctor                   # verify everything is wired correctly\n```\n\n## Connect to Your AI Agent (MCP)\n\nAdd to your agent config (e.g. `.mcp.json` for Claude Code):\n\n```json\n{\n  \"mcpServers\": {\n    \"aidimag\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"aidimag\", \"mcp\"],\n      \"env\": { \"AIDIMAG_REPO\": \"/path/to/your/repo\" }\n    }\n  }\n}\n```\n\n**MCP Tools** get `memory_search`, `memory_propose`, `context_note` (live in-chat fact capture), `chat_harvest` (live, tool-agnostic session harvesting with server-side secret redaction), `memory_critique` (a second critic grounded in verified memory), session-start briefings, session-end extraction, and more.\n\n**Non-MCP Tools**: `dim generate-context -f all` renders verified memory into `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.windsurfrules`, and `.github/copilot-instructions.md` (`--auto` keeps them refreshed).\n\n**Hermes Agent**: `dim hermes install` registers aidimag as a native Hermes memory provider — one command, no pip, no venv. A single stdlib-only Python bridge delegates to the MCP server: session briefings are injected into the system prompt, recall is prefetched per turn, and session learnings become review-queue *proposals* (never silent writes). Then: `hermes config set memory.provider aidimag`.\n\n## Key Features\n\n### Human-Gated Capture\nCommits, PRs, AI-chat transcripts (Claude Code, Codex, Copilot, Cursor), and pasted docs are mined into *proposals*. Nothing enters memory until you approve it in `dim review` (auto-triaged best-first, `approve all --min-score 0.7` for batches).\n\n### Verification Lifecycle\n`STATIC_CHECK` / `COMMIT_REF` / `TEST_RESULT` / `EXEC_TRACE` / `HUMAN_ATTESTED` evidence. Failing evidence flips memories to STALE and auto-drafts a recovery proposal. Confidence decays without re-confirmation.\n\n### Evidence Trust Gate\nShell-command evidence that arrives via team sync is **never executed** until you inspect and approve it (`dim verify --trust`).\n\n### Hybrid Semantic Recall\nFTS5 keyword + vector KNN (OpenAI, local Ollama, or AWS Bedrock; auto-detected except Bedrock, which is explicit opt-in; works keyword-only with none).\n\n### Guardrails & Skills\nBehavioral rules (`never` / `ask-first` / `always`) and step-by-step procedures, enforced by `dim check` (pre-commit) and `memory_critique`.\n\n### Team Mode, Self-Hosted\n`dim serve` + `dim sync`: local-first replicas, device-code login, brain-scoped API keys, hashed credentials, cross-machine verification consensus.\n\n### Knowledgebase Inbox\nDrop design docs / ADRs / PDFs / DOCX into `knowledge/` and they're summarized into reviewed, pinned memories.\n\n### Scratchpad & Provenance Audit\n`dim scratch` (and the `scratchpad_*` MCP tools) hold short-term session notes — TTL-expiring, never synced, never durable memory. `dim audit` lists memories resting on the weakest ground (agent-authored, evidence-free, stale, or long-unverified) so you can fix them up like a dependency audit for your repo's knowledge.\n\n### Web Dashboard & Extensions\n`dim ui` — run checks, session briefings, bootstrap, harvest, and context generation from the browser — plus VS Code and IntelliJ extensions.\n\n## Ticketing Integration\n\nCommits tell you *what* changed; tickets hold the *why*. aiDimag connects to your ticketing system so that context flows into your memory — ticket titles, types, and statuses appear next to mined proposals during `dim review`, and agents can fetch tickets via the `ticket_get` MCP tool.\n\n### Supported providers\n\nJira, GitHub Issues, Linear, GitLab Issues, Azure DevOps, ClickUp, Shortcut, YouTrack, Asana, Trello, Notion, Pivotal Tracker, a custom HTTP middleware, or **Remote** (team sync server — zero local credentials).\n\n### Quick start\n\n```sh\n# Connect a provider (interactive)\ndim ticket connect\n\n# Check status\ndim ticket status\n\n# View a specific ticket\ndim ticket show XXX-2100\n\n# Share credentials with your team (admin)\ndim ticket share\n```\n\n### Per-repo credential storage\n\nTicket credentials are stored **per-repo** in `.aidimag/config.json` under `tickets.token` (with file mode `0o600`), matching the same pattern as cloud sync tokens. Credentials never leak between projects. You can also set the `AIDIMAG_TICKET_TOKEN` environment variable, which takes precedence over the config file.\n\n### Team-shared tickets (Remote provider)\n\nOne admin shares their ticket credential via the sync server (`dim ticket share`). Team members select **\"Remote (team sync server)\"** as their provider — they resolve tickets through the server and hold **zero** ticket credentials locally. When a cloud server is linked, the dashboard auto-discovers the team's ticket provider and shows a **\"Connect now\"** button.\n\n### Branch conventions\n\nDefine a branch-naming convention and have aiDimag warn or block on violations:\n\n```sh\ndim ticket branch-rule        # manage the convention\ndim branch XXX-2100           # create a conforming branch (fetches title for slug)\n```\n\n| Enforcement | Effect |\n|---|---|\n| `off` | No checking |\n| `warn` | Heads-up at branch creation (`post-checkout`) |\n| `push` | Blocks pushing non-conforming branches (`pre-push`) |\n\nFull guide: **[Connecting tickets](https://aidimag.com/guides/tickets)**\n\n## How It Compares\n\nAI Dimag follows a **claim-and-verify** model; other memory systems follow **store-and-retrieve**. The short version:\n\n| | Conversational memory layers | Vector-store memory plugins | Hand-maintained context files | **AI Dimag** |\n|---|---|---|---|---|\n| **Built for** | Chat assistants remembering *users* | General recall over embedded text | Static instructions for coding agents | **Coding agents in a living repo** |\n| **Unit of memory** | Extracted facts / chat summaries | Embedded text chunks | Prose | **Falsifiable, typed claims with evidence** |\n| **How memory gets in** | Automatic capture | Automatic embedding | Manual edits | **Human-gated review queue** |\n| **When the code changes** | Nothing — stored facts stay \"true\" | Nothing | File silently rots | **Evidence re-runs via git hooks; broken claims flip STALE** |\n| **Trust model** | Write-time label, never re-checked | Similarity ≈ trust | \"It's in the file\" | **Verification status + decaying confidence; trust-ranked retrieval** |\n| **Enforcement** | None — injection only | None | Hope the model reads it | **Guardrails + pre-commit `dim check` + `memory_critique`** |\n| **Failure mode** | Confidently recalls outdated facts | Retrieves similar, true or not | Instructions drift from reality | **Says \"this went STALE\" instead of guessing** |\n\nFull comparison: **[aidimag.com/comparison](https://aidimag.com/comparison)**\n\n### vs. named tools\n\nHow aiDimag relates to the memory tools people usually ask about. These solve a\ndifferent problem (remembering *users and conversations*); aiDimag remembers your\n*repository* and proves its memories are still true:\n\n| | **aiDimag** | Mnemosyne | mem0 | Letta | Honcho | SuperMemory | Hindsight | ChromaDB |\n|---|---|---|---|---|---|---|---|---|\n| **Subject of memory** | **Your codebase** | Chat/agent sessions | User & agent facts | Agent's own context | User/peer reasoning | Personal + agent | Agent memory | — (vector DB) |\n| **Local-first** | ✅ SQLite per repo | ✅ SQLite | ⚠️ Hybrid | ❌ Docker+PG | ⚠️ PG+worker | ❌ SaaS | ✅ SQLite | ✅ Embedded |\n| **MCP server** | ✅ Built-in | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |\n| **Verifies memories against code** | ✅ Evidence re-runs via git hooks | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |\n| **Human-gated writes** | ✅ Review queue | ❌ Auto-capture | ❌ Auto | ❌ | ❌ | ❌ | ❌ | — |\n| **Enforcement** | ✅ Guardrails + pre-commit + critique | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |\n| **Open source** | ✅ MIT | ✅ MIT | ✅ Apache 2.0 | ✅ Apache 2.0 | ⚠️ AGPL | ❌ Proprietary | ✅ MIT | ✅ Apache 2.0 |\n| **Published benchmark** | Own suite: 100% staleness detection, 0% FP | BEAM 65.2% / LongMemEval 98.9% R@All@5 (self-reported) | LoCoMo | LoCoMo 83.2% | LongMemEval 90.4% | MemoryBench 85.2% | BEAM 73.4% / LongMemEval 94.6% | — |\n\nChat-memory benchmarks (LoCoMo, LongMemEval, BEAM) score recall over *conversation\nhistories*, so they don't apply to aiDimag — its memory subject is the repo. Instead\naiDimag publishes its own reproducible suite (below), including the metric none of\nthe chat benchmarks measure: **does memory notice when the code changes?**\n\n## Benchmarks\n\nReproducible performance and quality suites live in [`benchmark/`](./benchmark)\n(`npm run bench`, `npm run bench:quality`). Headline results (Apple M4, Node 24,\n10,000-memory brain — full tables at [aidimag.com/benchmarks](https://aidimag.com/benchmarks)):\n\n| Metric | Result |\n|---|---|\n| FTS keyword search | 1.45ms p50 |\n| Vector KNN (768-dim, sqlite-vec) | 4.15ms p50 |\n| Memory writes (transactional, incl. FTS + event log) | ~5,400/s |\n| CLI cold start (`dim --help`) | ~41ms p50 |\n| **Staleness detection** (broken claims → STALE, real git fixture) | **100%** (4/4) |\n| **False positives** (intact claims wrongly flagged) | **0%** (0/4) |\n| Retrieval, keyword queries (Recall@1 / MRR, FTS-only) | 1.00 / 1.00 |\n| Retrieval, paraphrase queries (FTS-only; hybrid closes this gap) | 0.25 / 0.27 |\n\n## Documentation\n\n<table>\n<tr>\n<td width=\"33%\">\n\n**Getting Started**\n- [Installation](https://aidimag.com/getting-started)\n- [Quick Start (5 min)](https://aidimag.com/quickstart)\n- [Cloud Sync](https://aidimag.com/cloud-quickstart)\n\n</td>\n<td width=\"33%\">\n\n**Overview**\n- [Why AIDimag?](https://aidimag.com/why-aidimag)\n- [Use Cases](https://aidimag.com/use-cases)\n- [How it Works](https://aidimag.com/how-it-works)\n- [Web Dashboard](https://aidimag.com/dashboard)\n- [Comparison](https://aidimag.com/comparison)\n- [CLI Reference](https://aidimag.com/cli-reference)\n- [MCP Integration](https://aidimag.com/mcp)\n- [Configuration](https://aidimag.com/configuration)\n\n</td>\n<td width=\"33%\">\n\n**Guides**\n- [Team Sync](https://aidimag.com/guides/team-sync)\n- [Connecting Tickets](https://aidimag.com/guides/tickets)\n- [Guardrails](https://aidimag.com/guides/guardrails)\n- [Context Files](https://aidimag.com/guides/generate-context)\n\n</td>\n</tr>\n</table>\n\nFull documentation: **[aidimag.com](https://aidimag.com)**\n\n---\n\n## Contributing\n\nContributions welcome! See [**CONTRIBUTING.md**](./CONTRIBUTING.md) for dev setup, project principles, and the PR checklist. All participation is governed by our [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n## License & Pricing\n\n**AI Dimag is open source under the [MIT License](./LICENSE)** — free for everyone, any team size, forever. Use it, fork it, embed it.\n\nThe entire local-first product is free: CLI, MCP server, verification, guardrails, skills, IDE extensions, local dashboard, and self-hosted team sync (`dim serve`).\n\nWant team sync without running a server? **[AI Dimag Cloud](https://cloud.aidimag.com)** is an optional managed sync subscription — that's how the project stays funded and open source. See [**Pricing**](https://aidimag.com/pricing).\n\n---\n\n<div align=\"center\">\n\n**Built by [Anup Khanal](https://github.com/anup-khanal)**\n\n[Website](https://aidimag.com) • [Documentation](https://aidimag.com) • [Cloud](https://cloud.aidimag.com) • [npm](https://www.npmjs.com/package/aidimag) • [License](./LICENSE)\n\n</div>\n\n",
  "bytes": 15969,
  "sha": "974c7ea6d0f86f35ec5987591e4c02fa4283021b8e2ebf9f66af7a39e3a7da0c",
  "repo_slug": "aidimag/aidimag",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_anup_khanal_aidimag_d678c669/readme"
}