Reads a spreadsheet file and lets the agent peek inside without needing a full data-science toolkit. It can describe the columns, compute basic statistics, preview rows, or filter them.
Loads a CSV or TSV file (from a path or inline content) and applies one of five operations: 'describe' returns column schema and summary stats; 'stats' computes min/max/mean/stddev on numeric columns; 'head' previews the first N rows; 'filter' selects rows matching a column/value; 'count' returns the total row count.
When a user asks:
Describe the columns in sales.csv.
the agent calls the tool:
csv_analysis(path="sales.csv", operation="describe")and gets back: column names, types, counts, min/max, mean, and standard deviation.
Wire this tool into a SwarmAI crew. Use the YAML DSL for declarative workflows, or the Java builder API when you want full programmatic control.
YAML DSL
# dataset-qa.yaml
name: dataset-qa-crew
process: SEQUENTIAL
agents:
- id: inspector
role: Data Inspector
goal: Peek inside CSV datasets without a full data-science stack
tools:
- csv_analysis
tasks:
- id: dataset-qa-task
agent: inspector
description: Describe the columns of sales.csv and preview the first 5 rows.Java
import ai.intelliswarm.swarmai.agent.Agent;
import ai.intelliswarm.swarmai.task.Task;
import ai.intelliswarm.swarmai.swarm.Swarm;
import ai.intelliswarm.swarmai.swarm.SwarmOutput;
import ai.intelliswarm.swarmai.process.ProcessType;
import ai.intelliswarm.swarmai.tool.common.CSVAnalysisTool;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
@Autowired ChatClient chatClient;
@Autowired CSVAnalysisTool cSVAnalysisTool;
Agent inspector = Agent.builder()
.role("Data Inspector")
.goal("Peek inside CSV datasets without a full data-science stack")
.chatClient(chatClient)
.tool(cSVAnalysisTool)
.build();
Task inspectorTask = Task.builder()
.description("Describe the columns of sales.csv and preview the first 5 rows.")
.agent(inspector)
.build();
SwarmOutput result = Swarm.builder()
.agent(inspector)
.task(inspectorTask)
.process(ProcessType.SEQUENTIAL)
.build()
.kickoff();Real scenarios where agents put this tool to work.
Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/common/CSVAnalysisTool.java in the swarm-ai repository.