Skip to content

Best practices for generating UI with large datasets that may exceed model context #44

@HoikanChan

Description

@HoikanChan

Summary

Looking for guidance on the recommended approach when using json-render to generate visualization UI (e.g., line charts, dashboards) backed by large datasets that may exceed the model's context window.

Use Case

I want to enable end users to create data visualizations by prompting, such as:

"Create a line chart showing sales trends over the past year."

However, the underlying dataset could be thousands or tens of thousands of data points—potentially exceeding the LLM's context window if we try to include the full data in the prompt.

Question

What is the recommended approach in json-render for handling this scenario?

Options I'm Considering

  1. Data binding by path/reference — pass only metadata or a reference path to the AI, not the full dataset. The AI generates the JSON structure with valuePath or dataPath pointing to the actual data, which is resolved at render time.

  2. Sampling/aggregation before prompt — pre-process large datasets to reduce size before sending to the AI.

  3. Streaming/chunking — send data to the AI in chunks (if the model/API supports it), though this may affect the coherence of the generated UI structure.

  4. Hybrid approach — AI generates the UI component skeleton with placeholders or references, then later populates or updates it with the actual data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions