介绍
# Graphiti Knowledge Graph
使用 Graphiti 的 REST API 和动态服务发现来查询和管理您的知识图谱。
## 前置条件
- Neo4j 数据库(图存储) - Qdrant(向量搜索) - Graphiti 服务运行中(默认:http://localhost:8001)
## 工具
### graphiti_search
在知识图谱中搜索相关事实。
**用法:** ```bash bash command:" GRAPHITI_URL=\$({baseDir}/references/env-check.sh) curl -s -X POST \"\$GRAPHITI_URL/facts/search\" \ -H 'Content-Type: application/json' \ -d '{\"query\": \"YOUR_QUERY\", \"max_facts\": 10}' | jq . " ```
### graphiti_add
向知识图谱添加新的片段/记忆。
**用法:** ```bash bash command:" GRAPHITI_URL=\$({baseDir}/references/env-check.sh) curl -s -X POST \"\$GRAPHITI_URL/messages\" \ -H 'Content-Type: application/json' \ -d '{\"name\": \"EPISODE_NAME\", \"content\": \"EPISODE_CONTENT\"}' | jq . " ```
## 动态配置
该技能使用环境发现来自动查找 Graphiti:
1. **Clawdbot 配置**: `clawdbot config get skills.graphiti.baseUrl` 2. **环境变量**: `$GRAPHITI_URL` 3. **默认回退**: `http://localhost:8001`
要更改 Graphiti URL: ```bash export GRAPHITI_URL="http://10.0.0.10:8001" # OR clawdbot config set skills.graphiti.baseUrl "http://10.0.0.10:8001" ```
## 示例
搜索信息: ```bash bash command:" GRAPHITI_URL=\$({baseDir}/references/env-check.sh) curl -s -X POST \"\$GRAPHITI_URL/facts/search\" \ -H 'Content-Type: application/json' \ -d '{\"query\": \"Tell me about Essam Masoudy\", \"max_facts\": 5}' " ```
添加记忆: ```bash bash command:" GRAPHITI_URL=\$({baseDir}/references/env-check.sh) curl -s -X POST \"\$GRAPHITI_URL/messages\" \ -H 'Content-Type: application/json' \ -d '{\"name\": \"Project Update\", \"content\": \"Completed Phase 1 of Clawdbot integration\"}' " ```