Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README-en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<h1 align="center">MSLM</h1>
<p align="center"><strong>Multi-Scope Local Memory</strong><br/><em>The multi-scope local memory system that keeps AI from forgetting.</em></p>
<p align="center"><code>v4.0.0</code> — Persistent memory for Claude Code, Cursor, Hermes Agent, and any MCP-compatible AI client.</p>
<p align="center"><code>v4.1.0</code> — Persistent memory for Claude Code, Cursor, Hermes Agent, and any MCP-compatible AI client.</p>
</p>

<p align="center">
Expand Down Expand Up @@ -79,9 +79,14 @@ hermes mcp add mslm --command mslm --args mcp

### 🔌 MCP Native
- **33 core tools**: memory storage, semantic retrieval, entity management, session tracking
- **Hermes Agent integration**: one-command registration, natural language invocation
- **Claude Code / Cursor / Windsurf**: works with any MCP-compatible client

### 🧩 Hermes MemoryProvider Plugin
- **Native integration**: no MCP subprocess, zero extra latency
- **Auto context injection**: relevant memories prefetched each turn
- **Scope-aware**: `slm_recall` / `slm_remember` / `slm_status` natively support three-tier scope
- **Zero config**: one YAML line, auto-loaded on Hermes startup

### 📊 Web Dashboard
- Memory network graph visualization
- Retrieval statistics and performance monitoring
Expand Down
9 changes: 7 additions & 2 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<h1 align="center">MSLM</h1>
<p align="center"><strong>Multi-Scope Local Memory</strong><br/><em>让 AI 不再遗忘的多层次本地记忆系统</em></p>
<p align="center"><code>v4.0.0</code> — 为 Claude Code、Cursor、Hermes Agent 等 MCP 兼容 AI 客户端提供持久化记忆。</p>
<p align="center"><code>v4.1.0</code> — 为 Claude Code、Cursor、Hermes Agent 等 MCP 兼容 AI 客户端提供持久化记忆。</p>
</p>

<p align="center">
Expand Down Expand Up @@ -79,9 +79,14 @@ hermes mcp add mslm --command mslm --args mcp

### 🔌 MCP 原生集成
- **33 个核心工具**:记忆存储、语义检索、实体管理、会话追踪
- **Hermes Agent 深度整合**:一键注册,自然语言调用
- **Claude Code / Cursor / Windsurf**:所有 MCP 兼容客户端即装即用

### 🧩 Hermes MemoryProvider 插件
- **原生集成**:无需 MCP 子进程,零额外延迟
- **自动上下文注入**:每轮自动预取相关记忆
- **scope 感知**:`slm_recall` / `slm_remember` / `slm_status` 三工具原生支持三层作用域
- **即配即用**:一行 YAML 配置,Hermes 启动自动加载

### 📊 Web 仪表盘
- 记忆网络图可视化
- 检索统计与性能监控
Expand Down
22 changes: 22 additions & 0 deletions docs/configuration-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ export OPENAI_API_KEY="sk-..."

---

### Hermes Agent MemoryProvider Configuration

MSLM ships with a native Hermes Agent plugin. Configure it in your Hermes `config.yaml`:

```yaml
# ~/.hermes/profiles/<name>/config.yaml
memory:
provider: superlocalmemory # Enable MSLM MemoryProvider
superlocalmemory:
mslm_profile: default # MSLM profile to use
prefetch_limit: 10 # auto-injected memories per turn (default 10)
include_global: true # include global-scope memories
include_shared: true # include shared memories
mslm_data_dir: "" # custom data dir (empty = default)
```

Once configured, Hermes auto-loads the plugin on startup — no `hermes mcp add` needed.

> See [Hermes Agent Integration Guide](hermes-agent-guide-en.md)

---

## Config File

All settings live in:
Expand Down
22 changes: 22 additions & 0 deletions docs/configuration-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ export OPENAI_API_KEY="sk-..."

---

### Hermes Agent MemoryProvider 配置

MSLM 提供 Hermes Agent 原生插件,在 Hermes 配置文件 (`config.yaml`) 中配置:

