Skip to main content

Using Data Analysis Actions in elvex

Updated yesterday

Enabling Data Analysis for an Agent

To enable data analysis for your elvex agent, follow these steps:

  1. Open your agent's configuration settings

  2. Navigate to the "Actions" section

  3. Locate the "Data Analysis" option and toggle it to the "On" position

  4. Save your agent configuration by clicking "Save & Publish"

When do Agents use Data Analysis?

Once data analysis actions are enabled for an agent, your agent will decide when to read files you've uploaded, analyze column headers and sample rows, and write and execute SQL queries against data. The rules and context in your agent configuration and user interactions in the chat help guide the decisions that the agent makes for when to use the data analysis actions.

How do I know when an Agent is using the Data Analysis action?

When you upload a file into a conversation with an agent, the first thing you'll see is that the agent has "Analyzed connected file." This is your confirmation that the file has been processed and you can now interact with it.

If you then ask the agent to run an analysis on the file you uploaded, you may see a message that starts with "Ran SQL query." This is your confirmation that the Data Analysis action was used to complete the analysis. Below that, you'll see the actual SQL query the agent made to conduct the analysis. This gives you transparency to review the query for a full understanding of how it has approached the task you've assigned.

Providing Context for Your Agents

To get the best performance when using Data Analysis, it's important that your agent has good understanding of the terminology used in the file it is analyzing. For example, if a user asks, "What is the average number of units sold per order of Blue Widgets over the last six months?" the agent will look for "Blue Widgets" in the datasource to run its analysis. If the file you've uploaded uses the SKU and not the product name, the agent will not be able to answer your question, unless you tell it that the SKU for Blue Widgets is 12345678.

How to provide context

Method 1: When sending your request in the chat, modify your request to read, ""What is the average number of units sold per order of Blue Widgets (SKU 12345678) over the last six months?"

Method 2: When setting up your agent, navigate to "Context and Datasources" in the agent's configuration settings. In the Context field, you can provide a list of every product and the correlating SKU. This way, when a user sends a request in a chat, the agent will know how to associate the product name with the SKU, even if only the SKU is in the uploaded file. This method works best if you expect users to regularly repeat an analysis with the same type of information, but with updated monthly sales data for example.

Method 3: Change the data in the source file to match the way you expect users to naturally interact with it. In this example, if the file contains SKUs without the product names, you might decide to replace the SKU with the file name or modify so the file includes the SKU and the file name.

Generating Graphs, Charts, and Tables

When the Data Analysis action is turned on for an agent, elvex can produce visual graphs, charts, and data tables.

Data Analysis in Slack and API

Currently, file uploads are only supported on chats with agents in the elvex UI. File uploads are not supported in requests via Slack or API. This limits the Data Analysis feature, though it will still work if your request includes a copy / paste of data in csv or table format. We expect file uploads to be supported in Slack and API at some point in the future, but until then, we highly recommend using the elvex UI for any requests that require file uploads and / or Data Analysis.

Conclusion

The data analysis feature in elvex agents empowers you to extract valuable insights and perform data manipulation on attached spreadsheet files. By enabling this feature, you can create more sophisticated and data-driven interactions within your agents.

Data Analysis FAQ

Q: Can I do Data Analysis on a pdf or other non-spreadsheet file?

A: We highly recommend structuring your data into a spreadsheet file before asking an elvex agent to perform analysis on top of it. If you provide a pdf or other non-spreadsheet file, the agent will first have to extract the data from the file and create a table behind the scenes so it can perform the analysis. This opens up more opportunity for the agent to misinterpret your data, and you'll have limited visibility into the table the agent created. If you can't provide the same data in a spreadsheet file, you may want to first try asking the agent to extract the data from the pdf and create a csv file from it. You can then open the csv file, review it for accuracy, save any changes, and upload it so the agent can perform the analysis.

Q: Does Data Analysis work with any AI provider and model?

A: Yes, elvex has designed "actions", like Data Analysis, to work across any AI provider and model your agent is connected with. Actions like Data Analysis are elvex features that we make work on top of the model your agent is connected to. That being said, Data Analysis will work best with more advanced models like ChatGPT-4, ChatGPT-4 Turbo, Claude 3 Opus, Claude 3 Sonnet, and other similarly powerful models.

Q: Are errors possible with Data Analysis?

A: Yes, just as with human analysis, errors are possible. It's best to always check the query and output for accuracy.

Did this answer your question?