AiAS Memory for OpenClaw, powered by NEDB
AiAS Memory for OpenClaw, powered by NEDB. A drop-in context-engine plugin that gives OpenClaw extracted fact memory, a discussion window, and broadcast directives/KB, all stored in NEDB.
AiAS Memory for OpenClaw, powered by NEDB
Give your OpenClaw agent a real memory:
- Fact memory, after each conversation turn, durable facts (preferences, decisions, constraints) are extracted automatically, filtered for confidence and PII, deduplicated, and quietly injected into future prompts as background context.
- Discussion window, the most recent turns of conversation ride along verbatim, so the agent picks up where you left off.
- Broadcast directives + knowledge base, standing instructions and reference material layered into every system prompt.
Everything is stored in NEDB, an embedded, journal-backed database , no Redis, no cloud memory service, your data stays a directory on your disk.
This folder is a drop-in OpenClaw plugin. The plugin itself is thin: it delegates context assembly to the AiAS Memory service (a small Python service from the same repo, think of it as the NEDB connector). You run the service next to OpenClaw, drop this folder into OpenClaw, and point one at the other.
OpenClaw ──(context engine calls)──► AiAS Memory service ──► NEDB
▲ │
└──────── assembled messages ◄───────────┘
Why this memory
- Proven in production. This is not a weekend rewrite. The fact extraction engine is the AiAS conversation memory, shipped here byte for byte from the system that ran it, with its confidence thresholds, PII filters, and eviction rules intact.
- Facts, not transcripts. Your agent remembers preferences, decisions, and constraints as durable facts, deduplicated by content hash and injected within a token budget, instead of dragging an ever-growing chat log into every prompt.
- A discussion window that compresses itself. Recent turns ride along verbatim. When the window grows, older turns fold into a summary instead of falling off a cliff.
- Directives and a knowledge base, layered properly. Global directives, then per-agent directives and KB, then the conversation: standing instructions every prompt starts from.
- Your data is a directory, not a subscription. Everything lives in NEDB, an embedded, journal-backed database with a hash-chained history. No Redis, no cloud vector store, no API key, no account. Back it up by copying a folder.
- Privacy machinery included. Facts pass a PII filter on the way in, a visibility guard decides when remembered facts may surface, and per-user export and purge endpoints cover GDPR requests.
- Fails soft. If the memory service is down, the gateway gets its own messages back and the conversation goes on. Memory should never be the reason an agent stops answering.
Step 1, Start the AiAS Memory service
You need the aias-memory repo (this plugin lives in its openclaw/
folder) and a checkout of the NEDB engine's Python package.
git clone https://github.com/aiassistsecure/aias-memory.git && cd aias-memory
python3 -m venv venv
venv/bin/pip install -r requirements.txt
# Tell it where NEDB lives (path to NEDB's python/ directory):
export NEDB_PYTHON_PATH=/path/to/nedb/python
./run.sh # serves on http://127.0.0.1:8000
Optional: give the service a model to extract facts with and to proxy completions through, any OpenAI-compatible endpoint works:
export AIAS_MEMORY_UPSTREAM=https://api.openai.com/v1
export AIAS_MEMORY_API_KEY=sk-...
./run.sh
Without those two variables the service still assembles prompts and stores discussion history; fact extraction simply reports "no provider configured".
Sanity check:
curl http://127.0.0.1:8000/health
# {"status":"ok","service":"aias-memory","storage":"nedb",...}
Step 2, Install this plugin into OpenClaw
Copy this folder into your OpenClaw plugins directory (or reference its path in your OpenClaw config's plugin load paths, per the OpenClaw plugin docs):
cp -r openclaw/ ~/.openclaw/plugins/aias-memory
The folder is self-contained: openclaw.plugin.json (manifest +
config schema), package.json, and index.ts, no build step, no
npm dependencies.
Step 3, Configure and select it
In your OpenClaw config, enable the plugin, point it at the service,
and select aias-memory as the context engine for the memory slot:
{
plugins: {
entries: {
"aias-memory": {
enabled: true,
config: {
serviceUrl: "http://127.0.0.1:8000", // default
workspaceId: "openclaw", // memory namespace
// agentId: "my-agent", // optional: per-agent
// directives + KB
},
},
},
},
// Select the engine (key names follow the OpenClaw plugin docs):
memory: { engine: "aias-memory" },
}
Restart OpenClaw. On session start the plugin health-checks the
service and logs aias-memory: connected to …. If the service is
down, the plugin fails soft: OpenClaw keeps working, prompts just
pass through unassembled.
How it maps to the service
| OpenClaw hook | Service call |
|---|---|
bootstrap | GET /health |
assemble (before each model call) | POST /v1/memory/assemble, returns the layered message list |
afterTurn (after each reply) | POST /v1/memory/extract, records the turn, extracts facts |
The full HTTP contract is documented in the main repo README.md.
Seeding directives and knowledge
Directives/KB live in NEDB alongside everything else. The quickest way to seed them today is from Python, against the same database the service uses:
from aias_memory import open_adapter, DirectiveStore
store = DirectiveStore(open_adapter("./aias-memory-data"))
store.add_directive("global", "Always answer in English.", directive_type="style")
store.add_kb(None, "Support hours are 9–5 ET.", title="Support") # global KB
License
MIT, Copyright (c) 2026 INTERCHAINED LLC. Distilled from AiAS
(aiassistsecure); see NOTICE.md in the main repo for provenance.
The Interchained properties
This plugin is one piece of a larger workshop. Everything below is built by INTERCHAINED LLC:
- AiAS Memory, the full package, the service, and the story: https://github.com/aiassistsecure/aias-memory
- AiAS and PIN, the agent platform and p2p inference network this memory was distilled from: https://aiassistsecure.com
- NEDB, the embedded journal database underneath it all: https://github.com/aiassistsecure/nedb
- Interchained (ITC), the tri-PoW blockchain: https://github.com/interchained/interchained
- Vision, the ITC block explorer: https://vision.interchained.org
- Models, our published weights: https://huggingface.co/Interchained
- GitHub: https://github.com/aiassistsecure
Security
Conversation turns and session identifiers are sent to the memory service you configure, and the service's assembled response becomes part of the prompt. Run the service where that is safe:
-
The default is loopback, http://127.0.0.1:8000, on the same machine as the gateway. Traffic never leaves the box.
-
The plugin enforces transport policy: plain HTTP is accepted only for loopback addresses (localhost, 127.0.0.0/8, ::1). Any remote serviceUrl must be HTTPS, or the plugin refuses to register.
-
Service responses are validated before use: only well-formed messages with known roles and string content enter the prompt.
-
Assembled context is the product: the service's response (your directives, your facts, your discussion history) becomes the prompt. That is what a context engine is for. Run a service you operate or explicitly trust, the same way you would run your database.
About the ClawScan verdict. ClawHub's scanner flags this plugin (finding MCP06) because a configured memory service can supply conversation turns: with a malicious or compromised service, retrieved history could impersonate the user or the assistant. The observation about the architecture is accurate; the threat model behind the warning assumes a service run by somebody else. A context engine that restores your history from your memory service is doing its job, and a scanner cannot tell that apart from an injection, so it warns about both. We keep the design and state the trust model here instead of hiding it: the protections above (loopback by default, HTTPS enforced for anything remote, response validation, fail-soft passthrough) guard the wire, and the decision to trust the service belongs to the operator who configures it. If you do not control the memory service, do not point an agent at it, and treat anything it remembers, including remembered approvals, as untrusted.
Signed,
Mark A Evans Jr., INTERCHAINED LLC Muse
3>1