```yaml
# ~/.hermes/profiles/<name>/config.yaml
memory:
provider: superlocalmemory # 启用 MSLM MemoryProvider
superlocalmemory:
mslm_profile: default # 使用的 MSLM 配置文件
prefetch_limit: 10 # 每轮自动注入记忆数(默认 10)
include_global: true # 是否检索全局作用域记忆
include_shared: true # 是否检索共享记忆
mslm_data_dir: "" # 自定义数据目录(留空使用默认)
```

配置后 Hermes 启动时自动加载,无需额外 `hermes mcp add`。

> 详见 [Hermes Agent 集成指南](hermes-agent-guide-zh.md)

---

## 配置文件

所有设置存储在:
Expand Down
21 changes: 19 additions & 2 deletions docs/getting-started-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pip install mslm-memory
Verify:

```bash
mslm --version # Should output 4.0.0+
mslm --version # Should output 4.1.0+
mslm doctor # Check dependency integrity
```

Expand Down Expand Up @@ -61,7 +61,7 @@ Verify after startup:

```bash
curl -s http://127.0.0.1:8765/health | python3 -m json.tool
# {"status":"ok","pid":12345,"engine":"initialized","version":"4.0.0"}
# {"status":"ok","pid":12345,"engine":"initialized","version":"4.1.0"}
```

### Built-in Daemon Capabilities
Expand Down Expand Up @@ -137,6 +137,23 @@ Three-tier scope:
| `global` | All Agents | Shared knowledge, team conventions |
| `shared` | Specified Agent list | Collaborative information |

### 4.5 Hermes MemoryProvider Plugin (Recommended)

Beyond MCP, MSLM provides a native Hermes Agent MemoryProvider plugin — no MCP subprocess overhead, lower latency:

```yaml
# ~/.hermes/profiles/<name>/config.yaml
memory:
provider: superlocalmemory
superlocalmemory:
mslm_profile: my_profile # MSLM profile name
prefetch_limit: 10 # auto-injected memories per turn
```

Once configured, no `hermes mcp add` needed — Hermes auto-loads the plugin on startup, providing three native tools: `slm_recall`, `slm_remember`, `slm_status`.

> See [Hermes Agent Integration Guide](hermes-agent-guide-en.md) for details.

---

## 5. Network & Proxy
Expand Down
21 changes: 19 additions & 2 deletions docs/getting-started-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pip install mslm-memory
验证:

```bash
mslm --version # 应输出 4.0.0+
mslm --version # 应输出 4.1.0+
mslm doctor # 检查依赖完整性
```

Expand Down Expand Up @@ -61,7 +61,7 @@ mslm restart # 一键重启(杀僵尸 + 清理 + 启动 + 健康检查

```bash
curl -s http://127.0.0.1:8765/health | python3 -m json.tool
# {"status":"ok","pid":12345,"engine":"initialized","version":"4.0.0"}
# {"status":"ok","pid":12345,"engine":"initialized","version":"4.1.0"}
```

### Daemon 内置能力
Expand Down Expand Up @@ -137,6 +137,23 @@ hermes mcp remove mslm # 移除
| `global` | 所有 Agent | 通用知识、团队规范 |
| `shared` | 指定 Agent 列表 | 协作信息 |

### 4.5 Hermes MemoryProvider 插件方式(推荐)

除 MCP 外,MSLM 提供 Hermes Agent 原生 MemoryProvider 插件,无需 MCP 进程通信,延迟更低:

```yaml
# ~/.hermes/profiles/<name>/config.yaml
memory:
provider: superlocalmemory
superlocalmemory:
mslm_profile: my_profile # MSLM 配置文件名称
prefetch_limit: 10 # 每轮自动注入记忆数
```

配置后无需 `hermes mcp add` — Hermes 启动时自动加载,提供 `slm_recall`、`slm_remember`、`slm_status` 三个原生工具。

> 详见 [Hermes Agent 集成指南](hermes-agent-guide-zh.md)

---

## 5. 网络与代理
Expand Down
21 changes: 21 additions & 0 deletions docs/memory-import-guide-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,27 @@ curl -X POST http://localhost:8765/api/import \

---

## Method 4: Import via Hermes MemoryProvider

With the Hermes native plugin, you can import memories directly in a Hermes session — no MCP setup needed:

