Skip to content

CSVAgent

⚠️ DEPRECATION WARNING

This component is deprecated and will be removed in a future version of Nappai. Please migrate to the recommended alternative components.

The CSVAgent component helps you analyze and interact with your data stored in CSV files using artificial intelligence. It connects your data file to an AI language model, allowing you to ask questions and get answers based on the information in your file. Think of it as a smart assistant that reads your spreadsheets and helps you understand the data.

How it Works

When you use this component, you provide a CSV file and connect it to an AI model. The agent automatically reads the structure of your file (like headers and columns) and uses the AI model to understand your questions. It then processes the data internally to generate accurate responses. The component acts as a bridge between your raw data and the AI’s ability to reason and answer queries.

Connection & Credentials

This component requires you to have a language model configured in your Nappai workspace before it can interact with external services:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type specified for this component and fill in the required fields (API Keys, tokens, etc.).
  3. In your workflow, select the saved credential in the Model input field of this node.

Inputs

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Model: The AI language model that powers the agent, responsible for reasoning and answering your queries based on the CSV data.
  • File Path: The path to the CSV file containing the data you want the agent to analyze. The file must be a valid CSV with headers.
  • Agent Type: The strategy the agent uses to plan and answer questions. Options include different methods like zero-shot reasoning or OpenAI tools.
  • Handle Parse Errors: Option to handle errors during file reading.
  • Input: Additional input field for the component.
  • Max Iterations: Controls the maximum number of steps the agent can take to solve a task.
  • Verbose: Enables detailed logging of the agent’s actions for troubleshooting.

Outputs

  • Agent: The configured agent executor object ready to process data.
  • Response: The message result from the agent.

Output Data Example (JSON)json

{ “component”: “AgentExecutor”, “status”: “ready”, “data_source”: “CSV File”, “model_configured”: true, “capabilities”: [ “Query CSV Data”, “Analyze Tables”, “Generate Insights” ] }

Connectivity

This component outputs an agent object, so you should connect its output to nodes that can execute workflows or process the agent’s responses. Typically, you would connect this to output nodes, visualization nodes, or downstream processing components that accept agent input to view the results of your analysis.

Usage Example

Scenario: Analyzing Monthly Sales

  1. Upload your sales_data.csv file to the File Path input.
  2. Connect your Model to an AI provider (e.g., OpenAI) in the Nappai panel.
  3. Connect the component’s output to an Output node to view the results.
  4. Run the workflow to get insights from your sales data.

Important Notes

🔒 Sensitive Data Handling 🟡 Medium Any data in the CSV is sent to the language model provider when the agent runs. Do not include personal or confidential information unless you use an on-prem or private LLM deployment.

⚠️ CSV File Size 🟡 Medium The agent processes the CSV entirely in memory. Large files (hundreds of megabytes) may cause performance issues or crashes. Split large datasets into smaller files if you encounter problems.

⚠️ CSV Format Requirements 🟡 Medium The CSV must have a header row and be properly comma‑delimited. Missing headers or irregular delimiters will result in errors. Validate the file before uploading.

📋 Model Configuration 🔴 High A language model must be configured and accessible (e.g., OpenAI API key). Without a valid model the agent cannot execute queries.

💡 Choose the Right Agent Type 🟢 Low OpenAI‑Tools is the default and works well for most scenarios. If you need more detailed reasoning use zero‑shot‑react‑description, or switch to openai‑functions if your queries call custom functions.

💡 Keep File Paths Simple 🟢 Low Provide local, relative paths to the CSV file. Avoid network shares or dynamic paths, as they may fail when the workflow runs in different environments.

⚙️ Logging and Monitoring 🟢 Low The component uses asynchronous callbacks to log actions. Enable logging in your workflow settings to view detailed execution traces and troubleshoot issues.

Tips and Best Practices

  • Split large datasets into smaller CSV files to avoid performance issues.
  • Ensure your CSV files have a clear header row for best results.
  • Use the “OpenAI-Tools” agent type for most standard analysis tasks.
  • Keep your model configuration active to ensure the agent can run queries.
  • Validate your CSV file structure before uploading to prevent errors.

Security Considerations

Be aware that data in your CSV files is sent to the language model provider for analysis. Avoid uploading files with sensitive or confidential information unless you are using a private or on-premises model deployment. Ensure your model credentials are stored securely in the Nappai panel.