powercontext_tools() returns three tools, PowerContextRecall prepares model input, and PowerContextScope carries per-run configuration. It connects to a separately running PowerContext Server.
Maturity and installation
Install the Server and adapter from the reviewed source commit:
Pinning removes the mutable-branch ambiguity, but the documented verification did not run the upstream VCS-install path or an external-provider round trip. Verify both in your deployment environment.
Minimum use
The snippet below is the integration seam, not a standalone program: provide your application’s initialized chatmodel and LangGraph my_checkpointer. To test PowerContext before adding either dependency, write the shared Memory through the API tour and call PowerContextRecall in the focused adapter test; the upstream suite does this without an external model provider.
create_react_agent already reads the llm_input_messages channel written by the recall hook.
powercontext_search and powercontext_context clamp a model-supplied query to 8,192 Python characters. powercontext_tools() returns the tools in search, remember, context order.
Execution flow
PowerContextRecall is called before each model step, but prepares at most once for the current human turn. A ReAct loop reuses a cache keyed by Scope plus the latest human message ID; when no ID exists, it uses the message text. Including Scope in the key keeps identical tenant prompts separate.
Successful recall produces one leading SystemMessage, marked as untrusted historical evidence, followed by the original ordered messages. Empty recall or failure supplies only the original messages.
Keep model input ephemeral
Recall writes a complete input tollm_input_messages. It never appends the recalled block to messages, so a checkpointer does not accumulate stale context.
A custom graph must declare that channel, place recall before the model, and read it in the model node:
state["messages"] silently discards recalled context. Writing the block back to messages defeats the checkpoint boundary.
Scope and configuration
PassPowerContextScope on every invocation in multi-tenant services. Per-run values for Scope, base URL, token, and timeout override their environment settings.
Scope precedence is:
Bearer . The adapter does not strictly validate that syntax, so reject malformed configuration before deployment. repr=False reduces accidental display; it is not a secret vault. The shared PowerContextClient rejects plaintext HTTP to non-loopback hosts unless the caller supplies an explicitly trusted transport.
Why there is no BaseStore
LangGraph
BaseStore requires GetOp, caller-keyed PutOp upsert/delete, and SearchOp. Only search maps cleanly to PowerContext Memory. PowerContext assigns Memory identity and versions on the Server; it does not provide caller-key get, put, or delete semantics.compile(store=...) alone.
Failure, privacy, and Scope boundary
Automatic recall is fail-open. Missing Scope, malformed configuration, validation errors, authentication failures, timeouts, and Server errors skip the recall block and let the graph continue with its original messages. HTTP 401/403 is logged as configuration trouble, not treated as empty Memory. Explicit tools do not turn failures into empty success and do not raise through the graph. They return short model-visible strings for unavailable or invalid requests, allowing the model to retry or continue. A real search miss has a separate(no matching PowerContext memory) result.
The adapter performs no automatic capture. Explicit powercontext_remember still persists model-selected text, so apply host tool permissions and a retention policy.
Currently unsupported or not validated
Completion checklist
- The Server runs separately, and the source-installed adapter is pinned to a reviewed commit.
- The graph uses
ainvokeorastream. PowerContextRecallruns before the model, and a custom model node readsstate.get("llm_input_messages") or state["messages"].- Checkpointer inspection confirms recalled blocks never enter persisted
messages. - Every invocation receives the intended Scope; a cross-Scope test proves identical prompts stay isolated.
MAX_BYTESis between 512 and 32,768, long queries are expected to be clamped at 8,192 characters, and remote transport uses HTTPS.- With the Server unavailable, recall lets the graph continue; explicit tool failures remain model-visible and distinct from an empty search.
- Tool permission and retention policy cover explicit Memory writes.
- Unsupported and Not validated items remain distinct in deployment notes.
Run the model-free recall inspection first. Add a real provider only after Scope, Server reachability, transient state, and failure behavior are observable.

