Graph-backed cognitive context engine for OpenClaw. Brain transplant for your AI lobster.
name: kongbrain description: Graph-backed persistent memory engine for OpenClaw. Replaces the default context window with SurrealDB + vector embeddings that learn across sessions. version: 0.5.0 homepage: https://github.com/42U/kongbrain metadata: openclaw: requires: bins: - surreal env: - SURREAL_URL - SURREAL_USER - SURREAL_PASS - SURREAL_NS - SURREAL_DB primaryEnv: SURREAL_URL install: - kind: node package: kongbrain bins: []
Graph-backed persistent memory engine for OpenClaw. Replaces the default context window with SurrealDB + vector embeddings that learn across sessions.
KongBrain gives your OpenClaw agent persistent, structured memory:
See the official install guide: https://surrealdb.com/docs/surrealdb/installation
macOS:
brew install surrealdb/tap/surreal
Linux — see https://surrealdb.com/docs/surrealdb/installation for your distro.
Docker:
docker pull surrealdb/surrealdb:latest
Local only (recommended) — use strong credentials in production:
surreal start --user youruser --pass yourpass --bind 127.0.0.1:8000 surrealkv:~/.kongbrain/surreal.db
Security note: Always bind to
127.0.0.1(not0.0.0.0) unless you specifically need remote access. Change the default credentials before use.
For Docker:
docker run -d --name surrealdb -p 127.0.0.1:8000:8000 \
-v ~/.kongbrain/surreal-data:/data \
surrealdb/surrealdb:latest start \
--user youruser --pass yourpass surrealkv:/data/surreal.db
Set environment variables or provide a .env file:
SURREAL_URL=ws://127.0.0.1:8000/rpc
SURREAL_USER=youruser
SURREAL_PASS=yourpass
SURREAL_NS=kongbrain
SURREAL_DB=kongbrain
Install as an OpenClaw plugin:
openclaw plugins install clawhub:kongbrain
Or via npm:
npm install kongbrain
The BGE-M3 embedding model (~420MB) downloads automatically on first startup from Hugging Face (https://huggingface.co/BAAI/bge-m3). All database tables and indexes are created automatically on first run.
KongBrain hooks into OpenClaw's plugin lifecycle automatically. Memory extraction runs in the background via a daemon worker thread.