A comprehensive knowledge graph memory system with semantic search, episodic memory, working memory, automatic context injection, and per-agent isolation.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install surrealdb-knowledge-graph-memory或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install surrealdb-knowledge-graph-memory⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/surrealdb-knowledge-graph-memory/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: surrealdb-memory description: "A comprehensive knowledge graph memory system with semantic search, episodic memory, working memory, automatic context injection, and per-agent isolation." version: 2.2.2 metadata: openclaw: requires: env: - OPENAI_API_KEY - SURREAL_USER - SURREAL_PASS - SURREAL_URL bins: - surreal - python3 primaryEnv: OPENAI_API_KEY emoji: "🧠" homepage: "https://clawhub.com/skills/surrealdb-knowledge-graph-memory" ---
A comprehensive knowledge graph memory system with semantic search, episodic memory, working memory, automatic context injection, and per-agent isolation — enabling every agent to become a continuously self-improving AI.
Use this skill for:
Triggers: "remember this", "store fact", "what do you know about", "memory search", "find similar tasks", "learn from history"
> Security: This skill reads workspace memory files and sends their content to OpenAI for extraction. It registers two background cron jobs and (optionally) patches OpenClaw source files. All behaviors are opt-in or documented. See SECURITY.md for the full breakdown before enabling. > > Required: OPENAI_API_KEY, surreal binary, python3 ≥3.10
---
This is the core concept: every agent equipped with this skill improves itself automatically, with no manual intervention required. Two scheduled cron jobs — knowledge extraction and relationship correlation — run on a fixed schedule and continuously grow the knowledge graph. Combined with auto-injection, the agent gets progressively smarter with each conversation.
[Agent Conversation]
↓ stores important facts via knowledge_store_sync
[Memory Files] ← agent writes to MEMORY.md / daily memory/*.md files
↓ every 6 hours — extraction cron fires
[Entity + Fact Extraction] ← LLM reads files, extracts structured facts + entities
↓ facts stored with embeddings + agent_id tag
[Knowledge Graph] ← SurrealDB: facts, entities, mentions
↓ daily at 3 AM — relation discovery cron fires
[Relationship Correlation] ← AI finds semantic links between facts
↓ relates_to edges created between connected facts
[Richer Knowledge Graph] ← facts are no longer isolated; they form a web
↓ on every new message — auto-injection reads the graph
[Context Window] ← relevant facts + relations + episodes injected automatically
↓
[Better Responses] ← agent uses accumulated knowledge to respond more accurately
↑ new insights written back to memory files → cycle repeats
Script: scripts/extract-knowledge.py extract
MEMORY.md and all memory/YYYY-MM-DD.md files in the workspace - A vector embedding (OpenAI text-embedding-3-small) for semantic search - A confidence score (defaults to 0.9) - An agent_id tag so facts stay isolated to the right agent - source metadata pointing back to the originating file
Script: scripts/extract-knowledge.py discover-relations
relates_to edges in SurrealDB linking related factsScript: scripts/extract-knowledge.py dedupe --threshold 0.92
Script: scripts/extract-knowledge.py reconcile --verbose
When auto-injection is enabled, every new conversation starts with the most relevant slice of the accumulated knowledge graph. As the agent:
...the agent effectively gets smarter with every cycle. It learns from its own outputs, grounds future responses in its accumulated history, and avoids repeating mistakes (via episodic memory and outcome calibration).
The skill requires 5 cron jobs for full self-improving operation. All run as isolated background sessions with no delivery:
| Job Name | Schedule | What it runs | |----------|----------|--------------| | Memory Knowledge Extraction | Every 6 hours (0 /6 ) | extract-knowledge.py extract — extracts facts from memory files | | Memory Relation Discovery | Daily at 3 AM (0 3 *) | extract-knowledge.py discover-relations — AI-powered relationship finding | | Memory Deduplication | Daily at 4 AM (0 4 *) | extract-knowledge.py dedupe --threshold 0.92 — removes duplicate/near-duplicate facts | | Memory Reconciliation | Weekly Sun 5 AM (0 5 0) | extract-knowledge.py reconcile --verbose — prunes stale facts, applies confidence decay, cleans orphans |
> All jobs use sessionTarget: "isolated" with delivery: none. They run in fully isolated background sessions and never fire into the main agent session. A bottom-right corner toast notification appears in the Control UI when each job starts and completes.
Setup commands (run after installation):
# 1. Knowledge Extraction — every 6 hours
openclaw cron add \
--name "Memory Knowledge Extraction" \
--cron "0 */6 * * *" \
--agent main --session isolated --no-deliver \
--timeout-seconds 300 \
--message "Run memory knowledge extraction. Execute: cd SKILL_DIR && source .venv/bin/activate && python3 scripts/extract-knowledge.py extract"
# 2. Relation Discovery — daily at 3 AM
openclaw cron add \
--name "Memory Relation Discovery" \
--cron "0 3 * * *" --exact \
--agent main --session isolated --no-deliver \
--timeout-seconds 300 \
--message "Run memory relation discovery. Execute: cd SKILL_DIR && source .venv/bin/activate && python3 scripts/extract-knowledge.py discover-relations"
...安装 Self-improving Agent Memory Upgrade (SurrealDB) 后,可以对 AI 说这些话来触发它
Help me get started with Self-improving Agent Memory Upgrade (SurrealDB)
Explains what Self-improving Agent Memory Upgrade (SurrealDB) does, walks through the setup, and runs a quick demo based on your current project
Use Self-improving Agent Memory Upgrade (SurrealDB) to a comprehensive knowledge graph memory system with semantic search,...
Invokes Self-improving Agent Memory Upgrade (SurrealDB) with the right parameters and returns the result directly in the conversation
What can I do with Self-improving Agent Memory Upgrade (SurrealDB) in my data & analytics workflow?
将技能文件夹放到 ~/.claude/skills/surrealdb-knowledge-graph-memory/ 目录(个人级,所有项目可用),或 .claude/skills/surrealdb-knowledge-graph-memory/(项目级)。重启 AI 客户端后,用 /surrealdb-knowledge-graph-memory 主动调用,或让 AI 根据上下文自动发现并使用。
Self-improving Agent Memory Upgrade (SurrealDB) 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Self-improving Agent Memory Upgrade (SurrealDB) 可免费安装使用。请查阅仓库了解许可证信息。
A comprehensive knowledge graph memory system with semantic search, episodic memory, working memory, automatic context injection, and per-agent isolation.
Lists the top use cases for Self-improving Agent Memory Upgrade (SurrealDB), with example commands for each scenario
Automate my data & analytics tasks using Self-improving Agent Memory Upgrade (SurrealDB)
Identifies repetitive steps in your workflow and sets up Self-improving Agent Memory Upgrade (SurrealDB) to handle them automatically
Self-improving Agent Memory Upgrade (SurrealDB) 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。