How to Turn Datasets into Engaging Stories with Modern LLMs

Introduction: Why data storytelling with LLMs is essential today

1. Basic concepts: What makes LLMs ideal for data storytelling

1.1 Narrative generation

LLMs understand context and can write coherent paragraphs, summarize trends, and generate insights in natural language. With a large context window (thanks to models like Fern), they can handle entire time series or data dashboards without losing important details.

  • Contextual consistency
  • Multimodal understanding
  • Customization

1.2 Visualization creation

Itโ€™s not just about writing: LLMs can suggest appropriate chart types and generate code for tools like matplotlib, plotly, or code-based dashboards (e.g., Google Data Studio).

2. Building a data storytelling workflow with an LLM

Below is a practical, step-by-step example you can replicate today using an open-source LLM compatible with the latest models.

2.1 Prepare the dataset

# Example with pandas
import pandas as pd

df = pd.read_csv('sales_2026.csv')
# Calculate key metrics
df['month'] = pd.to_datetime(df['data']).dt.to_period('M')
monthly = df.groupby('month').agg({
    'revenue': 'sum',
    'units': 'sum',
    'customer': pd.Series.nunique
}).rename(columns={'customer': 'distinct_customers'})
monthly.reset_index(inplace=True)

2.2 Create a prompt to generate the story

PROMPT = """
You are an expert analyst specializing in data storytelling.
Analyze the following monthly dataset and generate:
1. An executive summary in paragraph format (maximum 150 words).
2. Three key points with specific numbers.
3. A suggestion for a chart that best represents the trend.

Dataset:
{df_json}
"""
# Convert dataframe to JSON
import json
df_json = monthly.to_json(orient='records')

# Call your LLM (example with an OpenAI-compatible API)
response = llm.generate(PROMPT.format(df_json=df_json))
print(response.text)
"""

2.3 Enhance the prompt with multimodal capabilities

If you also have a PNG table or a dashboard image, send it to the multimodal model (d3-ultra) for deeper understanding:

PROMPT_VISUAL = """
Analyze the attached image (a line chart of monthly sales) and suggest:
- The period of peak performance.
- Any visual anomalies.
- A brief narrative to accompany the chart.
"""
# Send both the prompt and the image to the multimodal LLM
response = multimodal_llm.generate([PROMPT_VISUAL, image_path])
"""

3. Real-world examples with the latest models

3.1 Using Fern 0.1 for extended time series stories

Fern 0.1 excels at maintaining coherence over 10 million token context windows. For a year-long daily clickstream dataset (~3B points), you can:

  • Load the raw time series file into the modelโ€™s extended context.
  • Generate a narrative summary covering each month, highlighting seasonal peaks.
  • Produce a series of interactive visualization panels with hyperlinks for detailed exploration.

3.2 Enabling decision agents with d3-ultra

d3-ultra, a 27B semantic router, can automatically classify sections of generated stories. For example:

ROUTER_PROMPT = """
Classify the following data story paragraph into one of these tags:
- trend_up
- trend_down
- stable
- anomaly

Paragraph: "{story_text}"
Tag:
"""
classification = d3_ultra.generate(ROUTER_PROMPT)
"""

4. Common mistakes and how to avoid them

  • Relying too much on context.Even with 10M tokens, the model can forget initial data. Break data into manageable chunks.
  • Ignoring data quality.LLMs amplify biases; always perform cleaning and validation before prompting.
  • Poor prompt customization.Use few-shot examples to guide tone and format.

5. Final tip: data-driven iteration

Data storytelling is not a one-time process. Create a feedback loop: monitor engagement metrics (views, dwell time), gather feedback, and refine the prompt accordingly. The ability to iterate quickly is where LLMs provide the greatest advantage.

Conclusion: Transform raw data into impactful narratives

Next step:Take your most recent dataset, apply the example prompt, and see how a modern LLM can transform raw numbers into a shareable story.

IMPORTANT: We are in 2026. All temporal references must be current. Do not mention past years such as 2024, 2023, etc. The content must be fresh and relevant to the present. CURRENT CONTEXT (October 2026): Here are some recent trends and news to inspire you: - Liquid AI Releases LFM3: 6 Open-Weight 2B-Class Multimodal Models: Liquid AI released LFM3, 6 open-weight 2B-class models for text, vision, audio, omni, and decisions. LFM3-1.7B uses a tri-hybrid backbone, a 256K context... [2026-10-27] - Baidu Open-Sources Unlimited OCR 2 for Hundred-Page Document Parsing: Baidu has released Unlimited OCR 2, an MIT-licensed 3B OCR model that parses hundred-page documents in one request. Its SR-SWA attention keeps per-step... [2026-10-27] - vLLM Semantic Router Releases d3-ultra: A 27B Open Multimodal Decision Model: vLLM Semantic Router released d3-ultra, a 27B open-weight multimodal decision model. It reads text, images, and video once, then returns probabilities... [2026-10-27] Use this current information as inspiration to create an original and relevant prompt for 2026.

๐Ÿ’ผ Vuoi ottimizzare i tuoi processi con l'AI?

Scopri come possiamo aiutarti a creare prompt personalizzati e strategie AI su misura per il tuo business.

Richiedi Consulenza Gratuita