Skip to main content

Project brain for coding agents โ€” memory graph for code, prompts, features and PRDs

Project description

DimagX ๐Ÿง 

Project brain for coding agents.
One command. Persistent memory. Switch models freely โ€” your agent always knows where you left off.

View Changelog | Documentation


The Problem

Every time you start a new coding session, your agent reads your entire codebase from scratch. Switch from Claude to Cursor to GPT-4 โ€” you re-explain everything. Your PRDs, decisions, and context live nowhere.

The Solution

DimagX builds a persistent memory graph for your project โ€” code, features, prompts, PRDs, git history, and architectural decisions โ€” and exposes it to any coding agent via MCP.

Without DimagX                    With DimagX
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€             โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
New session โ†’ agent reads         New session โ†’ agent calls
50 files, asks you to             get_context() โ†’ instantly
re-explain everything             oriented, no re-explaining

How It Works

your-project/
โ””โ”€โ”€ .dimagx/              โ† created by dimagx init
    โ”œโ”€โ”€ config.yaml       โ† project identity
    โ”œโ”€โ”€ graph.db          โ† Kuzu embedded graph (gitignored)
    โ””โ”€โ”€ prd/              โ† drop PRDs here

DimagX indexes your codebase into a graph with 8 node types:

Project โ†’ File โ†’ Symbol โ†’ Feature โ†’ Prompt โ†’ PRD โ†’ Decision โ†’ Commit

Your coding agent queries this graph via MCP instead of re-reading everything.


v0.2.0: Semantic Memory & Code Symbols ๐Ÿš€

DimagX now goes deeper than just file names. It understands what's inside your code and can search your memory semantically.

1. Symbol-Level Indexing

Using Tree-sitter, DimagX extracts classes and functions from your code.

  • Filter by Symbol nodes in your memory.
  • Instant access to function definitions and class structures.
  • Supported languages: Python, JavaScript, TypeScript, Go, Rust, Java, and more.

2. Semantic Search (Embeddings)

The query_memory(question) tool now uses Vector Embeddings (sentence-transformers).

  • Doesn't rely on keyword matching.
  • Asks "How do I handle auth?" and finds the relevant PRD, File, and Feature even if they don't contain the word "auth".
  • Local execution โ€” no tokens sent to external embedding providers.

Install

Requirements

  • Python 3.10+
  • pip

From source

git clone https://github.com/yourname/dimagx
cd dimagx
pip install -e .

Verify

dimagx --help

Quick Start

# Go to any project โ€” new or existing
cd my-project

# Initialize DimagX (scans files, git history, builds graph)
dimagx init

# See what's in memory
dimagx status

# See where you left off
dimagx context

All Commands

Project

dimagx init              # Scan project, build memory graph
dimagx status            # Memory dashboard โ€” node counts per layer
dimagx context           # Human summary: features, commits, prompts, PRDs

Features

dimagx feature start "Pricing Engine"   # Tag what you're working on
dimagx feature done  "Pricing Engine"   # Mark it complete
dimagx feature list                      # Show all features + status

PRDs

# Single file (MD, PDF, DOCX, TXT supported)
dimagx prd ingest ./docs/pricing.md

# Bulk โ€” ingest entire folder
dimagx prd ingest --dir ./docs/prd/

# List and inspect
dimagx prd list
dimagx prd show "Pricing Engine"

PRD ingestion requires an Anthropic API key for AI summarization.
Set ANTHROPIC_API_KEY in your environment.

Decisions (Architectural Decision Records)

dimagx decision add      # Interactive โ€” prompts for title, context, choice, reason
dimagx decision list     # Show all decisions

File Watcher

dimagx watch                    # Foreground โ€” auto re-index on file save
dimagx watch --background       # Background daemon
dimagx watch --stop             # Stop background watcher

Git Hook

# Auto-installed on dimagx init if .git exists
# Manual control:
dimagx hook install             # Install post-commit hook
dimagx hook uninstall           # Remove hook

MCP Server

dimagx mcp                      # Start MCP server + show agent config

Connect to Your Coding Agent

Add to your agent config and it automatically calls get_context() at the start of every session.

Claude Code โ€” .claude/mcp.json

{
  "mcpServers": {
    "dimagx": {
      "command": "dimagx-mcp"
    }
  }
}

Cursor / Windsurf โ€” .cursor/mcp.json

{
  "mcpServers": {
    "dimagx": {
      "command": "dimagx-mcp"
    }
  }
}

MCP Tools Available to Your Agent

Tool When to call What it returns
get_context() Start of every session Full project orientation
query_memory(question) Before asking the user anything Relevant memory nodes
log_prompt(text, summary, outcome) After completing a task Stores in graph
add_decision(title, context, choice, reason) After an architectural decision Stored as ADR
get_features(status?) When planning work Feature list
get_files(feature?, language?) When navigating codebase Filtered file list

PRD Ingestion

DimagX reads your PRD, summarizes it with AI, extracts features, and links everything in the graph.

export ANTHROPIC_API_KEY=sk-ant-...

# Single file
dimagx prd ingest ./docs/auth_prd.md

# Bulk folder
dimagx prd ingest --dir ./docs/prd/

Supported formats: .md .pdf .docx .txt

Multi-PRD projects are fully supported โ€” each PRD is a separate node linked to its features:

prd_auth      โ†’ covers โ†’ [OTP Login, Session Mgmt, RBAC]
prd_pricing   โ†’ covers โ†’ [GST Calc, Discount Engine, Charges]
prd_store     โ†’ covers โ†’ [QR Menu, Cart, Online Payment]

Daily Workflow

cd my-project

# Morning โ€” see where you left off
dimagx context

# Start a feature
dimagx feature start "Online Store"

# Start background watcher
dimagx watch --background

# Work normally โ€” files auto-indexed, commits auto-logged

# Log a decision
dimagx decision add

# End of day โ€” check memory
dimagx status

What Gets Stored Automatically

Layer Source How
Files Codebase Auto on init + watch
Git commits Git history Auto on init + post-commit hook
Features You dimagx feature start
PRDs You drop files dimagx prd ingest or auto via watch
Prompts Agent sessions MCP log_prompt()
Decisions You / agent dimagx decision add / MCP

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Your Codebase              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚ dimagx init / watch
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           DimagX Memory Graph           โ”‚
โ”‚  (Kuzu embedded graph DB โ€” .dimagx/)    โ”‚
โ”‚                                         โ”‚
โ”‚  Project โ”€โ”€ File โ”€โ”€ Feature             โ”‚
โ”‚     โ”‚          โ”‚       โ”‚                โ”‚
โ”‚  Commit     Symbol    PRD               โ”‚
โ”‚                โ”‚       โ”‚                โ”‚
โ”‚            Prompt โ”€โ”€ Decision           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚ MCP (stdio)
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Any Coding Agent                โ”‚
โ”‚  Claude Code / Cursor / Windsurf / etc  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Stack

Component Library
Graph DB Kuzu โ€” embedded, no server needed
CLI Typer + Rich
Agent protocol MCP Python SDK
File watcher Watchdog
PRD summarization Anthropic SDK
Code parsing Tree-sitter
Embeddings Sentence-Transformers

Project Structure

dimagx/
โ”œโ”€โ”€ dimagx/
โ”‚   โ”œโ”€โ”€ __init__.py        # Package entry
โ”‚   โ”œโ”€โ”€ cli.py             # All CLI commands
โ”‚   โ”œโ”€โ”€ mcp_server.py      # MCP server + tools
โ”‚   โ”œโ”€โ”€ graph.py           # Kuzu schema (7 nodes, 10 relationships)
โ”‚   โ”œโ”€โ”€ db.py              # DB upsert helpers
โ”‚   โ”œโ”€โ”€ scanner.py         # Stack detection, file scan, git history
โ”‚   โ”œโ”€โ”€ config.py          # .dimagx/config.yaml read/write
โ”‚   โ”œโ”€โ”€ prd.py             # PRD extraction + AI summarization
โ”‚   โ”œโ”€โ”€ watcher.py         # File system watcher
โ”‚   โ”œโ”€โ”€ watcher_daemon.py  # Background daemon entry point
โ”‚   โ”œโ”€โ”€ githook.py         # Git hook installer + commit logger
โ”‚   โ”œโ”€โ”€ commit_log.py      # Called by post-commit hook
โ”‚   โ”œโ”€โ”€ symbols.py         # Tree-sitter symbol extraction
โ”‚   โ””โ”€โ”€ embeddings.py      # Local vector embedding generation
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ setup.py
โ””โ”€โ”€ README.md

Roadmap

  • Semantic search (embeddings) in query_memory
  • Tree-sitter code parsing โ€” function/class level indexing
  • Framework-specific entity extraction (Flutter, React, FastAPI)
  • Bug tracking commands & auto-detection
  • Hierarchical Graph View (dimagx graph)
  • dimagx feature update โ€” add description post-creation
  • Web UI โ€” browser-based memory explorer
  • PyPI publish โ€” pip install dimagx
  • VS Code extension

Contributing

PRs welcome. Please open an issue first for major changes.

git clone https://github.com/yourname/dimagx
cd dimagx
pip install -e .

License

MIT โ€” use it, fork it, build on it.


Built by

@syedhussainmehdi - SYED HUSSAIN MEHDI.

"Dimaag" (ุฏู…ุงุบ) means brain in Urdu/Hindi. DimagX is the brain your coding agent never had.

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

dimagx-0.2.0.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

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

dimagx-0.2.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file dimagx-0.2.0.tar.gz.

File metadata

  • Download URL: dimagx-0.2.0.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dimagx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c2a65041d53fab11e759c50b7f0b1955a47d8f9df05e624cfc2e698377490b21
MD5 ba59fc0bc20eb7a95d3efb2f83f64a52
BLAKE2b-256 b05b476e27d6dcba3dd31266dc7b039ff79760f87a052514ee819a6b3e0f021d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dimagx-0.2.0.tar.gz:

Publisher: publish_pypi.yml on shmehdi01/dimagx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dimagx-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dimagx-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dimagx-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fca1c0ad67be0eca122ea65e40062a40638176815b8614af9e3f8a013830bab
MD5 26dfb0bf014ac5cf00e1699ac41cc9f3
BLAKE2b-256 1929791a5a5d6bf4d4a2745e32300207fa8fe73bbf4490176e94c403755076ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for dimagx-0.2.0-py3-none-any.whl:

Publisher: publish_pypi.yml on shmehdi01/dimagx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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