```python
# Batch import (call within Hermes session)
memories = [
{"content": "Team convention: use snake_case for all API responses", "scope": "global"},
{"content": "Personal preference: use pnpm over npm", "scope": "personal"},
{"content": "Project key rotation policy", "scope": "shared", "shared_with": "backend_agent"},
]
for m in memories:
slm_remember(m["content"], scope=m.get("scope", "personal"),
shared_with=m.get("shared_with", ""))
```

> MemoryProvider supports full `scope`/`shared_with` parameters — the simplest way to bulk-import three-tier scope memories.
> See [Hermes Agent Integration Guide](hermes-agent-guide-en.md)

---

## Common Import Scenarios

### Scenario 1: Migrate from Mem0 / LangChain Memory
Expand Down
21 changes: 21 additions & 0 deletions docs/memory-import-guide-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,27 @@ curl -X POST http://localhost:8765/api/import \

---

## 方式四:通过 Hermes MemoryProvider 导入

使用 Hermes 原生插件可在 Hermes 会话中直接导入记忆,无需额外配置 MCP:

```python
# 批量导入(在 Hermes 会话中调用)
memories = [
{"content": "团队约定:所有 API 响应使用 snake_case 命名", "scope": "global"},
{"content": "个人偏好:使用 pnpm 而非 npm", "scope": "personal"},
{"content": "项目密钥轮换规则", "scope": "shared", "shared_with": "backend_agent"},
]
for m in memories:
slm_remember(m["content"], scope=m.get("scope", "personal"),
shared_with=m.get("shared_with", ""))
```

> MemoryProvider 支持完整的 `scope`/`shared_with` 参数,是批量导入三层作用域记忆的最简方式。
> 详见 [Hermes Agent 集成指南](hermes-agent-guide-zh.md)

---

## 常见导入场景

### 场景一:从 Mem0 / LangChain Memory 迁移
Expand Down
16 changes: 16 additions & 0 deletions docs/multi-scope-memory-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ mslm entity list --scope global
mslm entity merge <source_id> <target_id>
```

### Hermes MemoryProvider

With the Hermes MemoryProvider plugin, scope is controlled via tool parameters:

```python
# Store memories with different scopes
slm_remember("Personal preference: prefer functional programming", scope="personal")
slm_remember("React 18 supports concurrent features", scope="global")
slm_remember("Internal API key rotation policy", scope="shared", shared_with="backend_agent")

# Control scope visibility during recall
slm_recall("React concurrent features", include_global=True, include_shared=False)
```

> See [Hermes Agent Integration Guide](hermes-agent-guide-en.md#5-multi-scope-memory) for details.

---

## 5. Multi-Agent Collaboration Examples
Expand Down
16 changes: 16 additions & 0 deletions docs/multi-scope-memory-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ mslm entity list --scope global
mslm entity merge <源ID> <目标ID>
```

### Hermes MemoryProvider

使用 Hermes MemoryProvider 插件时,scope 通过工具参数控制:

```python
# 存储不同作用域的记忆
slm_remember("个人偏好:喜欢函数式编程", scope="personal")
slm_remember("React 18 支持并发特性", scope="global")
slm_remember("内部 API 密钥轮换规则", scope="shared", shared_with="backend_agent")

# 检索时控制作用域范围
slm_recall("React 并发特性", include_global=True, include_shared=False)
```

> 详见 [Hermes Agent 集成指南](hermes-agent-guide-zh.md#5-三层作用域记忆multi-scope-memory)

---

## 5. 多 Agent 协作示例
Expand Down
4 changes: 2 additions & 2 deletions docs/slm/upstream-contribution-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ MSLM 的核心价值层(独立于引擎变更):

| 平台 | 包名 | 版本 | 状态 |
|------|------|------|:--:|
| PyPI | `mslm-memory` | 4.0.0 | ✅ 已发布 |
| npm | `mslm-memory` | 4.0.0 | ✅ 已发布 |
| PyPI | `mslm-memory` | 4.1.0 | ✅ 已发布(基于上游 v3.6.16) |
| npm | `mslm-memory` | 4.1.0 | ✅ 已发布(基于上游 v3.6.16) |
| 文档 | `docs/` (中英双语) | — | ✅ 已完成 |
| Hermes Provider | 设计规格 v1 | — | ✅ Spec 已完成,待实现 |

Expand Down
Loading
Loading