MCP 内存存储是一个借助云flare 工作器实现的内存服务,它基于云flare 工作器和 D1 数据库,提供了一套用于存储、检索和管理记忆内容的解决方案,能有效解决记忆数据的存储与管理难题,为用户提供便捷、高效的服务。
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service/cloudflare_worker
Wrangler 是云flare 提供的命令行工具,用于管理和部署工作器。
npm install -g wrangler
使用安装好的 Wrangler 登录你的云flare 账户。
wrangler login
在云flare 平台创建一个新的 D1 数据库实例。
wrangler d1 create mcp_memory_service
根据创建的数据库 ID 更新 wrangler.toml 文件中的数据库配置。
| 工具 | 描述 |
|---|---|
store_memory |
存储新的记忆内容,支持可选标签。 |
retrieve_memory |
根据查询检索相关记忆内容。 |
recall_memory |
使用自然语言的时间表达式检索记忆。 |
search_by_tag |
按标签搜索记忆内容。 |
delete_memory |
根据哈希删除特定记忆。 |
delete_by_tag |
删除所有带有指定标签的记忆。 |
cleanup_duplicates |
识别并删除重复记忆条目。 |
get_embedding |
获取内容的原始嵌入向量。 |
check_embedding_model |
检查嵌入模型是否加载并正常工作。 |
debug_retrieve |
带有调试信息检索记忆。 |
exact_match_retrieve |
使用精确内容匹配检索记忆。 |
check_database_health |
检查数据库健康状态和获取统计信息。 |
recall_by_timeframe |
根据时间范围检索记忆内容。 |
delete_by_timeframe |
删除指定时间段内的记忆内容。 |
delete_before_date |
删除指定日期之前的所有记忆内容。 |