An autonomous multi-agent system for Kaggle competition participation using LangGraph and LLM-based decision making.
Building an intelligent system that can autonomously participate in Kaggle competitions by:
- Analyzing competition requirements and selecting appropriate strategies
- Processing and preparing competition data
- Training and evaluating multiple machine learning models
- Generating and submitting predictions
- Monitoring performance and adapting approach based on results
This implementation uses a modern agentic AI architecture where:
LLM-Powered Agents make strategic decisions:
- Competition analysis and problem type identification
- Model selection based on competition characteristics
- Performance evaluation and next-action decisions
Deterministic Tools handle reliable execution:
- Kaggle API operations (download, submit, leaderboard)
- Data processing and feature engineering
- Model training and cross-validation
LangGraph orchestrates the workflow with state management and conditional routing based on agent decisions.
The system uses a state graph where agents and tools work together:
Competition Analyzer (LLM) -> Download Data (Tool) -> Analyze Data (Tool)
-> Preprocess (Tool) -> Model Strategy (LLM) -> Train Models (Tool)
-> Performance Analyzer (LLM) -> [Decision: retrain/submit/stop]
Key components:
agents/- LLM-powered decision-making agentstools/- LangChain tools for Kaggle API, data processing, and ML traininggraph/- LangGraph state schema and workflow orchestrationutils/- Helper functions for LLM operations and logging
- Python 3.8+
- Kaggle account with API credentials
- OpenAI API key (GPT-4 recommended) or Anthropic API key (Claude 3.5 Sonnet)
- Clone the repository:
git clone <repository-url>
cd Kaggle-SlayingMulti-AgentTeam- Install dependencies:
pip install -r requirements.txt- Configure Kaggle API:
# Download kaggle.json from https://www.kaggle.com/account
# Place it in ~/.kaggle/ (Unix) or %USERPROFILE%\.kaggle\ (Windows)- Configure environment variables:
cp .env.example .env
# Edit .env and add your API keys:
# - OPENAI_API_KEY or ANTHROPIC_API_KEY
# - KAGGLE_USERNAME and KAGGLE_KEYTest LLM connection:
python main.py --test-llmRun for a specific competition:
python main.py --competition playground-series-s4e12Visualize the workflow graph:
python main.py --visualizeEdit configs/competitions.yaml to adjust:
- LLM temperature and token limits
- Agent behavior (max iterations, thresholds)
- Model selection preferences
agents/ - LLM-powered agents for decision making
tools/ - LangChain tools for execution
graph/ - LangGraph workflow and state management
utils/ - Utilities for LLM operations and logging
configs/ - Configuration files
main.py - Entry point
The system implements a feedback loop where:
- LLM agents analyze the competition and make strategic decisions
- Tools execute those decisions reliably
- Results are fed back to agents for evaluation
- Agents decide whether to iterate or proceed
This architecture separates intelligence (LLM agents) from execution (tools), ensuring both adaptability and reliability.
- Estimated cost per competition: $1-2 in LLM API calls
- Supports tabular competitions (image/NLP support can be added)
- Uses checkpointing for long-running workflows
- Includes submission tracking and rate limiting
MIT