Skip to main content
The Python integration configures an ADK LlmAgent and runs it through a native Runner. Reflect composes the agent’s instructions and callbacks, while the existing ADK adapter records execution.

Installation

Python only; use Python 3.10+ with a compatible Google ADK release. Install Reflect together with the framework and model provider used below.

Credentials

For a self-hosted platform, also set PANDAPROBE_ENDPOINT to your API base URL. Reflect uses the same client configuration as tracing.

Enable Reflect

This example creates a policy assistant. Add your own domain tools where indicated; Reflect supplies reflect_bash automatically.
Python

How the integration behaves

Construct the Runner’s agent with reflect.agent(...) so its tools, memory, and permission callbacks are configured before execution. An existing Runner must already contain that configured agent.

Conversations and replay

Reuse the Runner and session service for related turns. Reflect resolves/creates the native session using the task session ID, and uses a fresh execution identity during validation. The example uses an in-memory service; choose your normal ADK persistence for longer-lived conversations. You can pass user_id and run_config to reflect.run(...). During reflection, Reflect bounds model calls, advertises only its own tool, and blocks domain tool execution. The returned value is the collected native event list. See the ADK tracing guide for instrumentation details. run() returns the task’s native result after evaluation and any triggered reflection. A healthy answer may produce no proposal. The workspace persists accepted guidance and pending proposals across restarts.

Validate learned rules

Add independent replay or controlled trials before proposed changes can become shared accepted guidance. Reset your business environment and conversation for each validation arm. See Rules and memory for the working filesystem and session notes.