Content
# 🛰️ DSM: Dynamic Segmented Memory (MCP Server)
[](https://modelcontextprotocol.io)
[](https://opensource.org/licenses/MIT)
[]()
**DSM** is a high-performance Dynamic Segmented Memory engine implemented as an **MCP (Model Context Protocol)** server.
Unlike traditional vector databases, DSM organizes information into a hierarchy of segments, supports hybrid search, and enables multi-hop reasoning directly over your knowledge base.
---
## 🔌 What is MCP?
The **Model Context Protocol (MCP)** is an open standard that enables AI agents (like Claude Desktop, Cursor, or Windsurf) to securely connect to external data and tools.
By running **DSM as an MCP server**, you give your AI agent a persistent "long-term memory" that it can query, write to, and reason with, using a standardized set of tools.
---
## 🛠️ Features
- **Hybrid Search**: Seamlessly combines Dense (semantic) and Sparse (BM25) search for maximum retrieval precision.
- **Reasoning**: The `dsm_reason` tool allows agents to traverse the memory graph, finding deep connections instead of just keywords.
- **Auto-Sync**: One-click indexing of your entire project via `dsm_sync`.
- **Conflict Control**: Automatically detects contradictory information within the memory.
---
## 🚀 Quick Start
### 1. Install
```bash
pip install mcp dsm-memory
```
### 2. Configure MCP
Add the server to your `claude_desktop_config.json` or `.claude.json`:
```json
{
"mcpServers": {
"dsm": {
"command": "python",
"args": ["path/to/mcp_server.py"],
"env": {
"DSM_PROJECT_ROOT": "/path/to/your/project"
}
}
}
}
```
---
## 🔌 Tools
- `dsm_search`: Fast hybrid search over all memory segments.
- `dsm_write`: Manually commit new insights or architectural data.
- `dsm_reason`: Multi-hop recursive search for deep context.
- `dsm_sync`: Full codebase indexing and synchronization.
- `dsm_info`: Live statistics about the memory state.
---
## 📄 License
MIT ©