Data Agent

The Data Agent is a powerful feature in Assist that enables deterministic, code-based data analysis. Unlike standard AI responses that can sometimes produce inconsistent results, the Data Agent uses Python code to perform precise calculations, ensuring your analysis is always accurate and reliable.

This guide demonstrates how to use the Campaign Performance Analyzer template, which analyzes marketing campaign data and provides data-driven budget recommendations.


What is the Data Agent?

The Data Agent allows you to:

  • Perform deterministic calculations using Python code instead of relying on AI interpretation
  • Eliminate AI hallucinations when working with numerical data and complex analysis
  • Get consistent, reproducible results every time you run an analysis
  • Analyze structured data from CSV files, spreadsheets, and other data sources

When to Use the Data Agent

Use the Data Agent when you need:

  • Precise mathematical calculations (ROI, ROAS, conversion rates, etc.)
  • Data aggregation and statistical analysis
  • Performance rankings and comparisons
  • Budget allocation recommendations based on metrics
  • Any analysis where accuracy is critical

Getting Started: Finding the Template

  1. Navigate to Workspace Templates in your Assist workspace
  2. Locate the Campaign Performance Analyzer template
  3. Review the template description to understand its purpose
  4. Click Edit Template to see how it's configured (or use it directly if you just want to analyze data)

Understanding the Template Configuration

Template Details

The Campaign Performance Analyzer template includes:

  • Template Name: Campaign Performance Analyzer
  • Description: Clear explanation of what the template does
  • Welcome Message: Instructions for end-users on what data to upload

User Instructions (Welcome Message)

The template's welcome message tells users to upload a CSV or spreadsheet file containing:

  • Campaign names: The name or identifier for each marketing campaign
  • Ad spend: Total amount spent on each campaign
  • Revenue generated: Total revenue attributed to each campaign
  • Optional metrics: Impressions, clicks, conversions, or other performance data

AI Instructions

The AI Instructions section defines:

  1. Agent Role: "You are a marketing performance analyst assistant"
  2. Capabilities: What the AI can analyze and explain

    When to Use the Data Agent: Specific triggers that activate the Python code execution

    • When users upload campaign performance data
    • When calculations are needed (ROAS, budget recommendations, performance rankings)
    • When precise numerical analysis is required
  3. Output Format: How to present results in plain language with actionable insights

Data Agent Instructions (Python Code)

This section contains the Python code that performs the actual analysis. The code:

  • Reads and processes the uploaded data file
  • Calculates key metrics (ROAS, total spend, total revenue)
  • Identifies top and bottom performers
  • Generates budget reallocation recommendations
  • Returns structured data for the AI to explain

Important: The code ensures calculations are deterministic—the same input data will always produce the same results.


How to Generate Python Code for Your Data Agent

If you want to create your own Data Agent template or customize the existing one, follow these steps:

Step 1: Prepare Sample Data

Create a sample CSV file with the structure you want to analyze. For the Campaign Performance Analyzer, this would include columns like:

  • Campaign Name
  • Ad Spend
  • Revenue
  • (Optional) Impressions, Clicks, Conversions

Step 2: Use Assist Direct Chat

  1. Navigate to Assist Direct Chat
  2. Click the attachment button (+ icon)
  3. Select Upload a file
  4. Choose your sample data file (e.g., campaign.csv )
  5. Wait for the file to upload and appear in the chat

Step 3: Request Python Code

Type a prompt like:

Analyze this campaign data and give me python code to calculate ROAS and budget recommendations

Be specific about:

  • What calculations you need
  • What metrics to analyze
  • What recommendations or insights you want

Step 4: Copy the Generated Code

  1. The AI will generate Python code based on your data structure
  2. Review the code to ensure it matches your requirements
  3. Copy the entire code block

Step 5: Add Code to Your Template

  1. Go back to your template editor
  2. Scroll to Data Agent Instructions (Optional)
  3. Paste the Python code into this section
  4. Save your template

Template Output Structure

The Campaign Performance Analyzer template produces a report with three clear sections:

Section 1: Results Summary

Provides an overview of overall campaign performance:

  • Total ad spend across all campaigns
  • Total revenue generated
  • Overall ROAS (Return on Ad Spend)

