Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ powercontext setup claude-code --source oceanbase/powercontext --ref v0.0.2
powercontext setup dsh --source oceanbase/powercontext --ref v0.0.2
powercontext setup hermes --source oceanbase/powercontext --ref v0.0.2

# OpenCode currently requires the matching CLI and integration from master.
# OpenClaw and OpenCode currently require the matching CLI and integrations from master.
uv tool install --force "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
powercontext setup openclaw --source oceanbase/powercontext --ref master
powercontext setup opencode --source oceanbase/powercontext --ref master
```

The first command installs the latest released CLI and local Server in an isolated environment. The release setup
commands install their integrations from the matching repository tag. Until OpenCode is included in a release, its
extra `uv tool install` command keeps the CLI, Server, and integration on the same `master` revision. Run setup again
to refresh an existing integration.
commands install their integrations from the matching repository tag. Until OpenClaw and OpenCode are included in a
release, the extra `uv tool install` command keeps the CLI, Server, and integrations on the same `master` revision.
Run setup again to refresh an existing integration.

### 2. Start and verify the local Server

Expand All @@ -49,7 +50,7 @@ In another terminal, verify the service and plugin:

```bash
powercontext doctor
powercontext doctor codex # or: claude-code / dsh / hermes
powercontext doctor codex # or: claude-code / dsh / hermes / openclaw
```

By default, the Server listens on `127.0.0.1:8000`, exposes Streamable HTTP MCP at `/mcp`, and persists data in a
Expand Down Expand Up @@ -84,8 +85,8 @@ model.
## Integrations

PowerContext provides official integrations and installation guides for Codex, Claude Code, DeepSeek Harness, Hermes
Agent, Pi Coding Agent, and OpenCode. These integrations use the same scoped data and history-preserving contracts
through PowerContext Server; the host integrations do not start or embed the Server.
Agent, Pi Coding Agent, OpenClaw, OpenCode, and WorkBuddy. These integrations use the same scoped data and
history-preserving contracts through PowerContext Server; the host integrations do not start or embed the Server.

### Official integrations

Expand All @@ -96,7 +97,9 @@ through PowerContext Server; the host integrations do not start or embed the Ser
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-dsh.md"><img src="https://github.com/deepseek-ai.png?size=120" alt="DeepSeek Harness" width="48" height="48" /><br /><sub><b>DeepSeek Harness</b></sub></a></td>
<td align="center" width="120"><a href="integrations/hermes/README.md"><img src="https://github.com/NousResearch/hermes-agent/blob/main/website/static/img/logo.png?raw=true&size=120" alt="Hermes Agent" width="48" height="48" /><br /><sub><b>Hermes Agent</b></sub></a></td>
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-pi.md"><img src="https://github.com/earendil-works.png?size=120" alt="Pi Coding Agent" width="48" height="48" /><br /><sub><b>Pi Coding Agent</b></sub></a></td>
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-openclaw.md"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /><br /><sub><b>OpenClaw</b></sub></a></td>
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-opencode.md"><img src="https://github.com/anomalyco.png?size=120" alt="OpenCode" width="48" height="48" /><br /><sub><b>OpenCode</b></sub></a></td>
<td align="center" width="120"><a href="integrations/workbuddy/README.md"><img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='48' height='48' rx='10' fill='%231f6feb'/%3E%3Ctext x='24' y='31' font-family='Arial,Helvetica,sans-serif' font-size='18' font-weight='bold' fill='%23ffffff' text-anchor='middle'%3EWB%3C/text%3E%3C/svg%3E" alt="WorkBuddy" width="48" height="48" /><br /><sub><b>WorkBuddy</b></sub></a></td>
</tr>
</table>

Expand Down
15 changes: 9 additions & 6 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ powercontext setup claude-code --source oceanbase/powercontext --ref v0.0.2
powercontext setup dsh --source oceanbase/powercontext --ref v0.0.2
powercontext setup hermes --source oceanbase/powercontext --ref v0.0.2

# OpenCode 当前需要从 master 安装匹配的 CLI 和集成。
# OpenClaw 和 OpenCode 当前需要从 master 安装匹配的 CLI 和集成。
uv tool install --force "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
powercontext setup openclaw --source oceanbase/powercontext --ref master
powercontext setup opencode --source oceanbase/powercontext --ref master
```

