Skip to main content

Overview

The SpreadSheetSwarm processes tasks concurrently across multiple agents and automatically saves execution metadata to CSV files. It supports loading agent configurations from CSV files and running tasks either from configuration or on-demand.

Installation

Attributes

str
default:"Spreadsheet-Swarm"
The name of the swarm
str
default:"A swarm that processes tasks concurrently..."
The description of the swarm
List[Agent]
default:"None"
The agents participating in the swarm. If None, agents will be loaded from load_path
bool
default:"True"
Whether to enable autosave of swarm metadata
str
default:"None"
The file path to save the swarm metadata as a CSV file (auto-generated if None)
int
default:"1"
The number of times to repeat the swarm tasks
str
default:"None"
Path to CSV file containing agent configurations. Required if agents is None
bool
default:"False"
Enable verbose logging

Methods

run()

Run the swarm with the specified task.
Parameters:
  • task (str): The task to be executed by the swarm. If None, uses tasks from config
Returns: Dictionary containing run summary with outputs and metadata

run_from_config()

Run all agents with their configured tasks concurrently.
Returns: Dictionary containing execution summary

load_from_csv()

Load agent configurations from a CSV file.
Expected CSV format:

export_to_json()

Export the swarm outputs to JSON.
Returns: JSON string representation of swarm outputs

Usage Examples

Basic Usage with Agents

Load from CSV Configuration

Create a CSV file (agents_config.csv):
Then load and run:

Multiple Loops

Custom Save Path

Export Results

Output Format

The run() method returns a dictionary:

CSV Output Format

Results are automatically saved to CSV with these columns:

Features

  • Concurrent Execution: All agents run tasks in parallel for maximum performance
  • Automatic CSV Logging: All executions are logged to CSV files automatically
  • CSV Configuration: Load agent configurations from CSV files
  • Multiple Loops: Run each agent multiple times with max_loops
  • Workspace Integration: Automatically uses workspace directory from environment
  • JSON Export: Export results to JSON format
  • Metadata Tracking: Tracks timestamps, run IDs, and execution metadata