Skip to main content
PandaProbe Reflect gives your agent a persistent rule filesystem and feedback from evaluated failures. The same agent proposes reusable guidance; independent validation decides which changes become shared rules. Reflect is included in the Python and TypeScript pandaprobe SDKs and integrates with your agent’s existing model, prompts, tools, and tracing.
1

Install

This template adds Reflect to an existing LangChain agent. Use Python 3.10+ or Node.js 22+. Choose your package manager:
The Reflect dependencies provide the embedded shell and filesystem locks. For another framework, choose its integration guide.
2

Set credentials

Use a PandaProbe account with an API key, project, and evaluation access. Your model continues to use its existing provider configuration.
Self-hosted deployments also set PANDAPROBE_ENDPOINT to their API base URL. Reflect reuses the tracing client’s configuration.
3

Add Reflect to your agent

Pass your existing LangChain factory options as agent_options / agentOptions: your configured model, prompt, tools, and any checkpointer. The PandaProbe client, user input, and session ID also come from your application.Reflect adds its filesystem tool and memory instructions. The callback records the execution using the same client.
Call run_with_reflect(...) / runWithReflect(...) from your application’s async entry point. If you already have a PandaProbe callback, use it in place of the one shown. Your application owns the client and shuts it down when it exits.
4

Read the result

run() returns the original task result after bounded evaluation and, when a failure notice is produced, a reflection checkpoint. During reflection, the agent inspects evidence and proposes changes to its working rules.
  • A healthy task may produce no notice or proposal.
  • report(...) separates evaluation, reflection, and proposal status.
  • Rules and evidence persist under .pandaprobe/reflect/ by default. Reuse the workspace across restarts.
  • Use a unique execution ID for each invocation. Reuse a session ID and native checkpoint for related conversation turns.
This enables proposal generation. Shared rules are accepted only after independent validation. Evaluation and reflection add API/model calls, latency, and cost.
This quickstart shows one example of adding Reflect to a LangChain agent. Explore the integrations overview for other supported frameworks, or follow Custom loops to connect your own agent loop.

Validate a proposal

Compare fresh control and candidate executions with your own verifier.

Choose your framework

Follow the setup guide for your agent’s native framework.