kongbrain

Graph-backed cognitive context engine for OpenClaw. Brain transplant for your AI lobster.

42U
作者 42U
AI 与机器学习 · MIT · TypeScript · 更新时间: 4 months ago
2
星标
0
Forks
社区
BBB
安全:
优秀
A
质量:

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: []


KongBrain

Graph-backed persistent memory engine for OpenClaw. Replaces the default context window with SurrealDB + vector embeddings that learn across sessions.

What it does

KongBrain gives your OpenClaw agent persistent, structured memory:

Requirements

Setup

Install SurrealDB

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

Start SurrealDB

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 (not 0.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

Configuration

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

Usage

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.

🔓 登录解锁更多
使用 GitHub 登录