Tools
Memory Adapter
OpenClaw plugin for resilient memory retrieval through an external HTTP memory service.
Install
npm install
npm
Configuration Example
{
"plugins": {
"entries": {
"memory-adapter": {
"enabled": true,
"config": {
"endpoint": "http://memory-service:8080",
"timeoutMs": 1500,
"maxResults": 5
}
}
}
}
}
README
# OpenClaw Memory Adapter
[](https://github.com/sebgru/openclaw-memory-adapter/actions/workflows/ci.yml)
[](https://codecov.io/gh/sebgru/openclaw-memory-adapter)
[](LICENSE)
An external OpenClaw plugin that retrieves bounded memory context from an HTTP
memory service. It is deliberately separate from OpenClaw's bundled memory
indexer and never invokes indexing.
## Behavior
- Calls `POST {endpoint}/search` with `{ "query": "...", "limit": 5 }`.
- Adds normalized results to `before_prompt_build` as reference context.
- Uses a short timeout and fails closed when the service is unavailable.
- Supports agent/chat allowlists.
- Does not search archives automatically and never calls `/index`.
## Configuration
The plugin is configured through OpenClaw's normal plugin configuration:
```json
{
"plugins": {
"entries": {
"memory-adapter": {
"enabled": true,
"config": {
"endpoint": "http://memory-service:8080",
"timeoutMs": 1500,
"maxResults": 5
}
}
}
}
}
```
The endpoint is runtime configuration; no deployment-specific hostname is
required by this repository.
## External installation and upgrades
Install a tagged release with OpenClaw's plugin installer:
```sh
openclaw plugins install github:sebgru/openclaw-memory-adapter#v0.1.0
```
Alternatively, install a checked-out release directory with
`openclaw plugins install /path/to/openclaw-memory-adapter`. Enable the plugin
and set its endpoint through OpenClaw's normal configuration. Keep the plugin
outside the OpenClaw image and pin its version independently. Do not patch
`node_modules` or bundled OpenClaw files.
For an OpenClaw upgrade:
1. Keep the adapter release pinned.
2. Test the new OpenClaw version with the existing adapter.
3. Upgrade the adapter only when its compatibility entry requires it.
4. Restart the Gateway once after changing either component.
5. Retain the previous image and adapter release for rollback.
The repository should maintain a compatibility matrix as OpenClaw releases
are tested.
The plugin uses the documented hook-based compatibility baseline. See
`COMPATIBILITY.md` for the currently tested status; an untested OpenClaw
release should be treated as a staging candidate, not upgraded directly in
production.
## Development
```sh
npm test
npm run check
```
## CI
- **CI** (`ci.yml`): ESLint, syntax check, tests with coverage (≥ 99%, currently 100%), and Codecov upload.
- **Release** (`release.yml`): triggered only on version tags (`v*.*.*`); runs lint and tests, verifies the tag matches `package.json`, builds the npm package tarball, attaches it to a GitHub Release, and publishes to npm.
To publish a release:
```sh
git tag v0.1.0
git push origin v0.1.0
```
Install a tagged release with OpenClaw afterwards:
```sh
openclaw plugins install npm:@sebgru/openclaw-memory-adapter@0.1.0
```
## Development
```sh
npm install
npm run lint
npm test
npm run test:coverage
```
Tests use a local stub for `openclaw/plugin-sdk/plugin-entry` (see
`test/stubs/`) so the plugin entry is importable and fully covered without a
running OpenClaw Gateway. When the real `openclaw` peer package is present, it
is used instead.
tools
Comments
Sign in to leave a comment