For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tutorial: Build a Business Insight Analyzer

A complete walkthrough of building a multi-Scenario Agent that uses an LLM Tool to generate business insights from structured data.

Agents in Dataworkz act as orchestrators of data and AI — connecting to and retrieving insights from a wide variety of sources such as RAG applications, SQL databases, JDBC, MongoDB, GraphQL, and REST APIs. Each data source or interaction is enabled via Tools the Agent uses, powered by LLMs.

Overview

This tutorial walks through a concrete implementation of a Business Insight Analyzer Agent that uses a Data Insight Summarizer Tool for Sales, Marketing, and Customer Support Scenarios.

It uses an LLM Tool — a Tool type that integrates Large Language Models into Dataworkz Agents — enabling the Agent to analyze business data and automatically generate human-readable insights and recommendations. By defining a System Prompt (Tool persona and rules) and a User Prompt (task template), the Tool can be reused across multiple Agent Scenarios.

What We Built

  • LLM Tool: Data_Insight_Summarizer — a generic summarizer for structured/semi-structured business metrics (sales, marketing, support, operations).

  • Agent: Business Insight Analyzer — an Agent that exposes multiple Scenarios, each calling the LLM Tool (Sales Performance Analysis, Marketing Campaign Insights, Customer Service KPI Analysis).

  • Goal: Demonstrate how a single LLM Tool can be reused across different intents by wiring it into Scenario workflows in the Agent UI.

Prerequisites

An LLM configured in Dataworkz LLM Configurator (for example, gpt_4o or an equivalent model in the platform).

LLM Tool Configuration

Create the Tool

  1. From the Dataworkz dashboard, open Agents → Create Tool and choose the LLM Tool type.

  2. Enter Tool name: Data_Insight_Summarizer.

  3. Enter Description:

  4. Select an LLM from the LLM selection dropdown (for example, gpt_4o).

Configure Prompts

System prompt (Tool persona and rules)

User prompt (task template with parameter)

Input Parameters and Output

  • Input parameter: data_summary (type = String) — contains a short structured summary such as: Q3 2025 Sales Metrics: Total Revenue = $1.2M (-15% QoQ), Repeat Customers = 43% (+8%), Average Order Value = $62 (+2%), Website Traffic = 210K (-10%).

  • Output format: The Tool returns a JSON object:

This output makes downstream Scenario handling and UI rendering deterministic.

Test the Tool

  • Use the Test tool panel (right side of the Create Tool UI) to paste sample data_summary inputs and validate that the Tool returns the expected JSON structure.

  • If outputs are inconsistent, refine the system prompt to be more prescriptive (for example, require numbered insights and a JSON structure).

Agent

Create the Agent

  1. Navigate to Agents → Create Agent.

  2. In the What would you like the agent to do field, enter:

  3. Click Create.

  4. Optionally update the default Agent name and short description.

Define the Persona

In the Agent persona field, set the voice and scope. Example persona:

Add Scenarios and Map to the Tool

Three primary Scenarios are created, each wired to the same Data_Insight_Summarizer Tool:

Scenario A: BusinessDataAnalysis (Sales Performance Analysis)

  • Description: Sales Performance Analysis.

  • Planning instructions: When the user provides a quarterly/monthly sales summary (revenue, traffic, AOV, repeat customers), call the Data_Insight_Summarizer Tool with this data. Present results as insights and recommendation.

  • Output format: Add a relevant heading to the response (Insights / Analysis / Recommendations) for readability in the Agent chat.

  • Tool reference: Data_Insight_Summarizer (pass data_summary param).

Scenario B: Marketing Campaign Insights

  • Description: Interprets campaign metrics (CTR, CPC, conversions, spend) into ROI-driven insights.

  • Instruction: Route campaign metric inputs to Data_Insight_Summarizer; display insights and include a short suggestion for next steps.

Scenario C: Customer Service KPI Analysis

  • Description: Analyzes support KPIs (tickets, response time, CSAT, escalations) and provides operational recommendations.

  • Instructions: Use the Tool and present results using headings and short bullet points.

Variables and Failure Messages

  • Define Agent-level variables if needed (for example, defaultCurrency = USD). In this demo, all inputs are passed directly via Scenario text.

  • Set failure messages for no Scenario match or missing inputs. Examples:

    • No Scenario match: "I'm not sure I can help with that — try providing a sales, campaign, or support summary."

    • Missing input: "Paste the summary (KPIs) so I can analyze it."

Run and Publish

  • Test the Agent by opening Run and entering one of the sample inputs (see Best Practices below).

  • The Agent selects a Scenario, calls the Data_Insight_Summarizer Tool, and renders the returned insights and recommendation.

  • Click Publish to complete the creation process.

Best Practices

  • Be explicit in the system prompt: enforce a specific output format (JSON) to ensure stability.

  • Keep the user prompt concise: include the parameter name and the expected JSON schema so the model returns a consistent structure.

  • Test with edge cases: missing deltas, single metric inputs, and contradictory metrics (for example, traffic up but revenue down).

  • Show friendly headings in the Agent: add small post-processing on the Agent response to render headings (Insights / Recommendations) for readability.

  • Limit prompt length: if you are feeding long datasets, summarize the numerics before sending to the LLM.

Common Pitfalls

  • Overly broad Scenarios — split into smaller, focused ones.

  • Vague persona instructions — keep concise and specific.

  • Missing input validation — enforce correct data types.

  • Hardcoded secrets — always use secure storage.

Last updated