PowerContext
August 31, 2026 · View on GitHub
PowerContext is the upgraded version of PowerMem and a context runtime for human-agent collaboration. It turns shared work into project context that can be understood, handed off, and continued.
Quick start
You need macOS or Linux, Python 3.11 or newer, and uv. Choose your entry:
- already have an AI application and do not use an Agent Host: follow the HTTP API lifecycle tutorial to complete the first Source, Memory, PreparedContext, Experience, Skill, and Review loop over HTTP;
- use Codex, Claude Code, DSH, OpenCode, or another Host: follow the Agent step-by-step quickstart for its actual Memory, automatic-recall, and Handoff surface.
The commands below are the shorter shared installation path.
1. Install PowerContext, then add integrations for Agent Hosts
uv tool install --force "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
# Only the Agent Host path needs one or more integrations. Every setup command installs from master.
powercontext setup codex --source oceanbase/powercontext --ref master
powercontext setup claude-code --source oceanbase/powercontext --ref master
powercontext setup dsh --source oceanbase/powercontext --ref master
powercontext setup hermes --source oceanbase/powercontext --ref master
powercontext setup openclaw --source oceanbase/powercontext --ref master
powercontext setup opencode --source oceanbase/powercontext --ref master
powercontext setup pi --source oceanbase/powercontext --ref master
powercontext setup workbuddy --source oceanbase/powercontext --ref master
# Or install several hosts in one pass.
powercontext setup select --host codex --host claude-code --host opencode \
--source oceanbase/powercontext --ref master
The first command installs the CLI and local Server from the latest master revision in an isolated environment.
Every setup command installs its integration from the same master revision. Run setup again to refresh an existing
integration. HTTP API users need only the first install command and can skip every powercontext setup command.
2. Start and verify the local Server
Keep the Server running in one terminal:
powercontext server run
In another terminal, verify the service and plugin:
powercontext doctor
powercontext doctor integrations
powercontext doctor codex # Replace codex with the host you installed.
By default, the Server listens on 127.0.0.1:8000, exposes Streamable HTTP MCP at /mcp, and persists data in a
local SQLite database. Explicit Memory operations work without configuring an inference provider.
3. Complete the Agent Memory and Handoff loop
Start a new session from one project directory and follow the prompts in the Agent step-by-step quickstart. It shows how to:
- select and diagnose an installed Agent Host;
- save explicit project Memory and recover it in another session;
- use one-line,
pc_*, or/pcHandoff according to the Host's real capabilities; - verify a non-Codex DSH-to-OpenCode continuation with one exact Revision.
No generation model is required for this first loop. Configure inference only when you continue to model-backed extraction and vector search. For the Codex-specific Hook and one-line flow, continue with the complete Codex tutorial.
4. Or add the HTTP API to your own AI
Without an Agent Host, call POST /v1/context/prepare before each model request and supply the returned read-only,
untrusted historical context to the model. Call POST /v1/memory/remember only after explicit user or business-policy
authorization. The HTTP API lifecycle tutorial provides one small Python
learning path; use the Scalar API Reference for every endpoint and
schema.
Core capabilities
| Capability | Core value |
|---|---|
| Memory extraction and management | Explicitly record decisions, constraints, outcomes, state, and next steps worth reusing over time; with a generation model configured, Memory can also be extracted from Sources. Revisions and retirements preserve history |
| Bounded request-time recall | Before an agent handles a request, generate one schema-validated, cited PreparedContext based on project scope, relevance, and a byte budget; recall failures do not block the original task |
| Handoff | Organize the objective, verified progress, blockers, next step, and evidence into an inspectable work package so another session, task, model, or agent host can continue from a clear state |
| Sources and evidence lineage | Preserve the original sources of knowledge and link Memory and Artifacts with exact citations; capturing a prompt creates only a Source and does not directly turn it into Memory |
| Experience and Skill governance | A model or caller can only submit a Candidate; an immutable revision is created only after Review, and a Skill must still be exported explicitly—it cannot approve, install, or execute itself |
| Local and service deployment | Use SQLite directly for local development, choose OceanBase for team deployments, and integrate with existing systems through HTTP/OpenAPI, MCP, authentication, and OpenTelemetry |
Benchmarks
LoCoMo
SWE-bench Pro public v2
The evaluation ran in a Codex environment, with both the PowerContext OFF and ON groups using the gpt-5.6-sol
model.
Integrations
PowerContext provides official integrations and installation guides for Codex, Claude Code, DeepSeek Harness, Hermes Agent, Pi Coding Agent, OpenClaw, OpenCode, WorkBuddy, Bub, Pydantic AI, LangChain, and LangGraph. 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
Codex |
Claude Code |
DeepSeek Harness |
Hermes Agent |
Pi Coding Agent |
OpenClaw |
OpenCode |
WorkBuddy |
Bub |
Pydantic AI |
LangChain |
LangGraph |
Python agent applications can use the LangChain middleware, the LangGraph node and tools adapter, the Pydantic AI middleware, or the Bub plugin.
Development
Install the locked development environment and hooks:
make install
Run the main validation commands before opening a pull request:
make check
make test
make docs-test
After changing openapi/powercontext.yaml, run make contract-test. See CONTRIBUTING.md for the
complete workflow and docs/en/development/ for implementation guides.
Community
Questions and feedback are welcome in Discord. Use GitHub Issues for reproducible defects and focused feature requests.
License
PowerContext is licensed under the Apache License 2.0.