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.
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
Symbolnodes 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.
SetANTHROPIC_API_KEYin 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2a65041d53fab11e759c50b7f0b1955a47d8f9df05e624cfc2e698377490b21
|
|
| MD5 |
ba59fc0bc20eb7a95d3efb2f83f64a52
|
|
| BLAKE2b-256 |
b05b476e27d6dcba3dd31266dc7b039ff79760f87a052514ee819a6b3e0f021d
|
Provenance
The following attestation bundles were made for dimagx-0.2.0.tar.gz:
Publisher:
publish_pypi.yml on shmehdi01/dimagx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dimagx-0.2.0.tar.gz -
Subject digest:
c2a65041d53fab11e759c50b7f0b1955a47d8f9df05e624cfc2e698377490b21 - Sigstore transparency entry: 1553511947
- Sigstore integration time:
-
Permalink:
shmehdi01/dimagx@de883413d82e21f7a934b3be004ad716fefafc74 -
Branch / Tag:
refs/tags/v.0.2.0 - Owner: https://github.com/shmehdi01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@de883413d82e21f7a934b3be004ad716fefafc74 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fca1c0ad67be0eca122ea65e40062a40638176815b8614af9e3f8a013830bab
|
|
| MD5 |
26dfb0bf014ac5cf00e1699ac41cc9f3
|
|
| BLAKE2b-256 |
1929791a5a5d6bf4d4a2745e32300207fa8fe73bbf4490176e94c403755076ea
|
Provenance
The following attestation bundles were made for dimagx-0.2.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on shmehdi01/dimagx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dimagx-0.2.0-py3-none-any.whl -
Subject digest:
6fca1c0ad67be0eca122ea65e40062a40638176815b8614af9e3f8a013830bab - Sigstore transparency entry: 1553511952
- Sigstore integration time:
-
Permalink:
shmehdi01/dimagx@de883413d82e21f7a934b3be004ad716fefafc74 -
Branch / Tag:
refs/tags/v.0.2.0 - Owner: https://github.com/shmehdi01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@de883413d82e21f7a934b3be004ad716fefafc74 -
Trigger Event:
release
-
Statement type: