diff --git a/README.md b/README.md index d8b7f895..215956b8 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Memoh Bot can distinguish and remember requests from multiple humans and bots, w - 🤖 **Multi-Bot Management**: Create multiple bots; humans and bots, or bots with each other, can chat privately, in groups, or collaborate. Supports role-based access control (owner / admin / member) with ownership transfer. - 👥 **Multi-User & Identity Recognition**: Bots can distinguish individual users in group chats, remember each person's context separately, and send direct messages to specific users. Cross-platform identity binding unifies the same person across Telegram, Discord, Lark, and Web. - 📦 **Containerized**: Each bot runs in its own isolated containerd container. Bots can freely execute commands, edit files, and access the network within their containers — like having their own computer. Supports container snapshots for save/restore. -- 🧠 **Memory Engineering**: Hybrid retrieval (dense vector search + BM25 keyword search) with LLM-driven fact extraction. Last 24 hours of context loaded by default, with memory compaction and rebuild capabilities. +- 🧠 **Memory Engineering**: Multi-provider memory architecture — Built-in (off / sparse / dense modes), [Mem0](https://mem0.ai), and OpenViking. LLM-driven fact extraction, hybrid retrieval (dense semantic search + BM25 keyword + neural sparse vectors), 24-hour context loading, memory compaction & rebuild, and multi-language auto-detection. - 💬 **Multi-Platform**: Supports Telegram, Discord, Lark (Feishu), Email, and built-in Web/CLI. Unified message format with rich text, media attachments, reactions, and streaming across all platforms. Cross-platform identity binding. - 📧 **Email**: Multi-adapter email service (Mailgun, generic SMTP) with per-bot binding and outbound audit log. Bots can send and receive emails as a channel. - 🔧 **MCP (Model Context Protocol)**: Full MCP support (HTTP / SSE / Stdio). Built-in tools for container operations, memory search, web search, scheduling, messaging, and more. Connect external MCP servers for extensibility. @@ -95,6 +95,20 @@ Memoh Bot can distinguish and remember requests from multiple humans and bots, w - 🖥️ **Web UI**: Modern dashboard (Vue 3 + Tailwind CSS) with real-time streaming chat, tool call visualization, in-chat file manager, container filesystem browser, and visual configuration for all settings. Dark/light theme, i18n. - 🚀 **One-Click Deploy**: Docker Compose with automatic migration, containerd setup, and CNI networking. Interactive install script included. +## Memory System + +Memoh's memory system is built around **Memory Providers** — pluggable backends that control how a bot stores, retrieves, and manages long-term memory. + +| Provider | Description | +|----------|-------------| +| **Built-in** | Self-hosted, ships with Memoh. Three modes: **Off** (file-based, no vector search), **Sparse** (neural sparse vectors via local model, no API cost), **Dense** (embedding-based semantic search via Qdrant). | +| **Mem0** | SaaS memory via the [Mem0](https://mem0.ai) API. | +| **OpenViking** | Self-hosted or SaaS memory with its own API. | + +Each bot binds one provider. During chat, the bot automatically extracts key facts from every conversation turn and stores them as structured memories. On each new message, the most relevant memories are retrieved via hybrid search and injected into the bot's context — giving it personalized, long-term recall across conversations. + +Additional capabilities include memory compaction (merge redundant entries), rebuild, manual creation/editing, and vector manifold visualization (Top-K distribution & CDF curves). See the [documentation](https://docs.memoh.ai/memory-providers/) for setup details. + ## Gallery diff --git a/README_CN.md b/README_CN.md index bd254be9..826a3e4d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -77,7 +77,7 @@ Memoh Bot 能区分并记忆多人与多 bot 的请求,在任意群聊中无 - 🤖 **多 Bot 管理**:创建多个 bot;人与 bot、bot 与 bot 可私聊、群聊或协作。支持角色权限控制(owner / admin / member)与所有权转让。 - 👥 **多用户与身份识别**:Bot 可在群聊中区分不同用户,分别记忆每个人的上下文,并支持向特定用户单独发送消息。跨平台身份绑定将同一用户在 Telegram、Discord、飞书、Web 上的身份统一关联。 - 📦 **容器化**:每个 bot 运行在独立的 containerd 容器中,可在容器内自由执行命令、编辑文件、访问网络,宛如各自拥有一台电脑。支持容器快照保存与恢复。 -- 🧠 **记忆工程**:混合检索(稠密向量搜索 + BM25 关键词搜索),LLM 驱动的知识抽取。默认加载最近 24 小时上下文,支持记忆压缩与重建。 +- 🧠 **记忆工程**:多供应商记忆架构 —— 内置(off / sparse / dense 三种模式)、[Mem0](https://mem0.ai)、OpenViking。LLM 驱动的知识抽取,混合检索(稠密语义搜索 + BM25 关键词 + 神经稀疏向量),24 小时上下文加载,记忆压缩与重建,多语言自动检测。 - 💬 **多平台**:支持 Telegram、Discord、飞书(Lark)、Email 及内置 Web/CLI。跨平台统一消息格式,支持富文本、媒体附件、表情回应和流式输出。跨平台身份绑定。 - 📧 **邮件**:多适配器邮件服务(Mailgun、通用 SMTP),支持按 bot 绑定与发信审计日志。Bot 可将邮件作为渠道收发。 - 🔧 **MCP(模型上下文协议)**:完整 MCP 支持(HTTP / SSE / Stdio)。内置容器操作、记忆搜索、网络搜索、定时任务、消息发送等工具,可连接外部 MCP 服务器扩展。 @@ -93,6 +93,20 @@ Memoh Bot 能区分并记忆多人与多 bot 的请求,在任意群聊中无 - 🖥️ **Web 管理界面**:基于 Vue 3 + Tailwind CSS 的现代面板,实时流式聊天、工具调用可视化、聊天内文件管理器、容器文件浏览器,所有配置可视化操作。深色/浅色主题,中英文支持。 - 🚀 **一键部署**:Docker Compose 编排,自动迁移、containerd 初始化与 CNI 网络配置。附带交互式安装脚本。 +## 记忆系统 + +Memoh 的记忆系统围绕 **Memory Provider(记忆供应商)** 构建 —— 可插拔的后端,控制 bot 如何存储、检索和管理长期记忆。 + +| 供应商 | 说明 | +|--------|------| +| **Built-in(内置)** | 自托管,随 Memoh 附带。三种模式:**Off**(文件索引,无向量搜索)、**Sparse**(本地神经稀疏向量模型,无 API 费用)、**Dense**(基于嵌入模型的语义搜索,需 Qdrant)。 | +| **Mem0** | 通过 [Mem0](https://mem0.ai) API 的 SaaS 记忆服务。 | +| **OpenViking** | 自托管或 SaaS 记忆服务,使用自有 API。 | + +每个 bot 绑定一个供应商。聊天过程中,bot 自动从每轮对话中抽取关键事实并存储为结构化记忆。收到新消息时,系统通过混合检索找到最相关的记忆并注入 bot 上下文 —— 实现跨对话的个性化长期记忆。 + +其他功能包括记忆压缩(合并冗余条目)、重建、手动创建/编辑,以及向量流形可视化(Top-K 分布与 CDF 曲线)。详见[文档](https://docs.memoh.ai/memory-providers/)。 + ## 图库