第一条命令会在隔离环境中安装最新发布的 CLI 和本地 Server;发布版的 setup 命令会从匹配的仓库 tag
安装对应集成。在 OpenCode 进入正式发布版之前,额外的 `uv tool install` 命令会让 CLI、Server 和集成
使用同一个 `master` revision。如需刷新现有集成,请再次运行 setup。
安装对应集成。在 OpenClaw 和 OpenCode 进入正式发布版之前,额外的 `uv tool install` 命令会让 CLI、Server
和集成使用同一个 `master` revision。如需刷新现有集成,请再次运行 setup。

### 2. 启动并验证本地 Server

Expand All @@ -46,7 +47,7 @@ powercontext server run

```bash
powercontext doctor
powercontext doctor codex # or: claude-code / dsh / hermes
powercontext doctor codex # or: claude-code / dsh / hermes / openclaw
```

默认情况下,Server 监听 `127.0.0.1:8000`,在 `/mcp` 提供 Streamable HTTP MCP,并将数据持久化到本地
Expand Down Expand Up @@ -79,8 +80,8 @@ SQLite 数据库。显式 Memory 操作无需配置 inference provider 即可使

## 集成

PowerContext 为 Codex、Claude Code、DeepSeek Harness、Hermes Agent、Pi Coding Agent 和 OpenCode
提供官方集成与安装指南。
PowerContext 为 Codex、Claude Code、DeepSeek Harness、Hermes Agent、Pi Coding Agent、OpenClaw、OpenCode 和
WorkBuddy 提供官方集成与安装指南。
这些集成都通过 PowerContext Server 使用同一套作用域数据和保留历史的契约;宿主集成不会自行启动或内嵌 Server。

### 官方集成
Expand All @@ -92,7 +93,9 @@ PowerContext 为 Codex、Claude Code、DeepSeek Harness、Hermes Agent、Pi Codi
<td align="center" width="120"><a href="docs/zh/docs/how-to/configure-dsh.md"><img src="https://github.com/deepseek-ai.png?size=120" alt="DeepSeek Harness" width="48" height="48" /><br /><sub><b>DeepSeek Harness</b></sub></a></td>
<td align="center" width="120"><a href="integrations/hermes/README.md"><img src="https://github.com/NousResearch/hermes-agent/blob/main/website/static/img/logo.png?raw=true&size=120" alt="Hermes Agent" width="48" height="48" /><br /><sub><b>Hermes Agent</b></sub></a></td>
<td align="center" width="120"><a href="docs/zh/docs/how-to/configure-pi.md"><img src="https://github.com/earendil-works.png?size=120" alt="Pi Coding Agent" width="48" height="48" /><br /><sub><b>Pi Coding Agent</b></sub></a></td>
<td align="center" width="120"><a href="docs/zh/docs/how-to/configure-openclaw.md"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /><br /><sub><b>OpenClaw</b></sub></a></td>
<td align="center" width="120"><a href="docs/zh/docs/how-to/configure-opencode.md"><img src="https://github.com/anomalyco.png?size=120" alt="OpenCode" width="48" height="48" /><br /><sub><b>OpenCode</b></sub></a></td>
<td align="center" width="120"><a href="integrations/workbuddy/README.md"><img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='48' height='48' rx='10' fill='%231f6feb'/%3E%3Ctext x='24' y='31' font-family='Arial,Helvetica,sans-serif' font-size='18' font-weight='bold' fill='%23ffffff' text-anchor='middle'%3EWB%3C/text%3E%3C/svg%3E" alt="WorkBuddy" width="48" height="48" /><br /><sub><b>WorkBuddy</b></sub></a></td>
</tr>
</table>

Expand Down
17 changes: 12 additions & 5 deletions README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ powercontext setup codex --source oceanbase/powercontext --ref v0.0.2
powercontext setup claude-code --source oceanbase/powercontext --ref v0.0.2
powercontext setup dsh --source oceanbase/powercontext --ref v0.0.2
powercontext setup hermes --source oceanbase/powercontext --ref v0.0.2

