# MenteDB

> An open-source Rust database engineered from scratch for AI agent memory, featuring semantic search, contradiction detection, and transformer-optimized context assembly.

MenteDB is an open-source, Apache 2.0-licensed Rust database built from the ground up as a cognitive memory engine for AI agents. Unlike vector database wrappers, it implements a purpose-built storage engine with HNSW indexing, graph-based belief propagation, and transformer-optimized context assembly. It ships a production MCP server with 32 tools across 6 categories, enabling Claude, Cursor, ChatGPT, and any MCP-compatible client to gain persistent memory with a single URL or CLI command.

- **Sleeptime Enrichment** — *Background pipeline extracts semantic facts, links entities, detects communities, and builds user profiles from raw conversations automatically.*
- **Hybrid Search (BM25 + HNSW + RRF)** — *Combines keyword precision with semantic vector search for best-of-both-worlds memory retrieval.*
- **Contradiction Detection** — *Flags conflicting beliefs the moment they appear, preventing stale or inconsistent memories from polluting AI context.*
- **Pain Signals** — *Records negative feedback and past mistakes, surfacing anti-patterns before the AI repeats them.*
- **Bi-Temporal Validity** — *Memories carry valid_from/valid_until timestamps, enabling point-in-time queries and temporal invalidation instead of deletion.*
- **Phantom Memories** — *Detects knowledge gaps and creates placeholder memories so the AI knows what it does not know.*
- **Speculative Pre-Assembly** — *Predicts upcoming queries and pre-builds context windows, reducing latency and token waste.*
- **MCP Integration (32 tools)** — *Connect via stdio locally or Streamable HTTP remotely; setup takes one CLI command: `npx mentedb-mcp@latest setup copilot`.*
- **Native SDKs** — *Rust, Python, and TypeScript bindings available via `cargo add`, `pip install`, or `npm install`.*
- **Cross-Device Cloud Sync** — *Cloud mode keeps every device synchronized to the same memory store instantly.*
- **API Key Management & Webhooks** — *Dashboard-based key scoping, HMAC-signed webhook payloads, delivery logs, and automatic retries for production deployments.*
- **Token Efficiency** — *Compact format delivers 2.3x fewer tokens than raw JSON; delta savings of ~80% over 20 turns.*

## Features
- Sleeptime enrichment pipeline
- Hybrid BM25 + HNSW + RRF search
- Contradiction detection
- Pain signals for mistake prevention
- Bi-temporal memory validity
- Phantom memory gap detection
- Speculative context pre-assembly
- Stream processing with real-time belief updates
- Write inference at write time
- Trajectory tracking across topic space
- Interference shielding
- LLM cognitive inference for belief compatibility
- 32-tool MCP server
- Cross-device cloud sync
- Native Rust, Python, TypeScript SDKs
- API key management
- Webhooks with HMAC signing and delivery logs
- Graph-based belief propagation
- Delta savings (~80% over 20 turns)
- Point-in-time temporal queries

## Integrations
Claude, Cursor, ChatGPT, GitHub Copilot, VS Code, Windsurf, Claude Desktop, Any MCP-compatible client

## Platforms
WINDOWS, WEB, API, VSC_EXTENSION, DEVELOPER_SDK, CLI

## Pricing
Open Source, Free tier available

## Links
- Website: https://mentedb.com
- Documentation: https://mentedb.com/docs
- Repository: https://github.com/nambok/mentedb
- EveryDev.ai: https://www.everydev.ai/tools/mentedb
