Skip to main content

Dhee Developer Brain — local memory, repo cognition, handoff, and proof for AI coding agents

Project description

The shared learning layer for AI agents

Dhee

The local developer brain for AI coding agents.
Persistent memory, repo cognition, handoff, routing, and proof for Codex, Claude Code, Cursor, Gemini CLI, Cline, and any MCP client.

PyPI Python 3.9+ MIT License LongMemEval R@5 99.4%


What Dhee Is

Dhee is a production-ready, local-first context and memory layer for coding agents.

It is not a model, not an autocomplete tool, and not a hosted vector database. It sits beside your agent and keeps the work grounded:

  • Memory that does not rot into noise: canonical facts, preferences, decisions, project rules, passive evidence, test fixtures, and operational events are separated.
  • Repo cognition that survives sessions: symbol graph, imports, calls, route/component map, test map, ownership, historical failures, and impact analysis.
  • Context routing: large files, grep output, logs, test runs, and agent handoffs become compact digests with evidence pointers.
  • Action contracts: before edits, Dhee can compile the task into files, constraints, tests, risk, and proof obligations.
  • Handoff: another agent can continue with the current repo state, decisions, blockers, and next action.

The promise is simple: less prompt sludge, fewer repeated mistakes, better grounded code edits.

Install

pip install dhee
dhee install

Or use the installer:

curl -fsSL https://raw.githubusercontent.com/Sankhya-AI/Dhee/main/install.sh | sh

Then wire a repo:

cd /path/to/repo
dhee init
dhee status
dhee ui

MCP clients can use:

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

How It Helps A Coding Agent

Without Dhee, every turn is a loose pile of files, logs, stale memory, and guesses.

With Dhee, the agent gets a compact working packet:

  1. Recall: relevant user/project memory, current handoff, and repo facts.
  2. Understand: repo brain localizes likely files, symbols, routes, tests, and owners.
  3. Act: task contract controls allowed writes and risky paths.
  4. Verify: tests, diffs, proof bundles, and contamination checks.
  5. Learn: only durable lessons are promoted; junk stays suppressed.

Deep Repo Cognition

Ask: "If I touch this file, what breaks?"

Dhee's repo brain answers with grounded graph evidence:

  • impacted files and symbols
  • impacted routes and React components
  • likely tests to run
  • owners from git history
  • related failure signatures
  • source windows with line numbers, not raw file dumps

The repo brain is git-SHA scoped and persisted under .dhee/context/repo_brain/, so agents do not rebuild understanding from scratch every session.

Memory Quality

Dhee separates memory into classes instead of letting everything compete:

Memory kind What happens
Canonical personal/project facts Durable, high-confidence, slow decay
Passive screen/context observations Raw evidence, not personal truth
Test fixtures and probes Suppressed from normal recall
Operational events Useful for diagnostics, not identity
Repo handoff/session state Scoped to repo and current work

This is what keeps a Chotu/Codex/Claude-style agent from sounding clever one minute and strangely blind the next.

Useful Commands

dhee handoff --repo . --json
dhee context task create "fix flaky auth tests" --repo .
dhee context repo-brain index --repo .
dhee context repo-brain impact dhee/auth.py --repo .
dhee shell "cat /handoff/latest.md"
dhee memory-quality audit --user-id default --json
dhee release check --repo .

Provider Defaults

Dhee can run model-free for repo tooling and handoff. For high-quality semantic memory, the default provider map points to the NVIDIA-compatible OpenAI API stack used in our LongMemEval runs:

dhee key set nvidia
pip install "dhee[nvidia,zvec,mcp]"

Current high-quality stack:

  • Embedder: nvidia/llama-nemotron-embed-vl-1b-v2
  • Reranker: nvidia/llama-3.2-nv-rerankqa-1b-v2
  • Vector backend: zvec through dhee-accel

Benchmarks

On LongMemEval full 500-question recall:

System R@1 R@3 R@5 R@10
Dhee 94.8% 99.0% 99.4% 99.8%

Reproduction notes and outputs live in benchmarks/longmemeval/.

What Is In The Open Source Package

You get the local developer brain: memory OS, repo brain, DheeFS, MCP server, CLI, UI, runtime daemon, handoff bus, update capsules, and release/proof tooling.

Enterprise/team governance, hosted dashboards, org policy, and managed source connectors can build on top of these local primitives. The OSS package is useful by itself and does not require a hosted account.

Develop

pip install -e ".[dev,nvidia,zvec,mcp]"
pytest

License

MIT. Built by Sankhya AI Labs.

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

dhee-7.0.1.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

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

dhee-7.0.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file dhee-7.0.1.tar.gz.

File metadata

  • Download URL: dhee-7.0.1.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dhee-7.0.1.tar.gz
Algorithm Hash digest
SHA256 b0fddd3ed3fc41d1a87093ac24ac9babb29350a4667bb80287e2b86129270bcc
MD5 a681875748c02303ede0bbc2fb4629c5
BLAKE2b-256 a0089cecb9facae61e101b363ed827c6639ff4ef31f7bed8817b5038932c28da

See more details on using hashes here.

File details

Details for the file dhee-7.0.1-py3-none-any.whl.

File metadata

  • Download URL: dhee-7.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dhee-7.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81bf98e03822505c6f90d1fe51213b22e1f0fd1d371212158444ecbfe32c0d89
MD5 9927ee8c37a8488c7bc783c916043a8d
BLAKE2b-256 aaed60b765ad05784bb71e8ad65f5283370d2e34ab014a86d74e424d649831f9

See more details on using hashes here.

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