Skip to content

Add "Draw Charts from an Agent" how-to#115

Merged
micheleRP merged 1 commit into
redpanda-data:mainfrom
birdayz:jb/document-agent-charts
Jul 1, 2026
Merged

Add "Draw Charts from an Agent" how-to#115
micheleRP merged 1 commit into
redpanda-data:mainfrom
birdayz:jb/document-agent-charts

Conversation

@birdayz

@birdayz birdayz commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

A new connect how-to, modules/connect/pages/draw-charts.adoc, plus a nav entry under the connect section and two screenshots.

When an ADP agent emits a fenced code block tagged ```chart whose body is a strict-JSON Chart.js v4 config, the Redpanda Cloud UI renders that block as an interactive chart in the agent Inspector and Transcripts views. The page documents the contract, the supported chart types, how to make an agent emit charts through its system prompt, how to test it, how to set options and colors, and the error and streaming-placeholder states.

Why

The feature shipped to ai.redpanda.com (cloudv2 #27566) with no documentation. Users had no way to discover the fence/JSON contract, which chart types work, or how to get an agent to draw a chart at all.

Implementation details

The page is task-oriented and grounded entirely in the shipped behavior:

  • Contract: the fence tag is literally chart; the body is strict JSON parsed with JSON.parse (no eval, so no functions, callbacks, or comments); the body is a raw Chart.js config with top-level type and data plus optional options, with no wrapper envelope.
  • Supported types: bar, line, pie, doughnut, polarArea, radar, scatter, and bubble. Zoom and pan apply to the cartesian types (bar, line, scatter, bubble).
  • The renderer backfills a theme palette, fixed sizing, and zoom for cartesian charts, and keeps any colors or options the agent set itself.
  • Inspector views (Chart, Data, Code), PNG export, and the zoom and reset behavior are documented as observed.
  • Failure and streaming states: a Building chart placeholder while the fence streams, and a Failed to render chart inline error for a completed but malformed config.
  • A system-prompt snippet with one worked example shows how to make an agent emit a chart block.

Every claim was checked against the adp-ui chart renderer (chart-block.tsx, chart-block-renderer.tsx, ai-elements/response.tsx) on origin/main and verified live on ai.redpanda.com. The two screenshots are sanitized and carry no identifiable data.

The branch is based on the current default branch; the diff is only these docs changes.

References

cloudv2 #27566

Preview pages

An ADP agent that emits a fenced ```chart code block holding a strict-JSON
Chart.js v4 config gets that block rendered as an interactive chart in the
agent's Inspector and Transcripts views. Nothing documented this, so users
had no way to discover the contract or make an agent use it.

The page is task-oriented: the fence/JSON contract, the supported chart
types, a system-prompt snippet with a worked example, how to test it in the
Inspector, how to set options and colors, and a troubleshooting table for the
error and streaming-placeholder states.

Every claim is checked against the adp-ui chart renderer on origin/main and
verified live on ai.redpanda.com. The two screenshots are sanitized and carry
no identifiable data. Adds a nav entry under the connect section.
@netlify

netlify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploy Preview for redpanda-agentic-data-plane ready!

Name Link
🔨 Latest commit 835d31a
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-agentic-data-plane/deploys/6a43cc6fd2dd290008701dfe
😎 Deploy Preview https://deploy-preview-115--redpanda-agentic-data-plane.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@birdayz birdayz marked this pull request as ready for review June 30, 2026 14:29
@birdayz birdayz requested a review from a team as a code owner June 30, 2026 14:29

@micheleRP micheleRP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@birdayz

birdayz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

can we merge?

@micheleRP micheleRP merged commit d5c57b7 into redpanda-data:main Jul 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants