Examples¶
The examples/ directory of the repository has runnable apps. Install the extras they need and serve them from a checkout:
The apps that call a model default to Claude Sonnet and read the model from the PANEL_AGENTS_MODEL environment variable, which takes any pydantic-ai model string such as openai:gpt-5.
Sales report with a docked agent¶
examples/drawer_app.py is a small sales report with an agent in an AgentDrawer. The report's settings are a document artifact the agent edits in place, with a custom semantic diff, so every change can be compared, applied and reverted. Edits the user makes in the report become versions too. Filtering to one region is a front-end action, and exporting needs approval.
SQL analyst¶
examples/sql_analyst/ is a data-analysis agent over a DuckDB database, and the most complete example:
app.pyis the analyst: anAgentChatbeside anArtifactPane, queries published as table artifacts, statements that change data behind anApprovalPolicy, anAuditLogof decisions, and every session recorded toruns/.replay.pyreplays a recording with the same components,panel serve examples/sql_analyst/replay.py --args runs/session-....jsonl. Without an argument it replays a bundled recording, so it runs without a model.mcp_server.pyserves the same tools over MCP, see Serve an agent's tools over MCP.python examples/sql_analyst/mcp_server.pyuses stdio and--httpserves athttp://localhost:8000/mcp.
Components without a model¶
These run on synthetic events, so they need no API key:
examples/approval_demo.py: approval cards for structured tool arguments, with an audit trail.examples/artifacts_demo.py: versioned artifacts with diffs, and a document artifact whose versions can be applied to the app.examples/chat_replay.py: a fake SQL analyst run inAgentChat, with thinking, a failing and a corrected query, a published artifact and a streamed answer, replayed with delays.