Elastic Brain ZH
Provides tools for persistent knowledge storage, semantic search, and complex entity relationship management within Elasticsearch, featuring advanced Chinese language support through IK Analyzer integration and multi-zone memory management.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Elastic Brain ZH 在‘技术开发’记忆区搜索关于‘人工智能’的观察记录,并列出关联的专家实体"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🧠 Elastic Brain ZH - 中文智能记忆系统
基于Elasticsearch的AI智能记忆系统,专为中文环境优化。通过MCP(Model Context Protocol)协议与Claude Desktop无缝集成,提供持久化知识存储、语义搜索和复杂实体关系管理。
✨ 核心特性
🀄 高级中文支持
IK分词器集成 - 智能中文分词,支持自定义词典
多分析器架构 -
ik_smart精确搜索 +ik_max_word全面索引中英混合处理 - 完美支持中英文混合内容搜索
热更新词典 - 支持远程词典实时更新
🔍 智能搜索引擎
多字段语义搜索 - 名称、类型、观察记录多维度搜索
模糊匹配 - 容错搜索,支持拼写错误纠正
权重优化 - 智能相关性评分和排序
高亮显示 - 搜索结果关键词高亮
🕸️ 知识图谱
实体关系管理 - 复杂实体间关系建模
记忆区域隔离 - 多项目/场景独立记忆空间
动态相关性 - 基于访问频率的智能评分
跨区域关系 - 支持不同记忆区域间的实体关联
🐳 一键部署
Docker集成 - 自动安装ES和IK插件
配置优化 - 预配置的中文搜索mappings
健康检查 - 自动监控服务状态
备份恢复 - 完整的数据备份和恢复机制
Related MCP server: Memory MCP Server
🚀 快速开始
1. 克隆项目
git clone https://github.com/TocharianOU/elastic-brain-zh.git
cd elastic-brain-zh2. 启动中文ES环境
# 一键启动(包含IK插件安装)
./start-chinese-es.sh3. 构建项目
npm install
npm run build4. 配置Claude Desktop
在 ~/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"
}
}
}
}📊 技术架构
核心组件
Elasticsearch 8.18.2 - 搜索引擎核心
IK Analysis Plugin - 中文分词插件
MCP SDK - Model Context Protocol集成
TypeScript - 类型安全的开发体验
分析器配置
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"]}}}'服务器ID搜索
# 搜索: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"]}}}'🛠️ MCP工具接口
实体管理
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" # 根据系统调整内存📈 性能指标
召回准确率: 100%
中文分词质量: 优秀
混合内容处理: 完美支持
搜索响应时间: < 50ms
并发支持: 1000+ QPS
🤝 贡献指南
Fork 项目
创建特性分支 (
git checkout -b feature/AmazingFeature)提交更改 (
git commit -m 'Add some AmazingFeature')推送到分支 (
git push origin feature/AmazingFeature)开启 Pull Request
📄 许可证
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情
🙏 致谢
Elasticsearch - 强大的搜索引擎
IK Analysis - 优秀的中文分词插件
Model Context Protocol - AI上下文协议标准
Claude Desktop - AI助手平台
📞 联系方式
如有问题或建议,请通过以下方式联系:
GitHub Issues: 提交问题
项目讨论: GitHub Discussions
⭐ 如果这个项目对你有帮助,请给我们一个星标!
Available Tools
20 toolsadd_observationsC
Add observations to an existing entity in knowledge graph (memory)
Inputs: name (required), memory_zone (required), observations (required).
copy_entitiesC
Copy entities between zones with optional relation handling.
Inputs: names (required), source_zone (required), target_zone (required), overwrite, +1 more.
create_entitiesC
Create entities in knowledge graph (memory)
Inputs: entities (required), memory_zone (required).
create_relationsC
Create relationships between entities in knowledge graph (memory)
Inputs: relations (required), memory_zone, auto_create_missing_entities.
create_zoneC
Create a new memory zone with optional description.
Inputs: name (required), description, shortDescription.
delete_entitiesC
Delete entities from knowledge graph (memory)
Inputs: names (required), memory_zone (required), cascade_relations.
delete_relationsC
Delete relationships from knowledge graph (memory)
Inputs: relations (required), memory_zone.
delete_zoneA
Delete a memory zone and all its entities/relations.
Inputs: name (required), confirm (required).
get_recentB
Get recently accessed entities from knowledge graph (memory) and their relations
Inputs: memory_zone (required), limit, includeObservations.
get_time_utcA
Get the current UTC time in YYYY-MM-DD hh:mm:ss format
Inputs: no named parameters.
inspect_filesC
Agent driven file inspection that uses AI to retrieve relevant content from multiple files.
Inputs: keywords (required), file_paths (required), include_lines (required), information_needed (required), +1 more.
inspect_knowledge_graphC
Agent driven knowledge graph inspection that uses AI to retrieve relevant entities and relations based on a query.
Inputs: keywords (required), information_needed (required), reason, memory_zone, +3 more.
list_zonesA
List all available memory zones with metadata. When a reason is provided, zones will be filtered and prioritized based on relevance to your needs.
Inputs: reason.
mark_importantB
Mark entity as important in knowledge graph (memory) by boosting its relevance score
Inputs: name (required), important (required), memory_zone (required), auto_create.
merge_zonesC
Merge multiple zones with conflict resolution options.
Inputs: target_zone (required), source_zones (required), delete_source_zones, overwrite_conflicts.
move_entitiesC
Move entities between zones (copy + delete from source).
Inputs: names (required), source_zone (required), target_zone (required), overwrite, +1 more.
open_nodesB
Get details about specific entities in knowledge graph (memory) and their relations
Inputs: names (required), memory_zone (required).
search_nodesA
Search entities using ElasticSearch query syntax. Supports boolean operators (AND, OR, NOT), fuzzy matching (~), phrases ("term"), proximity ("terms"N), wildcards (*, ?), and boosting (^N). Examples: 'meeting AND notes', 'Jon', '"project plan"~2'. All searches respect zone isolation.
Inputs: query (required), reason (required), memory_zone (required), informationNeeded (required), +4 more.
update_entitiesC
Update entities in knowledge graph (memory)
Inputs: entities (required), memory_zone (required).
zone_statsC
Get statistics for entities and relationships in a zone.
Inputs: zone (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have clearly distinct resource+action targets (zone ops, entity CRUD, relation ops, file inspection). The one fuzzy cluster is inspection/retrieval: inspect_knowledge_graph, search_nodes, open_nodes, and get_recent all return entities and relations, and inspect_files vs inspect_knowledge_graph share near-identical phrasing. Descriptions do give each a distinct angle (AI retrieval vs query syntax vs ID lookup vs recency), so confusion is limited but real.
The dominant pattern is verb_noun snake_case (create_entities, delete_relations, move_entities, search_nodes, list_zones), applied consistently across the entity/relation/zone families. Deviations are minor: zone_stats is noun-first, get_recent lacks a noun object, and open_nodes uses an atypical verb for a read. Still highly predictable overall.
At 20 tools the surface is on the heavy side for a memory/knowledge-graph server, and several tools are near-duplicates in intent (inspect_knowledge_graph, search_nodes, open_nodes, get_recent). get_time_utc is also an unrelated utility that doesn't earn a slot in this domain. Each remaining tool does map to a coherent operation, so it is borderline rather than bloated.
Entity lifecycle is fully covered (create/update/delete/read/search) and zones have create/list/delete/merge/stats. However, observations are add-only with no delete_observations or update, and relations can be created and deleted but not updated, forcing delete-and-recreate workarounds. Zone metadata is also immutable after creation, leaving notable gaps.
Maintenance
Related MCP Connectors
Persistent AI memory with semantic search, conflict detection, and ticketing.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Persistent memory and knowledge graph for AI assistants — keyword + vector + graph search.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides a scalable knowledge graph implementation for Model Context Protocol using Elasticsearch, enabling AI models to store and query information with advanced search capabilities, memory-like behavior, and multi-zone architecture.2020MIT
- AlicenseBqualityDmaintenanceProvides dynamic short-term and long-term memory management with keyword-based relevance scoring, time-decay models, and trigger-based recall. Optimized for Chinese language support with jieba segmentation.211BSD 3-Clause
- AlicenseAqualityBmaintenanceAn intelligent memory MCP server that provides AI applications with semantic search, entity extraction, and knowledge graph capabilities using local Redis caching and optional cloud sync. It enables LLMs to store and retrieve long-term context across sessions with high-performance multi-tier storage.1452 npm4MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server providing durable, cross-session memory for AI agents, powered by Qwen on Alibaba Cloud. Enables agents to write, search, recall, and forget memories with semantic ranking.4MIT