Video summary

How to Build an AI Agent for Data Analysis, Visualization, AND Reporting (n8n)

Main summary

Key takeaways

Technology

Overview

This video walks through building a no-code AI agent system (using n8n) that turns large spreadsheets (thousands to tens of thousands of rows) into an interactive, natural-language data analysis + visualization + automated reporting tool—without writing code.


What the system does (end-to-end)

  • Ingests spreadsheet data (CSV / Google Sheets / Excel-like) into a database (NoCodeDB / “noco db”).
  • Connects that database to an n8n workflow so users can ask questions in plain English.
  • The agent can:
    • Answer specific data questions, e.g., “What was the Department of Energy’s net cost in 2023?”
    • Generate detailed reports with summaries, interpretations, and conclusions
    • Create visual charts via QuickChart
      • Examples mentioned include bar charts
      • The approach supports multiple chart types (e.g., line / radar / bubble)
  • Supports automation, such as generating scheduled reports (weekly/monthly) by instructing how prompts should be structured.

Demo outputs shown

  • Query: “Department of Energy net cost in 2023”
    • Returns a breakdown including fields like gross cost, earned revenue, subtotal/change, net cost, and other financial metrics.
  • Then: “Generate a visual”
    • Produces a bar chart and includes narrative insights (e.g., net cost significantly lower than gross cost).
  • Then: “Turn this into an organized report”
    • Produces an executive-summary-style report with key figures, interpretations, and wrap-up conclusions.
  • Additional example: “Department of State … covering the past 10 years”
    • Produces a multi-year trend report including:
      • An embedded chart
      • Sections such as financial overview, key figures (fiscal year, gross cost, earned revenue, net cost), trend analysis, and efficiency.

Tools / product features used

NoCodeDB (NoSQL-like database for spreadsheets)

  • Import CSV into a database table
  • Use API endpoints to query table data
  • Requires:
    • API token
    • host (cloud recommended)
    • table ID
  • The video emphasizes using API documentation to identify endpoints.

n8n

  • Receives user chat input, calls NoCodeDB via an HTTP Request (GET method), and orchestrates further steps.
  • Uses a “tools agent” pattern:
    • One workflow handles data querying + report generation
    • A separate tool/workflow handles chart generation

Claude (mentioned as the model used)

Used to:

  • Help write prompt-related formatting
  • Generate structured column lists
  • Produce correct chart configurations in the required format
  • Assist with filtering/query logic for correct agency matching

Note: GPT-4 might work similarly, but Claude was tested and preferred.

QuickChart

  • A chart API that accepts chart configuration and returns an embeddable chart image/URL
  • The workflow calls QuickChart with a chart.js-compatible configuration

Build guide / tutorial steps (key implementation points)

  1. Prepare and import data

    • Start with a public spreadsheet/CSV (demo claims ~3,000 rows).
    • Claims support for 10k–20k+ rows.
    • Import into NoCodeDB, identify the table/base, and capture table ID.
  2. Connect n8n to NoCodeDB using HTTP

    • Create an n8n HTTP Request (GET) call to NoCodeDB API endpoints.
    • Include:
      • workspace/base/table IDs
      • API token
      • host
  3. Provide schema context to the agent

    • The agent needs the column names (e.g., record date, statement fiscal year, calendar year/quarter, agency name, earned revenue, net cost, etc.).
    • The video’s approach: use Claude to generate a stringified “columns” expression so the agent references schema accurately.
  4. Agent “System Message”

    • Defines the agent as a data analysis expert for NoCodeDB table context.
    • For visualization tasks: requires returning a chart URL embedded using Markdown.
  5. Memory handling

    • Uses window buffer memory in n8n.
    • Memory keyed by session ID from the chat input.
  6. Tooling split: report workflow vs chart workflow

    • One workflow: query + narrative report generation
    • Another workflow (tool): chart configuration generation for QuickChart
  7. Chart configuration generation

    • Chart workflow instructs the model to output valid chart.js configuration objects
    • Uses a structured output parser so the response matches chart generation needs
    • n8n then sends the config to QuickChart endpoint and returns the chart
  8. Filtering / query correctness

    • The presenter notes initial issues where the agent selects the wrong agency records (e.g., mismatching “Department of Treasury”).
    • Fix involves iterating with Claude to craft a better filter/query expression for NoCodeDB searches (e.g., filter by agency name and relevant fields like earned revenue / net cost).

Review / analysis style claims

  • The video frames the system as outperforming manual report writing and speeding up repetitive tasks.
  • Emphasizes that AI + automations do the heavy lifting, reducing human effort for:
    • prompt input / scheduling instructions
    • supplying correct table IDs/schema
  • Claims the system can be made “production ready” with minor tweaks.

Main speakers / sources

  • Speaker: The video presenter (no name given in the subtitles)
  • Referenced source: DK Chun (credited as providing inspiration via a prior video)
  • Model/tool vendor mentioned: Claude (used for reasoning and structured outputs)

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video