--- name: cognee-memory description: On-demand deep-archive knowledge graph (Cognee). ADDITIVE layer over primary RAG + Zep + memory_search — never replaces them, never in hot path. Failover-safe (no paralysis). Use to recall accumulated arsenal/operational knowledge as an entity/relation graph. ---
Cognee Memory Skill (deep archive graph)
Philosophy (per Dr. Wael 2026-06-29)
- ADDITIVE, never destructive. Primary recall stays: builtin
memory_search+ the main RAG (ask.drwaelalkishawi.com) + Zep graph. Cognee is a THIRD on-demand layer. - RED LINE — no paralysis / never stop. Cognee/Gemini/embeddings failure must NEVER block.
cognee_query.query()catches all errors and returnsdegraded=True; the caller keeps using primary RAG + memory_search. Cognee is never in the hot path. - Privacy split (hard rule):
Stack (verified live 2026-06-29)
- Isolated venv:
skills/cognee-memory/venv(uv, Python 3.12). cognee 1.2.2 + transformers + tiktoken + fastembed. - Embeddings: LOCAL
fastembed / intfloat/multilingual-e5-large(1024-dim, Arabic-capable, private, free). - Cognify LLM (non-sensitive):
gemini-3-flash-previewvia Google's OpenAI-compatible endpoint (API key, no Vertex). Key = GEMINI_API_KEY. - Graph + storage: local (kuzu) under
skills/cognee-memory/data(+system). - Measured POC (8KB): prune 2.7s · embed 27.7s · cognify 62.6s · query 10-26s · quality ~70-80%.
Config
cognee_config.configure(mode="cloud"|"local") — embeddings always local; cloud uses Gemini Flash for cognify (non-sensitive), local uses Ollama qwen (sensitive, slow but private).Usage
bash
cd skills/cognee-memory
query the non-sensitive arsenal graph (failover-safe JSON out)
./venv/bin/python3 cognee_query.py "what is the golden fallback chain?"
(re)build the non-sensitive archive graph (one-time / when arsenal changes)
. /data/.openclaw/secrets/env.sh && ./venv/bin/python3 build_full.py
When to use / NOT use
- USE: deep relational recall over accumulated arsenal/operational knowledge when memory_search + RAG are not enough.
- NOT: hot path, every turn, or anything time-critical. Always have memory_search + RAG as primary.
- NEVER feed sensitive data through
mode="cloud". Sensitive = local tier only.
Notes
- Edges/graph build is one-time per corpus; queries are on-demand.
- If
cognee_queryreturnsdegraded=True, fall back to memory_search + RAG (no error to user).