# OpenClaw は現在、master から対応する CLI とインテグレーションをインストールする必要があります。
uv tool install --force "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
powercontext setup openclaw --source oceanbase/powercontext --ref master
```

最初のコマンドは、隔離された環境に CLI とローカル Server をインストールします。以降の setup コマンドは、
対応するリポジトリの tag から各インテグレーションをインストールします。既存のインストールを更新するには、setup を
再実行してください。
最初のコマンドは、隔離された環境に最新リリースの CLI とローカル Server をインストールします。リリース版の setup
コマンドは、対応するリポジトリの tag から各インテグレーションをインストールします。OpenClaw がリリースに含まれる
までは、追加の `uv tool install` コマンドによって CLI、Server、インテグレーションを同じ `master` revision に
そろえます。既存のインストールを更新するには、setup をもう一度実行してください。

### 2. ローカル Server を起動して検証する

Expand All @@ -44,7 +49,7 @@ powercontext server run

```bash
powercontext doctor
powercontext doctor codex # または: claude-code / dsh / hermes
powercontext doctor codex # または: claude-code / dsh / hermes / openclaw
```

デフォルトでは、Server は `127.0.0.1:8000` で待ち受け、`/mcp` で Streamable HTTP MCP を公開し、
Expand Down Expand Up @@ -78,7 +83,7 @@ powercontext doctor codex # または: claude-code / dsh / hermes

## インテグレーション

PowerContext は Codex、Claude Code、DeepSeek Harness、Hermes Agent、Pi Coding Agent 向けの公式インテグレーションと
PowerContext は Codex、Claude Code、DeepSeek Harness、Hermes Agent、Pi Coding Agent、OpenClaw、WorkBuddy 向けの公式インテグレーションと
インストールガイドを提供します。これらのインテグレーションは、PowerContext Server を通じて同じスコープ付きデータと
履歴を保持する契約を使用します。ホストインテグレーションが Server を自動的に起動したり、組み込んだりすることはありません。

Expand All @@ -91,6 +96,8 @@ PowerContext は Codex、Claude Code、DeepSeek Harness、Hermes Agent、Pi Codi
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-dsh.md"><img src="https://github.com/deepseek-ai.png?size=120" alt="DeepSeek Harness" width="48" height="48" /><br /><sub><b>DeepSeek Harness</b></sub></a></td>
<td align="center" width="120"><a href="integrations/hermes/README.md"><img src="https://github.com/NousResearch/hermes-agent/blob/main/website/static/img/logo.png?raw=true&size=120" alt="Hermes Agent" width="48" height="48" /><br /><sub><b>Hermes Agent</b></sub></a></td>
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-pi.md"><img src="https://github.com/earendil-works.png?size=120" alt="Pi Coding Agent" width="48" height="48" /><br /><sub><b>Pi Coding Agent</b></sub></a></td>
<td align="center" width="120"><a href="docs/en/docs/how-to/configure-openclaw.md"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /><br /><sub><b>OpenClaw</b></sub></a></td>
<td align="center" width="120"><a href="integrations/workbuddy/README.md"><img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='48' height='48' rx='10' fill='%231f6feb'/%3E%3Ctext x='24' y='31' font-family='Arial,Helvetica,sans-serif' font-size='18' font-weight='bold' fill='%23ffffff' text-anchor='middle'%3EWB%3C/text%3E%3C/svg%3E" alt="WorkBuddy" width="48" height="48" /><br /><sub><b>WorkBuddy</b></sub></a></td>
</tr>
</table>

Expand Down
104 changes: 104 additions & 0 deletions docs/en/docs/how-to/configure-openclaw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: Configure OpenClaw
description: Install the PowerContext memory plugin for OpenClaw and control recall, capture, scope, and durable memory writes.
---

# Configure OpenClaw

## Install or refresh the plugin

Until a PowerContext release includes OpenClaw, install the CLI and plugin from the same `master` revision:

```bash
uv tool install --force "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
powercontext setup openclaw --source oceanbase/powercontext --ref master
Comment thread
Teingi marked this conversation as resolved.
```

Without `--server-url`, setup configures the plugin for the Server default at `http://127.0.0.1:8000`.

