knowledge-graph-memory-semantic-search
A comprehensive knowledge graph memory system with semantic search, episodic memory, working memory, automatic context injection, and per-agent isolation.
от rondoflow★ 37 звёзд на GitHub
Установить knowledge-graph-memory-semantic-search в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
SurrealDB Knowledge Graph Memory v2.2
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.
Description
Use this skill for:
- Semantic Memory — Store and retrieve facts with confidence-weighted vector search
- Episodic Memory — Record task histories and learn from past experiences
- Working Memory — Track active task state with crash recovery
- Auto-Injection — Automatically inject relevant context into agent prompts
- Outcome Calibration — Facts gain/lose confidence based on task outcomes
- Self-Improvement — Scheduled extraction and relation discovery make every agent smarter over time
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,surrealbinary,python3≥3.10
🔄 Self-Improving Agent Loop
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.
The Cycle
[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
What Each Scheduled Job Does
Job 1 — Knowledge Extraction (every 6 hours)
Script: scripts/extract-knowledge.py extract
- Reads
MEMORY.mdand allmemory/YYYY-MM-DD.mdfiles in the workspace - Uses an LLM (GPT-4) to extract structured facts, entities, and key concepts
- Hashes file content to skip unchanged files — only processes diffs
- Stores each fact with:
- A vector embedding (OpenAI
text-embedding-3-small) for semantic search - A
confidencescore (defaults to 0.9) - An
agent_idtag so facts stay isolated to the right agent sourcemetadata pointing back to the originating file
- A vector embedding (OpenAI
- Result: raw conversational knowledge becomes searchable, structured memory
Job 2 — Relationship Correlation (daily at 3 AM)
Script: scripts/extract-knowledge.py discover-relations
- Queries the graph for facts that have no relationships yet ("isolated facts")
- Batches them and asks an LLM to identify semantic connections between them
- Creates
relates_toedges in SurrealDB linking related facts - Result: isolated facts become a connected knowledge web — the agent can now traverse relationships, not just keyword-match
- Over time, the graph evolves from a flat list into a rich semantic network
Job 3 — Deduplication (daily at 4 AM)
Script: scripts/extract-knowledge.py dedupe --threshold 0.92
- Compares all facts using vector similarity (cosine distance)
- Facts above the threshold (92% similar) are flagged as duplicates
- Keeps the higher-confidence fact, removes the duplicate
- Prevents extraction from creating bloat over time
- Result: a clean, non-redundant knowledge base
Job 4 — Reconciliation (weekly, Sundays at 5 AM)
Script: scripts/extract-knowledge.py reconcile --verbose
- Applies time-based confidence decay to aging facts
- Prunes facts that have decayed below minimum confidence
- Cleans orphaned entities with no linked facts
- Consolidates near-duplicate entities
- Result: the knowledge graph stays healthy, relevant, and pruned of stale information
Why This Makes Agents Self-Improving
When auto-injection is enabled, every new conversation starts with the most relevant slice of the accumulated knowledge graph. As the agent:
- Has conversations → writes insights to memory files
- Extraction
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- manifest.json
FAQ
Что делает скилл knowledge-graph-memory-semantic-search?
A comprehensive knowledge graph memory system with semantic search, episodic memory, working memory, automatic context injection, and per-agent isolation.
Как установить скилл knowledge-graph-memory-semantic-search?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл knowledge-graph-memory-semantic-search запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…