Section 2: Key Insights

Highlights the most important findings:

  • Top performers: Campaigns with the highest ROAS
  • Underperformers: Campaigns with low or negative ROAS
  • Specific ROAS figures for each highlighted campaign
  • Net profit or loss for each campaign

Section 3: Actionable Recommendations

Provides specific, data-driven budget allocation suggestions:

  • Which campaigns to increase budget for (with specific amounts)
  • Which campaigns to reduce budget for (with specific amounts)
  • Total budget impact (savings or reallocation)
  • Amount of freed capital available for reinvestment

Example: Campaign Performance Analysis Report

Here's what a completed analysis looks like:

RESULTS SUMMARY

  • Total Campaign Spend: £18,900
  • Total Revenue Generated: £45,230
  • Overall ROAS: 2.39

KEY INSIGHTS

Top Performers:

  • Email Newsletter: ROAS 7.00 (£400 spend → £2,800 revenue)
  • Google Search - Brand: ROAS 4.20 (£2,500 spend → £10,500 revenue)
  • Meta - Retargeting: ROAS 4.20 (£1,800 spend → £7,560 revenue)

Underperformers:

  • TikTok Awareness: ROAS 0.60 (£1,500 spend → £900 revenue, net loss £600)
  • LinkedIn - B2B Leads: ROAS 1.01 (£2,800 spend → £2,828 revenue)
  • Meta - Prospecting: ROAS 1.20 (£3,500 spend → £4,200 revenue)

ACTIONABLE RECOMMENDATIONS

Increase Budget for Top Performers:

  • Email Newsletter: £400 → £500 (+£100)
  • Google Search - Brand: £2,500 → £3,125 (+£625)
  • Meta - Retargeting: £1,800 → £2,250 (+£450)

Reduce Budget for Underperformers:

  • TikTok Awareness: £1,500 → £750 (-£750)
  • LinkedIn - B2B Leads: £2,800 → £1,400 (-£1,400)
  • Meta - Prospecting: £3,500 → £1,750 (-£1,750)

Financial Impact:

  • New Total Budget: £16,175 (down from £18,900)
  • Capital Freed for Reinvestment: £2,725

Best Practices

For Template Creators

  1. Use clear, descriptive welcome messages that tell users exactly what data format to upload
  2. Define specific triggers in AI Instructions for when to use the Data Agent
  3. Test your Python code with sample data before deploying the template
  4. Structure your output into clear sections for easy reading
  5. Include context in your AI Instructions so the agent can explain results in plain language

For Template Users

  1. Prepare your data in the correct format (CSV or spreadsheet)
  2. Include all required columns as specified in the template instructions
  3. Use consistent data formatting (same currency, date formats, etc.)
  4. Review the results to ensure they make sense for your business context
  5. Take action on the recommendations provided

Troubleshooting

Common Issues

Issue: The Data Agent doesn't activate

  • Solution: Ensure your AI Instructions clearly specify when to call the Data Agent
  • Check that you've uploaded data in the expected format

Issue: Python code errors

  • Solution: Verify your data file has the correct column names
  • Ensure there are no missing values or formatting issues in your data
  • Test the code with sample data in Assist Direct Chat first

Issue: Results don't match expectations

  • Solution: Review the Python code logic to understand how calculations are performed
  • Check your input data for accuracy
  • Verify that the code is analyzing the correct columns

Key Takeaways

Data Agent provides deterministic analysis using Python code instead of AI interpretation

Eliminates AI hallucinations for numerical and data-driven tasks

Campaign Performance Analyzer is a ready-to-use template for marketing analysis

Generate custom code using Assist Direct Chat with your sample data

Structured outputs make it easy to understand and act on insights

Reproducible results ensure consistency across multiple analyses


Next Steps

  1. Try the Campaign Performance Analyzer template with your own marketing data
  2. Create custom Data Agent templates for your specific analysis needs
  3. Experiment with different data types (sales data, customer metrics, financial reports)
  4. Share templates with your team for consistent analysis across your organization

For more information about creating custom templates or advanced Data Agent configurations, contact your Assist administrator

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us