A local checkout works as well:

```bash
powercontext setup openclaw --source .
```

`setup openclaw` builds the plugin with pnpm, installs it with `openclaw plugins install --link --force`, enables it
as the `memory` plugin slot, adds the PowerContext tools to `tools.alsoAllow`, and restarts the OpenClaw gateway. It
does not start the Server. Start the Server, then start a new OpenClaw session:

```bash
powercontext server run
openclaw
```

The plugin requires OpenClaw 2026.8.1-beta.2 or newer.

## Understand what the plugin does

Before OpenClaw builds a prompt, the plugin calls `POST /v1/context/prepare` once with an 8000-byte default budget.
Recalled content is labelled as untrusted historical evidence. Current system instructions, repository guidance, and
the user's request take precedence.

Eligible user prompts from direct/private sessions are captured separately as Content Sources with a deterministic
source id, so repeated captures are idempotent. Group, channel, and incognito sessions are excluded. The plugin never
synchronizes the complete OpenClaw transcript. Recall, capture, and boundary flushing fail open: an unavailable
Server, timeout, redirect, or invalid response leaves the prompt unchanged and never blocks ordinary work.

The plugin exposes five tools: `powercontext_memory_search`, `powercontext_memory_get`,
`powercontext_memory_store`, `powercontext_memory_revise`, and `powercontext_memory_retire`. The mutating tools
require the model to call them explicitly; OpenClaw controls side-effecting tool execution.

Explicit search and get calls use `/v1/memory/search` and `/v1/memory/entries/get` directly; they do not call
`/v1/context/prepare`. Search limits the query to 8192 characters and clamps the requested result limit to 1–50
(default 10), while each get returns at most 120 lines and 12,000 characters.

## Choose the memory scope

Scope mode defaults to `agent`, which derives the memory scope from the OpenClaw agent identity. Use project scope
when the memory must be shared across agents working in the same project:

```bash
powercontext setup openclaw --scope-mode project
```

Project scope is used only when OpenClaw supplies exactly one trusted project identity for a turn.

## Connect to an authenticated Server

Start an authenticated Server from a protected environment:

```bash
export POWERCONTEXT_SERVER_AUTH_ENABLED=true
export POWERCONTEXT_SERVER_AUTH_TOKEN="$POWERCONTEXT_LOCAL_TOKEN"
powercontext server run
```

The plugin reads the Bearer token from the environment variable named by the `tokenEnv` config entry, which defaults
to `POWERCONTEXT_CLIENT_API_TOKEN`. The Gateway service must receive that variable in its own environment. Add the
matching secret value to the Gateway service environment or to `~/.openclaw/.env`:

```dotenv
POWERCONTEXT_CLIENT_API_TOKEN=<same token value>
```

Protect the file and restart the Gateway so the plugin receives the updated environment:

```bash
chmod 600 ~/.openclaw/.env
openclaw gateway restart
```

Do not put credentials in the endpoint. The current configuration accepts both HTTP and HTTPS URLs; use plain HTTP
only for a trusted loopback Server and use HTTPS for every remote Server. This is an operator security requirement,
not a restriction currently enforced by the CLI or plugin.

## Verify the installation

```bash
powercontext doctor
powercontext doctor openclaw
```

`doctor openclaw` checks that the OpenClaw CLI is available and that `openclaw plugins list --enabled --json` reports
`memory-powercontext` as loaded and selected for the memory slot. Restart the OpenClaw gateway after changing
PowerContext configuration.
3 changes: 3 additions & 0 deletions docs/en/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ overview:
- title: Continue in Pi
description: Open project context in Pi with the native package.
href: en/docs/how-to/configure-pi/
- title: Continue in OpenClaw
description: Open project context in OpenClaw with the memory plugin.
href: en/docs/how-to/configure-openclaw/
- title: Continue in OpenCode
description: Recall and maintain project context with the native OpenCode plugin.
href: en/docs/how-to/configure-opencode/
Expand Down
Loading
Loading