NexAgent AI
Vancouver local team online
NexAgent AI Consultant
Facing roadblocks? Our local Vancouver team provides 1v1 consulting for private AI deployments. Join our Discord community NexAgent Club or email [email protected].
Long-term memory for OpenClaw agents
Upgrade OpenClaw from a built-in SQLite toy memory into a production multi-agent memory backend. Postgres 16 + pgvector + 4-tier recall + deterministic-first ingest — agents that actually remember, run fast, and stay isolated.
Production-grade replacement for OpenClaw's bundled SQLite memory. Postgres + pgvector. 75%+ of repeat queries return in <5ms with zero LLM tokens. Per-agent isolation enforced at the SQL layer.
Eight retrieval routes, four recall tiers, SQL-level isolation — the LLM only wakes up when it has to.
T0 exact cache → T1 multi-key routing → T2 semantic search → T3 LLM fallback. 75%+ of repeat queries return in <5ms with zero LLM tokens or embedding calls.
Semantic, fulltext, trigram, concept tags, entity refs, time buckets, anchors, categories — the same memory is reachable from any of them.
6-stage ingest pipeline. LLM only fires when deterministic extraction fails. Your token bill doesn't get eaten by OpenAI in one sitting.
WHERE-clause enforced namespace separation. SQL layer, not application-layer trust. One agent cannot read another's memories — period.
CN/EN dashboard with LISTEN/NOTIFY push. Health/medical data is auto-redacted before display.
External scripts plug into the Stage 0–6 pipeline over HTTP. Discord bots, scrapers, webhooks — all write into the same memory.
Daily / weekly / monthly optimization proposals: which indexes to rebuild, which tags to merge, which anchors went stale.
Drop-in replacement for OpenClaw's memory module. Install once and OpenClaw uses it automatically — your prompts and tool chain don't change.
T0→T1→T2→T3 recall walk, 6-stage ingest pipeline, Postgres + pgvector backend, LISTEN/NOTIFY-driven dashboard.
Postgres 16 + pgvector 0.7. Semantic vectors, fulltext, trigram, JSONB tags, time-bucket partitions.
4-tier walk. Each tier's hit rate is independently observable — no more guessing why everything routes through the LLM.
Stage 0 inbound → Stage 1 dedupe → Stage 2 extract → Stage 3 route → Stage 4 write → Stage 5 index → Stage 6 notify.
Node 22+, TypeScript, pnpm. dev/ ships docker-compose for one-command Postgres + pgvector.
Five commands to bolt NextClaw onto an existing OpenClaw install.
Clone into the OpenClaw extensions directory
git clone https://github.com/NextAgentBC/nextclaw.git ~/openclaw/extensions/memory-postgresBring up Postgres + pgvector
cd ~/openclaw/extensions/memory-postgres/dev && docker compose up -dPull the embedding model (Ollama)
ollama pull nomic-embed-textGenerate the dashboard token
export NEXTCLAW_DASH_TOKEN=$(openssl rand -hex 24)Start the ingest gateway
pnpm openclaw gateway startFull install, architecture, configuration, and live-test guides live in the repo.
0→1 install, Discord bot wiring, multi-agent setup walked end to end.
Storage, recall tiers, ingest stages, isolation guarantees — explained in depth.
Reference for every env var, tier threshold, and index parameter.
Live-test procedure that proves the install actually works end to end.
NextClaw has been running in NexAgent's production for months. Apache 2.0 — fork it, ship it, change it.