loading…
Search for a command to run...
loading…
An Elasticsearch-based AI memory system optimized for Chinese that enables persistent knowledge storage and complex entity relationship management via the Model
An Elasticsearch-based AI memory system optimized for Chinese that enables persistent knowledge storage and complex entity relationship management via the Model Context Protocol. It features advanced semantic search using the IK analyzer and supports multi-zone memory isolation for specialized knowledge graphs.
Elasticsearch IK Analyzer MCP Docker
基于Elasticsearch的AI智能记忆系统,专为中文环境优化。通过MCP(Model Context Protocol)协议与Claude Desktop无缝集成,提供持久化知识存储、语义搜索和复杂实体关系管理。
ik_smart精确搜索 + ik_max_word全面索引git clone https://github.com/TocharianOU/elastic-brain-zh.git
cd elastic-brain-zh
# 一键启动(包含IK插件安装)
./start-chinese-es.sh
npm install
npm run build
在 ~/Library/Application Support/Claude/claude_desktop_config.json 中添加:
{
"mcpServers": {
"elastic-brain-zh": {
"command": "node",
"args": ["/path/to/elastic-brain-zh/dist/index.js"],
"env": {
"ES_NODE": "http://localhost:9200"
}
}
}
}
chinese_smart_analyzer: # 智能分词,搜索优化
chinese_max_analyzer: # 最大分词,索引优化
mixed_analyzer: # 中英混合分析器
entity_analyzer: # 英文标准分析器
name: # 实体名称
- analyzer: mixed_analyzer
- search_analyzer: chinese_smart_analyzer
- fields: [chinese, english, keyword]
observations: # 观察记录
- analyzer: mixed_analyzer
- search_analyzer: chinese_smart_analyzer
- fields: [chinese, english]
# 搜索:人工智能专家
curl -X POST "localhost:9200/knowledge-graph@default/_search" \
-H 'Content-Type: application/json' \
-d '{"query": {"multi_match": {"query": "人工智能", "fields": ["name^3", "observations"]}}}'
# 搜索:张三的MacBook
curl -X POST "localhost:9200/knowledge-graph@default/_search" \
-H 'Content-Type: application/json' \
-d '{"query": {"multi_match": {"query": "张三 MacBook", "fields": ["name^3", "observations"]}}}'
# 搜索:ubuntu-server-01
curl -X POST "localhost:9200/knowledge-graph@default/_search" \
-H 'Content-Type: application/json' \
-d '{"query": {"multi_match": {"query": "server-01", "fields": ["name^3"]}}}'
create_entities - 创建实体update_entities - 更新实体 delete_entities - 删除实体search_nodes - 搜索节点open_nodes - 获取实体详情create_relations - 创建关系delete_relations - 删除关系list_zones - 列出记忆区域create_zone - 创建新区域delete_zone - 删除区域copy_entities - 复制实体move_entities - 移动实体merge_zones - 合并区域inspect_files - AI驱动文件检查inspect_knowledge_graph - AI驱动图谱检查elastic-brain-zh/
├── src/ # 源码目录
│ ├── index.ts # MCP服务器入口
│ ├── kg-client.ts # 知识图谱客户端
│ ├── es-types.ts # ES类型定义
│ ├── ai-service.ts # AI服务集成
│ └── filesystem/ # 文件系统工具
├── elasticsearch/ # ES配置
│ └── config/analysis-ik/ # IK分词器配置
├── elasticsearch-analysis-ik-8.18.2.zip # IK插件包
├── docker-compose.yml # Docker配置
├── start-chinese-es.sh # 启动脚本
├── update-chinese-mappings.sh # 索引更新脚本
└── CHINESE_SUPPORT.md # 中文支持文档
编辑 elasticsearch/config/analysis-ik/custom/mydict.dic 添加专业词汇:
人工智能
机器学习
知识图谱
语义搜索
配置 elasticsearch/config/analysis-ik/IKAnalyzer.cfg.xml:
<entry key="remote_ext_dict">http://your-server/custom_dict.txt</entry>
# docker-compose.yml
environment:
- "ES_JAVA_OPTS=-Xms2g -Xmx2g" # 根据系统调整内存
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情
如有问题或建议,请通过以下方式联系:
⭐ 如果这个项目对你有帮助,请给我们一个星标!
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"elastic-brain-zh": {
"command": "npx",
"args": []
}
}
}