> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neoagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Analysis

> Run custom analyses on your PSA data with AI-generated or pre-built Python scripts

The Data Analysis action allows you to run custom analyses on your PSA data (like tickets or time entries). You can either choose a pre-built analysis script or have Neo's AI generate one for you based on your description.

<Tip>
  Perfect for when you need specific insights or reports that aren't available through standard Neo Agent features. Describe what you need, and Neo can create the script, or choose from pre-defined templates. Get exactly the information you need, formatted as text or data tables for export.
</Tip>

## Quick start

<Steps>
  <Step title="Gather your data">
    Use "Find Entities" to collect the data you want to analyze (like tickets from a specific client or time period).
  </Step>

  <Step title="Describe your analysis">
    Clearly describe what insights you want. For example: "Create a table showing ticket volume by category for the past month."
  </Step>

  <Step title="Choose your approach">
    Either use "USE AI" to generate a script, select a pre-built template, or write your own Python code.
  </Step>

  <Step title="Configure output">
    Set up column names if you want a data table, and enable CSV export if you plan to email the results.
  </Step>
</Steps>

## How it works

This action processes your data through custom analysis:

1. **Gathers data** - Takes data from previous workflow actions (like "Find Entities")
2. **Prepares for analysis** - Makes data accessible to Python scripts with helper functions
3. **Executes analysis** - Runs your chosen script (AI-generated, template, or custom)
4. **Produces results** - Creates text summaries and optional data tables
5. **Prepares exports** - Formats data tables as CSV files for email delivery if enabled

## Setup

**Analysis description**: Describe what you want to analyze. This is crucial for AI-generated scripts and serves as documentation for custom scripts.

**Python code**: The script that will be executed. Can be AI-generated, from a template, or written by you.

**Report columns (optional)**: Specify column names if your script produces a data table for CSV export.

**CSV export (optional)**: Enable if you want data tables available as CSV files for email delivery.

## What you get

After running, you'll have text summaries of analysis findings, optional data tables formatted for export, and comprehensive results ready for internal notes or email delivery.

## Common use cases

<AccordionGroup>
  <Accordion title="Custom client reports">
    Generate specific reports for clients that aren't available through standard reporting, like detailed ticket analysis or service delivery metrics.
  </Accordion>

  <Accordion title="Performance analysis">
    Analyze technician performance, response times, or resolution patterns to identify improvement opportunities and training needs.
  </Accordion>

  <Accordion title="Trend identification">
    Discover patterns in ticket data, customer behavior, or service delivery that inform strategic decisions and process improvements.
  </Accordion>

  <Accordion title="Compliance reporting">
    Create specialized compliance reports that meet specific regulatory or client requirements not covered by standard reports.
  </Accordion>
</AccordionGroup>

## Best practices

<AccordionGroup>
  <Accordion title="Clear descriptions for AI">
    Provide clear and specific descriptions in the "Describe what you want" field for best AI-generated script results.
  </Accordion>

  <Accordion title="Test thoroughly">
    Preview reports or test with small datasets to ensure scripts work correctly and produce expected results.
  </Accordion>

  <Accordion title="Keep it efficient">
    While flexible, overly complex scripts could be slow. Aim for efficient code that processes data quickly.
  </Accordion>

  <Accordion title="Review workflow history">
    After workflows run, review Event History to see analysis outputs and troubleshoot any issues with script execution.
  </Accordion>

  <Accordion title="Use templates when available">
    Start with pre-built templates when they match your needs, then customize as necessary for your specific requirements.
  </Accordion>

  <Accordion title="Plan for CSV delivery">
    If you need to email results, enable CSV export and use "Notify Internal Team" with email delivery for data attachment.
  </Accordion>
</AccordionGroup>

## Example workflows

<AccordionGroup>
  <Accordion title="Monthly Client Report">
    1. **Trigger:** Scheduled workflow (monthly)
    2. **Find Entities** - Gather all tickets for specific client from past month
    3. **Data Analysis** - Generate custom report with ticket summary and resolution metrics
    4. **Notify Internal Team** - Email report with CSV attachment to account manager
    5. **Result:** Automated monthly client reporting with detailed metrics
  </Accordion>

  <Accordion title="Performance Analysis">
    1. **Trigger:** Scheduled workflow (weekly)
    2. **Find Entities** - Get all closed tickets from past week
    3. **Data Analysis** - Analyze technician performance and response times
    4. **Add Ticket Note** - Document analysis on summary ticket
    5. **Notify Internal Team** - Send performance insights to management
    6. **Result:** Regular performance monitoring and improvement insights
  </Accordion>

  <Accordion title="Custom Compliance Report">
    1. **Trigger:** Scheduled workflow (quarterly)
    2. **Find Entities** - Gather tickets meeting specific compliance criteria
    3. **Data Analysis** - Generate specialized compliance analysis
    4. **Notify Internal Team** - Email detailed compliance report to stakeholders
    5. **Result:** Automated compliance reporting tailored to your requirements
  </Accordion>
</AccordionGroup>
