Skip to content

Auto-detect and suggest visualizations for eval results #8

@samtalki

Description

@samtalki

What

When eval returns data that would benefit from visualization (arrays, DataFrames, distributions), automatically suggest or generate a plot alongside the numeric result.

Why

In a real Julia REPL, you'd naturally call plot(x) after computing something interesting. An AI agent should do the same — when it computes a 1000-element vector, the raw numbers aren't useful, but a lineplot or histogram would be.

How it could work

Option A: PostToolUse skill guidance

The simplest approach — add skill instructions that tell Claude:

  • After eval returns a large array → suggest lineplot or histogram
  • After eval returns a matrix → suggest heatmap
  • After eval returns a DataFrame → suggest describe() + column histograms

Option B: Server-side detection

More integrated — capture_eval_on_worker could detect the result type and size, and append a hint to the tool response:

julia> X = randn(1000, 3)
1000×3 Matrix{Float64}:
 ...
[Hint: This is a 1000×3 numeric matrix. Try: heatmap(X) or scatterplot(X[:,1], X[:,2])]

Option C: Auto-plot for specific types

The most aggressive — when eval returns certain types and UnicodePlots is loaded, automatically generate and append a plot to the result. This would need a way to opt out.

Recommendation

Start with Option A (skill-based guidance) since it requires zero code changes. Graduate to Option B if agents consistently fail to suggest visualizations on their own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions