DUMEdb
DUMEdb is an MCP server for deterministic LMDB-backed AI-agent memory, state mutation, schema management, enterprise intake, and Cabinet session continuity.
Read and query active memory state registers by entity, opcode, or search text.
Commit atomic 32-byte state mutations and auto-register novel schema opcodes.
List schema dictionaries and reset an entity's scratchpad without deleting persistent registers.
Retrieve ADRs, sanitized error diagnostics, incident RCAs, and module-linked context.
Ingest enterprise payloads such as PR proposals, APM stack traces, or incident postmortems into sanitized Markdown cards and state pointers.
Run Cabinet workflows: wake/orient a session, list/record/amend workflow heuristics, and refresh/session-handoff progress.
The OpenAI-compatible /v1 proxy can be used by LangChain clients, injecting DUMEdb state registers into prompts and forwarding streaming completions.
The proxy gateway forwards streaming completions to Ollama upstream models while injecting deterministic state registers into prompts.
Provides an OpenAI-compatible proxy gateway and works with the OpenAI client SDK/base URL, forwarding requests to OpenAI upstream models and injecting deterministic state.
⚡ DUMEdb (Deterministic Unit-Record Memory Engine)
Hardware-aligned, zero-prompt-bloat, byte-structured memory engine, production Model Context Protocol (MCP) server, and drop-in OpenAI-compatible proxy gateway for autonomous AI agents.
⚠️ Alpha Software Notice & Known Ingestion Limitations
DUMEdb is under active engineering refactor.
While the LMDB zero-copy read substrate is sub-microsecond and deterministic, the current file ingestion / hydration pipeline (dume/intake/file_reducer.py) is undergoing a complete overhaul. The legacy fallback parser relies on brittle colon-separation heuristics and does not yet commit full-text payloads directly to LMDB payload_store, which can cause freeform documents (screenplays, legal filings, arbitrary code) to be under-hydrated.
👉 Read our full status & breakdown in KNOWN_ISSUES.md.
🎬 Watch the Official Walkthrough on YouTube:
Stop Force-Feeding Your AI 30,000 Tokens just to remind them who you are! — Featuring Frank, The Sentinel, and real-time live benchmarks.
🧭 Why DUMEdb?
Modern AI agents suffer from context rot, hallucination creep, and quadratic token bills when state is stuffed into raw conversation transcripts or retrieved fuzzily from high-dimensional vector databases.
Traditional Agent Memory (Context Stuffing):
[ System Prompt ] + [ 200 Turn Transcript Dump (85,000 tokens) ] + [ 10 Vector Chunks ] = 💥 Context Rot & High Cost
DUMEdb Memory Substrate:
[ System Prompt ] + [ Discrete 32-Byte Hardware Registers (220 tokens) ] + [ Active Turn ] = ⚡ 100% Deterministic & InstantDUMEdb replaces conversational bloat with discrete, deterministic 32-byte binary registers stored in a memory-mapped database (LMDB). AI models read and mutate active state in microseconds with zero prompt bloat.
Feature | Standard Vector DBs (RAG) | Transcript Context Stuffing | ⚡ DUMEdb Substrate |
State Nature | Probabilistic / Semantic Similarity | Conversational String Append | Hardware-Aligned Discrete Registers |
Lookup Latency | 20 ms – 150 ms (ANN Index search) | 0 ms (In prompt, but quadratic KV) | < 0.8 μs (Zero-Copy LMDB Mmap) |
Deterministic Recall | ❌ No (Prone to Top-K retrieval misses) | ❌ No (Middle-loss attention degradation) | ✅ 100% Exact Opcode Matching |
Token Overhead | 1,000 – 8,000 tokens per query | 20,000 – 120,000 tokens | ~150 – 350 tokens active state |
Cost per Turn | High (Heavy token retrieval) | Exponential / Quadratic cost | Near Zero (Constant KV footprint) |
Offline First | Sometimes | Yes (Until context exhaustion) | 100% Local, Offline & Self-Contained |
Related MCP server: contextgit
🔬 Binary Anatomy: The 32-Byte Unit Record
At the hardware core of DUMEdb is the Unit Record—a strictly aligned, 32-byte C-struct packed without pointer indirection:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| ENTITY_ID (128-bit UUID) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPCODE (uint16) | FLAGS (uint16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TIMESTAMP (uint32 Unix) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| VALUE / PAYLOAD (64-bit) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Entity UUID (16 bytes): Content-addressed or namespace-isolated actor/agent identity.
Opcode (2 bytes): Schema-mapped semantic key (
1001-65534).Flags (2 bytes): Bitfield indicating Active state, Float encoding, or Extension Payload pointer.
Timestamp (4 bytes): Monotonic 32-bit second timestamp.
Value (8 bytes): Inline immediate data (64-bit Int, IEEE-754 Float, Enum index, or SHA-256 payload hash reference).
⚡ Core Subsystems
1. 🔌 Model Context Protocol (MCP) Server (dume.mcp_server)
Full compliance with Anthropic's Model Context Protocol (MCP) specification over standard I/O (stdio):
15 First-Class MCP Tools: Provides direct tools for state reading (
dume_read_state), transactional register mutation (dume_commit_state), filtered queries (dume_query), and dynamic schema cataloging (dume_list_schemas).Autonomous Session Orientation: Full Cabinet integration (
cabinet_wake,cabinet_refresh) enabling zero-turn workspace context hydration.Plug-and-Play IDE Compatibility: Plugs directly into Claude Desktop, Cursor, Antigravity, Windsurf, and Cline with zero external network dependencies.
Self-Healing Background Daemon: Automatically ensures local memory substrates and HTTP inspectors are active whenever the MCP harness starts.
2. 📁 Recursive Directory Ingestion Engine
Ingest entire software repositories, project documentation, or knowledge folders into deterministic state registers with a single call:
Recursive Directory Crawler: Discovers and digests file trees while pruning noise (
.git,node_modules,.venv, binaries).SHA-256 Content Deduplication: Identical files across locations are deduplicated in memory.
Automatic Opcode Minting: Novel fields and parameters automatically mint clean, schema-typed opcodes in the
2001-65534space.Atomic Single-Transaction LMDB Commits: Thousands of registers are persisted in milliseconds.
3. 🔄 OpenAI Universal Proxy Gateway (/v1)
Drop-in compatibility with any AI client: Cursor, Claude Desktop, VS Code (Cline), OpenWebUI, LangChain, or raw cURL.
Intercepts requests pointing to
http://localhost:8095/v1.Injects deterministic state registers (
[DUME_STATE ...]) into the active prompt prefix with microsecond speed.Passes streaming completions transparently to upstream models (Ollama, vLLM, Groq, OpenAI, Anthropic).
Automatically scribes assistant mutations in the background.
4. 🎛️ Dual-View Web Inspector
A visual cockpit for inspecting and managing agent memory in real time:
Dual View: Switch between interactive cards and raw hardware hex dumps.
Real-Time WebSocket Sync: Live updates as agents commit mutations.
Directory Ingestion Modal: Instant folder crawling with one click.
Token Telemetry & KV-Cache Runway: Real-time context monitoring.
5. 🗄️ The Cabinet (Zero-Turn Hydration & Session Continuity Ledger)
The antidote to the "80KB backpack" of conversational bloat and agent amnesia. Instead of force-feeding an AI model 25,000 tokens of raw historical transcripts or running fuzzy filesystem searches (ripgrep) just to figure out "where were we?", The Cabinet provides an instant, deterministic operational compass:
Zero-Turn Orientation (
cabinet_wake): Hydrates the agent with verified operator identity, active memory registers, permanent invariants, and immediate next milestones in a single turn under ~220 tokens with< 0.8 μsLMDB read latency.Predictable Session Handoff (
cabinet_refresh): Before an IDE auto-compaction lobotomizes an agent at 70% context, the Sentinel stamps a high-density tactical receipt—recording completed work, files touched, and immediate next handshakes—allowing fresh sessions to boot with a 99.8% clean context runway.Permanent Invariants & Behavioral Laws (
cabinet_mint_rule): Persists non-negotiable architectural rules, terminology protocols, and operational guardrails into hardware registers that survive restarts and never get washed away in chat history.Tactical Workflow Playbooks (
cabinet_record_workflow): Stores versioned, step-by-step procedures directly in deterministic memory, enabling agents to execute complex operations without re-deriving plans from scratch.Eliminates Filesystem Rummaging: Prohibits expensive, blind directory scans—agents know their exact mission, state, and next moves from the very first turn.
🚀 Quick Start (60 Seconds)
1. Installation
# Clone repository
git clone https://github.com/madbradsmith/DUMEdb.git
cd DUMEdb
# Install editable package
pip install -e .2. Start the Engine & Inspector
# Start server (default port: 8095)
python -m dume --port 8095
# Or on Windows:
Start_DUMEdb_UI.bat
# Or on macOS/Linux:
./start_dumedb.shConsole Output:
=======================================================
🚀 DUMEdb Studio v1.2.2 is Live!
🔗 Web Inspector: http://localhost:8095/inspector/index.html
⚡ Proxy Gateway: http://localhost:8095/v1
=======================================================Open your browser to: http://localhost:8095/inspector/index.html
🔌 Connecting to Your Agent Tools
1. Model Context Protocol (MCP) — Claude Desktop, Cursor, Antigravity
DUMEdb is a native MCP server exposing deterministic memory tools over stdio. Add it to your client configuration:
Claude Desktop (claude_desktop_config.json) or Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"dumedb": {
"command": "python",
"args": ["-m", "dume.mcp_server"],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}Or via Docker:
{
"mcpServers": {
"dumedb": {
"command": "docker",
"args": ["run", "-i", "--rm", "madbradsmith/dumedb"]
}
}
}Key MCP Tools Included:
dume_read_state: Reads active registers for an entity directly from LMDB with zero prompt bloat.dume_commit_state: Transactionally writes 32-byte unit-record registers.dume_query: Queries memory registers with opcode and entity filtering.cabinet_wake: Zero-turn workspace orientation and memory retrieval.cabinet_refresh: Flushes session progress and odometers to disk for the next agent instance.
2. OpenAI Proxy Gateway — Cursor / VS Code (Cline / Continue)
Point your model base URL to the DUMEdb local proxy gateway:
{
"openai.baseUrl": "http://localhost:8095/v1",
"openai.apiKey": "dume-local"
}Python SDK / OpenAI Client
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8095/v1",
api_key="dume-local"
)
response = client.chat.completions.create(
model="llama3",
messages=[
{"role": "user", "content": "What is our current project status?"}
],
extra_headers={"X-Entity-ID": "MadBrad-Nostra-01"}
)
print(response.choices[0].message.content)Ingest a Directory via CLI / cURL
# Via cURL
curl -X POST http://localhost:8095/dume/ingest/directory \
-H "Content-Type: application/json" \
-H "X-Entity-ID: Project-Alpha" \
-d '{"directory_path": "C:/Projects/MyAwesomeRepo", "recursive": true}'# Via Python
from dume.intake.directory_reducer import DirectoryReducer
result = DirectoryReducer.reduce_directory("C:/Projects/MyAwesomeRepo")
print(f"Ingested {result['files_ingested']} files into {result['total_registers_extracted']} registers in {result['duration_ms']}ms.")📐 Architecture Overview
┌────────────────────────────────────────┐
│ Autonomous Agent / IDE / Chat UI │
│ (Cursor, Claude Desktop, LangChain) │
└───────────────────┬────────────────────┘
│ OpenAI-Compatible
▼ HTTP /v1
┌────────────────────────────────────────┐
│ DUME Universal Proxy │
│ - Header entity resolution │
│ - Context prefix assembly (<0.8μs) │
│ - Inline directive parser (!set) │
└───────┬────────────────────────┬───────┘
│ │
Read/Write Mmap │ │ Async Pipeline
▼ ▼
┌────────────────────────────────────┐ ┌─────────────────────────┐
│ LMDB Memory Substrate │ │ Scribe Worker Queue │
│ - 32-Byte Unit Records │ │ - Mutation validation │
│ - Multi-version concurrency (MVCC)│ │ - WebSocket broadcast │
│ - Zero-copy binary struct unpack │ └────────────┬────────────┘
└────────────────────────────────────┘ │
▲ ▼
│ ┌────────────────────────┐
└──────────────┤ Dynamic Schema Dict │
│ - 65k Opcode Manager │
│ - JSON Disk Catalog │
└────────────────────────┘🧪 Testing
DUMEdb includes a comprehensive pytest suite covering the core memory engine, LMDB concurrency, schema dictionaries, directory ingestion, and the OpenAI proxy substrate:
pytest tests/☕ Support & GitHub Sponsors
If DUMEdb has saved your AI agents from context rot, slashed your API token bills, or improved your autonomous workflows, please consider supporting the project:
⭐ Star this repository to help other engineers discover deterministic memory
🗣️ Share the Masterclass with teams building production agent architectures
💼 Custom Features & Enterprise Deployments
Need DUMEdb tailored for a specialized agent framework, private cloud, or enterprise pipeline?
MadBrad is available for hire on a consulting / fee basis for:
Custom Agent Substrates: Custom MCP servers, IDE integrations (Cursor, Claude Code, Windsurf, Antigravity), or tailored schema mappings for your proprietary data.
Enterprise Deployments: Hardened on-premise LMDB memory clusters, automated multi-agent synchronization, and deterministic hydration bridges.
High-Throughput Optimizations: Sub-microsecond binary state architectures for demanding production workloads.
To inquire about custom feature development or enterprise support, reach out via GitHub Sponsors or open a discussion thread on the repository.
📄 License
DUMEdb is licensed under the MIT License. Built for high-performance deterministic agentic computing.
Available Tools
15 toolscabinet_amend_workflowB
Amends or retires an existing workflow heuristic in The Cabinet. Pass retire=True to mark a heuristic as retired when superseded or no longer firing.
Inputs: wf_id (required), move, reason, retire, +1 more. Returns: result
cabinet_list_workflowsB
Returns high-density, low-token list of active heuristics in The Cabinet.
Categories: meta, shape, speed, self_monitoring, posture, protocol, custom.
Use this to pull operational tools without reading thousands of prompt tokens.
Inputs: search, category. Returns: result
cabinet_record_workflowB
Records a new workflow heuristic in The Cabinet when a repeatable pattern has earned its place (Rule WF-M3).
Categories: meta, shape, speed, self_monitoring, posture, protocol, custom.
Automatically assigns next ID, persists to structured ledger, and syncs workflow_notes.md.
Inputs: move (required), title (required), trigger (required), why, +1 more. Returns: result
cabinet_refreshA
Executes the Refresh Protocol (RP) when context hits ~70%.
Writes last_session.md, updates status_block.md, commits state, and confirms
KV-cache is ready for a clean restart.
Optionally records new or retired workflow heuristics discovered during the session.
Inputs: summary (required), next_move (required), entity_id, files_touched, +5 more. Returns: result
cabinet_wakeA
CRITICAL FIRST STEP: Executes the Wake Handshake.
MANDATORY: You MUST call this tool at the very beginning of every new session, or whenever
the user greets you, asks for status, says 'catch me up', 'wake', 'start', 'briefing',
or uses the phrase 'box is the game'.
DO NOT search the filesystem, inspect files, or take any other actions until this tool has been executed.
Validates codeword, ingests compass (status_block.md + last_session.md) in < 250 tokens,
checks DUMEdb state, and returns a tight briefing package with zero bloat.
Inputs: codeword. Returns: result
dume_commit_stateB
Atomically commits a discrete state register mutation to DUMEdb LMDB storage.
Resolves opcode_name from SchemaDictionary (or auto-registers novel schema)
and packs value into a hardware-aligned 32-byte record.
Inputs: value, entity_id, opcode_name. Returns: result
dume_flush_scratchpadB
Resets the conversational scratchpad buffer for the specified entity_id
while keeping persistent DUMEdb LMDB registers intact.
Inputs: entity_id. Returns: result
dume_get_error_detailsB
Returns the sanitized stack trace and diagnostic context for an active error fingerprint card
from ~/.dume/assets/errors/.
Inputs: fingerprint (required). Returns: result
dume_get_incident_rcaB
Returns the root cause analysis and resolution runbook for a logged incident card
from ~/.dume/assets/incidents/.
Inputs: incident_id (required). Returns: result
dume_ingest_enterpriseA
Ingests an enterprise JSON payload (PR design proposal, APM exception stack trace, or incident postmortem ticket).
Scrubs secrets/PII, generates a Markdown card in ~/.dume/assets/, and commits active state pointers to DUMEdb.
Inputs: payload, entity_id, intake_type. Returns: result
dume_list_module_contextB
Returns all known ADRs, active error fingerprints, and unresolved incidents linked to the specified module or system area.
Inputs: module. Returns: result
dume_list_schemasA
Returns active DUMEdb schema dictionary specifications, including both pre-registered
and auto-discovered [AUTO] opcodes.
Inputs: no named parameters. Returns: result
dume_queryC
High-speed associative search across active state registers and extension payloads in DUMEdb. Scans hardware-aligned LMDB state without touching raw filesystem documents or burning token context. Matches opcodes, enum values, structured register names, and text payloads.
Inputs: query (required), limit, entity_id. Returns: result
dume_read_adrB
Returns the content of the target Architectural Decision Record (ADR) markdown file
from ~/.dume/assets/adrs/.
Inputs: adr_id (required). Returns: result
dume_read_stateB
Direct zero-copy LMDB read of active state registers for a given entity_id.
Decodes 32-byte records via SchemaDictionary into a human-readable dictionary.
Inputs: entity_id. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools target clearly distinct resources or lifecycle phases: state registers, ADR/error/incident cards, workflow heuristics, and session wake/refresh. Slight ambiguity exists between dume_read_state and dume_query, and between cabinet_wake and cabinet_refresh, but descriptions make their roles reasonably clear.
Names are consistently namespaced with dume_ or cabinet_ and mostly follow a verb_noun pattern such as list_module_context, commit_state, record_workflow, and get_error_details. A few single-verb names like dume_query, cabinet_wake, and cabinet_refresh are minor deviations but still readable.
With 15 tools, the set is at the upper end of the ideal range but each tool appears to serve a distinct purpose across state management, retrieval, ingestion, session lifecycle, and workflow heuristics. There is no obvious redundancy or bloat.
The surface covers the core lifecycle: wake/refresh, state read/query/commit, enterprise ingestion, ADR/error/incident retrieval, schema listing, and workflow management. Minor gaps remain, such as no explicit entity/module listing or direct ADR/error/incident mutation beyond ingestion, but core workflows are workable.
Related MCP Connectors
Local-first long-term memory for AI agents, with byte-recomputable signed verification receipts.
Persistent engineering memory designed to follow developers across coding agents.
Persistent memory, inline redaction, per-agent access, and code localization for AI agents.
Long-term memory for AI agents: durable records, observable retrieval, governed context assembly.
Related MCP Servers
- AlicenseBqualityCmaintenancePersistent memory engine for AI coding agents. Single Go binary, zero runtime dependencies, MCP-native. Stores, searches, and deduplicates memories across sessions using embedded SQLite with hybrid FTS + semantic search, memory decay, relation graph, and token-budget context assembly.1023MIT
- AlicenseNot gradedqualityDmaintenanceA deterministic, local-first memory engine for AI assistants that provides versioned context management via MCP, enabling token-budgeted context patches with provenance and explainability.Apache 2.0
- FlicenseNot gradedqualityAmaintenanceLocal-first memory for AI agents with evidence-backed recall, deterministic trust verdicts, self-inspection, and a tamper-evident audit history.3-

Lians Agent Memoryofficial
AlicenseAqualityCmaintenanceLocal-first bitemporal memory for AI agents with deterministic supersession, point-in-time recall, erasure proofs, and tamper-evident audit history.917Apache 2.0