Skip to content

Krish3na/kaggle-multi-agent-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kaggle Multi-Agent System

An autonomous multi-agent system for Kaggle competition participation using LangGraph and LLM-based decision making.

Problem Statement

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

Solution Overview

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.

Architecture

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 agents
  • tools/ - LangChain tools for Kaggle API, data processing, and ML training
  • graph/ - LangGraph state schema and workflow orchestration
  • utils/ - Helper functions for LLM operations and logging

Requirements

  • Python 3.8+
  • Kaggle account with API credentials
  • OpenAI API key (GPT-4 recommended) or Anthropic API key (Claude 3.5 Sonnet)

Installation

  1. Clone the repository:
git clone <repository-url>
cd Kaggle-SlayingMulti-AgentTeam
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure Kaggle API:
# Download kaggle.json from https://www.kaggle.com/account
# Place it in ~/.kaggle/ (Unix) or %USERPROFILE%\.kaggle\ (Windows)
  1. 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_KEY

Usage

Test LLM connection:

python main.py --test-llm

Run for a specific competition:

python main.py --competition playground-series-s4e12

Visualize the workflow graph:

python main.py --visualize

Configuration

Edit configs/competitions.yaml to adjust:

  • LLM temperature and token limits
  • Agent behavior (max iterations, thresholds)
  • Model selection preferences

Project Structure

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

Implementation Details

The system implements a feedback loop where:

  1. LLM agents analyze the competition and make strategic decisions
  2. Tools execute those decisions reliably
  3. Results are fed back to agents for evaluation
  4. Agents decide whether to iterate or proceed

This architecture separates intelligence (LLM agents) from execution (tools), ensuring both adaptability and reliability.

Notes

  • 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

License

MIT

About

LangGraph-based multi-agent system for Kaggle competitions. Uses LangChain tools and LLM agents for intelligent model selection, automated ML training (LightGBM/XGBoost/CatBoost), and end-to-end competition workflow with state management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages