AI内存层MCP服务器
具有语义搜索和关系跟踪功能的业务和客户智能系统。
它做什么
使用人工智能搜索存储和检索业务信息(产品、服务、位置、时间、政策、事件)和客户数据(行为、偏好、欲望、规则、反馈)。
构建于: 带向量嵌入的HelixDB图形数据库
主要特点
- 两种搜索模式:关键字搜索(快速、准确)和语义搜索(基于意义)
- 客户互动:跟踪产品/服务参与情况及其原因
- 导航系统:使用指南针方位和可访问性信息存储方向
- 智能更新:数据更改时自动维护搜索索引
- 关系发现:查找客户与产品/服务之间的联系
快速开始
1.先决条件
- HelixDB服务器正在运行(默认值:
127.0.0.1:6969) - Rust 1.70+(用于从源代码构建)
2.配置
创建 mcpconfig.toml (参见 mcpconfig.example.toml):
[helix]
endpoint = "127.0.0.1"
port = 6969
[embedding]
# Option 1: Let HelixDB generate embeddings (recommended)
enabled = false
# Option 2: Generate embeddings yourself
enabled = true
provider = "openai" # or "gemini", "local", "tcp"
model = "text-embedding-3-small"
openai_api_key = "sk-..."3.构建和运行
cargo build --release
./target/release/helix-mcp-server或者使用版本中的预构建二进制文件。
LLM集成
克劳德桌面
%APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"ai-memory": {
"command": "E:\\path\\to\\helix-mcp-server.exe"
}
}
}光标/风帆
添加到MCP服务器配置:
{
"mcpServers": {
"ai-memory": {
"command": "E:\\path\\to\\helix-mcp-server.exe"
}
}
}使用示例
店铺经营信息
LLM: create_business_memory(
business_id: "biz123",
memory_type: "product",
data: {
product_id: "prod_001",
name: "Wireless Headphones",
price: 99.99,
description: "Noise-canceling bluetooth headphones"
}
)搜索
# Keyword search (fast, exact)
LLM: search_bm25(
query: "headphones",
memory_types: ["products"]
)
# Semantic search (meaning-based)
LLM: search_semantic(
query: "audio equipment for music lovers",
memory_types: ["products"]
)跟踪客户互动
LLM: create_customer_product_interaction(
customer_id: "cust456",
product_id: "prod_001",
interaction_id: "int_789",
interaction_type: "purchased",
text_reason: "Looking for quality headphones for commute"
)使用自动刷新进行更新
LLM: update_business_memory(
memory_id: "prod_001",
memory_type: "product",
updates: {
composite_text: "Premium noise-canceling wireless headphones with 30hr battery"
}
)
# Automatically updates search indexes- 筛选结果:
Call filter_items(connection_id, {filter_spec}) → Returns filtered items- 搜索操作:
Call search_keyword(connection_id, "query text", "label", 10)
Call search_vector_text(connection_id, "search text", "vec_label")建筑
服务器的结构如下:
main.rs-服务器初始化和工具路由器设置helix_client.rs-HelixDB MCP端点的HTTP客户端tools.rs-MCP工具处理程序实现session.rs-会话管理(最低限度,因为HelixDB处理会话)
与Python实现的比较
这个Rust实现提供了:
- ✅ helix-py MCP服务器的所有工具
- ✅ 相同的API和行为
- ✅ 与所有MCP客户端兼容
- ✅ 更好的性能和更低的内存使用率
- ✅ 独立二进制文件(不需要Python运行时)
- ⚠️ 注:
search_vector(带嵌入器)尚未实现-使用search_vector_text相反
故障排除
“无法连接到HelixDB”
确保HelixDB正在运行:
# Check if HelixDB is running
curl http://127.0.0.1:6969/health启用调试日志记录
$env:RUST_LOG="debug"
./helix-mcp-server可用工具(共22个)
查询和搜索
query_business_memory/query_customer_memory-按条件筛选search_semantic-按意义查找search_bm25-按关键字查找(用于精确匹配/ID)find_customer_insights-发现关系
创建
create_business_memory/create_customer_memory-添加回忆create_customer_product_interaction/create_customer_service_interaction-跟踪交互create_navigation_hub/create_navigation_waypoint/create_direction_path-添加方向
更新
update_business_memory/update_customer_memory-修改记忆update_interaction/update_navigation-修改交互/方向
查询专用
query_customer_interactions/search_customer_interactions-查找交互query_navigation/search_navigation-获取路线
删除
delete_memory-删除任何内存类型
高级
do_query-直接数据库查询(首先使用主要工具)
搜索策略
- 精确匹配? 使用
search_bm25(产品ID、电话号码、确切术语) - 概念的? 使用
search_semantic(查找类似产品、相关想法) - 不确定? 尝试
search_bm25首先,然后search_semantic
故障排除
连接失败:
- 验证HelixDB是否正在运行:
netstat -an | findstr :6969(Windows) - 检查
mcpconfig.toml设置
搜索不返回任何结果:
- 两者都试试
search_bm25和search_semantic - 验证数据是否存在
query_business_memory或query_customer_memory
LLM看不到工具:
- 配置更改后重新启动LLM客户端
- 检查服务器日志是否有错误
建筑
- 22个统一工具 路由到 146+个数据库查询
- 按参数智能布线(无工具爆炸)
- 更新时自动搜索索引维护
- 两种嵌入模式:自我管理或HelixDB生成
文档
IMPLEMENTATION_COMPLETE.md-完整的技术细节QUICK_REFERENCE.md-测试检查表和命令SYSTEM_VALIDATION.md-当前状态报告
