Context engine for
OpenClaw agents.
Slot the Pentatonic memory plugin into your OpenClaw stack and every session gets persistent, searchable memory. Retrieval fires before each model run; decay and consolidation run on the right cadence; storage is local Postgres or hosted TES — your choice.
Install
One command. Conversational setup.
1. Install the plugin
openclaw plugins install @pentatonic-ai/ai-agent-sdkPulls the plugin into your OpenClaw environment. The package ships both the Claude Code hooks and the OpenClaw context engine; OpenClaw picks up the right one.
2. Tell OpenClaw to set it up
Set up pentatonic memoryThe agent will ask whether you want local (Docker — fully private, runs on your machine) or hosted (Pentatonic TES — team-shared memory + analytics). For hosted mode it walks you through account creation, email verification, and API key setup.
Or use the CLI directly: openclaw pentatonic-memory local.
Lifecycle
Four hooks, every turn
Unlike MCP tools (agent-driven, optional), the context engine fires deterministically on every lifecycle event. Memory just happens.
ingestFires when a message is added to the session. Stores user/assistant content as a memory with embedding + HyDE query expansion.
assembleFires before each model run. Searches for relevant memories using the latest user message and returns them as a system-prompt addition.
compactFires when the context window fills. Runs the decay cycle to evict low-confidence memories.
afterTurnFires after each turn completes. Runs the consolidation pass — frequent memories get promoted from episodic to semantic.
Configuration
Local or hosted — same plugin
Drop one of these blocks into your openclaw.json. The conversational setup writes it for you.
Local memory
{
"plugins": {
"slots": { "contextEngine": "pentatonic-memory" },
"entries": {
"pentatonic-memory": {
"enabled": true,
"config": {
"database_url": "postgres://memory:memory@localhost:5433/memory",
"embedding_url": "http://localhost:11435/v1",
"embedding_model": "nomic-embed-text",
"llm_url": "http://localhost:11435/v1",
"llm_model": "llama3.2:3b",
"client_id": "default",
"search_limit": 5,
"min_score": 0.3
}
}
}
}
}Run npx @pentatonic-ai/ai-agent-sdk memory first to spin up the Docker stack (Postgres + pgvector + Ollama).
Hosted TES
{
"plugins": {
"slots": { "contextEngine": "pentatonic-memory" },
"entries": {
"pentatonic-memory": {
"enabled": true,
"config": {
"tes_endpoint": "https://your-client.api.pentatonic.com",
"tes_client_id": "your-client",
"tes_api_key": "tes_your-client_xxxxx"
}
}
}
}
}Get credentials at /signup or via npx @pentatonic-ai/ai-agent-sdk init.
Tunables
Sensible defaults; override when you need to
client_iddefaultMemory namespace. Shared across all sessions on this OpenClaw instance.
search_limit5How many memories to inject per prompt. Higher = more context, but more tokens used.
min_score0.3Similarity floor for retrieval. Below this, memories are filtered out as not-relevant-enough.
embedding_modelnomic-embed-textLocal Ollama embedding model. 768-dim by default. Use mxbai-embed-large for 1024-dim if you want more semantic surface area.
llm_modelllama3.2:3bLocal chat model used for HyDE query expansion. Pi 5 with 8GB RAM runs this comfortably.
OpenClaw plugin
Drop-in memory for your OpenClaw agents
Free for local mode (your Docker, your data). Hosted TES adds team-shared memory and analytics on the same per-token meter as the proxy.