Skip to main content
Reflect uses your native Agent and Runner behavior. Python can accept an existing Agent directly; TypeScript uses the Agent constructor through reflect.agent(...). Both supply Reflect tools on an invocation copy.

Installation

Python 3.10+ and Node.js 22+ for these examples. 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.

How the integration behaves

Register the tracing adapter once at application startup. Do not register another processor for every task or replay factory.

Conversations and replay

The native session stores conversation history; Reflect’s session ID groups evidence. Reuse the native session for related turns. With a session, reflection adds only new feedback; without one, the completed result supplies continuation history. During reflection, the invocation copy exposes Reflect administration instead of business tools and handoffs. For validation, build a fresh agent without the persistent session, conversation, or previous-response options shown in the task example. Reflect requires independent replay conversations. 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.