Skip to content

AndresCotton/agentic-eval-multi-participant-coordination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Agent Evaluation Framework for Multi-Participant Coordination

License: CC BY-NC 4.0 Python 3.8+ TypeScript LangGraph MCP

A comprehensive testbed for evaluating AI agents on open-ended coordination tasks Built with LangGraph, Custom MCP Tools, and LLM-as-a-Judge evaluation

πŸš€ What I Built

This project implements a production-ready AI agent evaluation framework that systematically tests how LLM agents handle complex, multi-step coordination tasks. The system evaluates agent performance across 9 different experimental conditions, processing 540 end-to-end experiments with comprehensive metrics and automated evaluation.

Key Technical Achievements

  • πŸ”§ Custom MCP Server: Built a TypeScript-based Model Context Protocol server extending Google Maps API with custom tools including find_middle_point for geographic calculations
  • πŸ€– Agent Orchestration: Built LangGraph workflow graphs with conditional routing for both single and multi-agent architectures
  • πŸ§ͺ Multi-Dimensional Evaluation: Designed comprehensive metrics combining Bayesian-weighted ratings, proximity scores, tool compliance, and LLM-as-a-Judge for holistic agent assessment
  • πŸ“Š Experimental Testbed: Designed systematic variations testing agent autonomy (3 planning levels Γ— 3 information structures = 9 conditions)
  • 🎯 User Simulation: Built realistic multi-user simulator with adaptive preference changes and decentralized information access

πŸ’‘ Engineering Highlights

1. Custom MCP Tool Development

Extended an open-source MCP Google Maps server with custom tools:

  • find_middle_point: Geographic midpoint calculator for multiple locations
  • Enhanced search_nearby with minRating parameter for filtering
  • Full TypeScript implementation with proper error handling

2. LangGraph Agent Architecture

Built robust agentic workflows with production monitoring:

  • Conditional routing: Agent β†’ Tools β†’ Agent loop based on LLM tool calls
  • State management: Conversation history, turn counting, user tracking
  • Multi-step reasoning: Iterative planning and execution cycles
  • User simulation system: Independent conversation threads for 1-10 participants
  • LangSmith integration: Full observability with execution tracing and debugging

3. Comprehensive Evaluation Framework

Built multi-dimensional evaluation system combining hard metrics and LLM assessment:

Reliability Metrics:

  • Tool compliance scoring (tracking required API calls)
  • Task completion rates
  • Trajectory analysis

Performance Metrics (Quantitative):

  • Bayesian-weighted ratings: Quality assessment accounting for review count
  • Proximity scores: Walking time discretization (5-min intervals)
  • Optimal baseline comparison: Ranking against best possible selections

LLM-as-a-Judge (Qualitative):

  • Web search integration for dietary restriction validation (259 cached results)
  • Structured evaluation with Chain-of-Thought reasoning
  • Multi-point scoring rubric

Combined Score:

  • Geometric mean preventing one-dimensional optimization
  • Balanced trade-offs between ratings, proximity, and restrictions

4. Scalable Experiment Pipeline

  • Bash orchestration running 540 experiments across 3 models
  • Parallel execution with proper resource management
  • Comprehensive logging and result aggregation
  • CSV export for analysis

πŸ“Š Key Results

Through systematic experimentation, I discovered:

  • 40% performance degradation when agents must independently decompose tasks (measuring impact of reduced guidance)
  • Multi-agent frameworks don't always help: OctoTools used 3.5Γ— more tokens with no performance gains
  • Information structure matters: Centralized information consistently outperforms decentralized
  • Agents struggle with autonomy: Error recovery and multi-user coordination remain challenging

πŸ› οΈ Tech Stack

Backend & Agents:

  • Python 3.8+ with LangGraph for agent orchestration
  • LangChain for LLM integration (OpenAI GPT-4o-mini, GPT-4.1-mini)
  • LangSmith for production-ready observability and tracing
  • Async/await patterns for efficient I/O
  • Custom state management and message routing

Infrastructure:

  • TypeScript/Node.js for MCP server development
  • Model Context Protocol (MCP) for tool integration
  • Google Maps API for location services
  • Bash scripting for experiment orchestration

Evaluation & Analysis:

  • Multi-metric system: Bayesian statistics, proximity calculations, tool compliance
  • LLM-as-a-Judge with GPT-4.1-mini for dietary restriction assessment
  • Web search integration with caching (259 cached queries)
  • Pandas for data analysis and CSV processing
  • Matplotlib/Seaborn for visualization

DevOps & Monitoring:

  • LangSmith tracing for agent execution monitoring
  • Environment-based configuration (.env)
  • Modular architecture (src/, infrastructure/, experiments/)
  • Comprehensive logging and error tracking
  • Cost analysis and token usage monitoring

πŸ—οΈ Repository Structure

dissertation/
β”œβ”€β”€ src/                                   # Source code
β”‚   β”œβ”€β”€ agents/                            # Core experimental agents
β”‚   β”‚   β”œβ”€β”€ centralized_decentralized_agent.py
β”‚   β”‚   β”œβ”€β”€ adaptive_agent.py
β”‚   β”‚   β”œβ”€β”€ octotools_centralized_decentralized_agent.py
β”‚   β”‚   └── octotools_adaptive_agent.py
β”‚   β”œβ”€β”€ utils/                             # Shared utilities
β”‚   β”‚   β”œβ”€β”€ prompts.py                     # Experimental prompt manipulations
β”‚   β”‚   β”œβ”€β”€ message_to_user_n.py          # User simulator framework
β”‚   β”‚   └── middlelocation.py             # Geographical calculations
β”‚   └── users/                             # Test data
β”‚       └── sample_event.py                # Event configurations
β”‚
β”œβ”€β”€ infrastructure/                        # Infrastructure components
β”‚   β”œβ”€β”€ mcp-google-map/                    # Custom MCP Google Maps server
β”‚   β”‚   β”œβ”€β”€ src/                           # TypeScript source
β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts                   # Main MCP server
β”‚   β”‚   β”‚   └── maps-tools/                # Tool implementations
β”‚   β”‚   β”‚       β”œβ”€β”€ mapsTools.ts           # Tool definitions (find_middle_point)
β”‚   β”‚   β”‚       └── searchPlaces.ts        # Place search logic
β”‚   β”‚   └── dist/                          # Compiled JavaScript
β”‚   β”œβ”€β”€ local_mcp/                         # MCP utilities
β”‚   β”‚   └── mcp_utils.py                   # MCP client activation
β”‚   └── octotools/                         # OctoTools framework (external)
β”‚       β”œβ”€β”€ octotools/                     # Core framework
β”‚       β”‚   β”œβ”€β”€ solver.py                  # Main solver
β”‚       β”‚   β”œβ”€β”€ models/                    # Planner, executor, memory
β”‚       β”‚   └── tools/                     # Tool implementations
β”‚       └── tasks/                         # Task definitions
β”‚
β”œβ”€β”€ experiments/                           # Experiments and results
β”‚   β”œβ”€β”€ comprehensive_experiment_pipeline.sh  # Main experiment runner
β”‚   β”œβ”€β”€ 4o_mini_logs/                      # GPT-4o-mini logs (222 files)
β”‚   β”œβ”€β”€ 4_1_mini_logs/                     # GPT-4.1-mini logs (214 files)
β”‚   β”œβ”€β”€ octotools_logs/                    # OctoTools logs (100 files)
β”‚   β”œβ”€β”€ gpt-4o-mini_analysis_results.csv   # GPT-4o-mini results
β”‚   β”œβ”€β”€ gpt-4.1-mini_analysis_results.csv  # GPT-4.1-mini results
β”‚   β”œβ”€β”€ results_octotools.csv              # OctoTools results
β”‚   β”œβ”€β”€ evaluations_scripts/               # Analysis and visualization
β”‚   └── specialized_analysis/              # Targeted analysis scripts
β”‚
β”œβ”€β”€ LLM_as_a_judge/                        # LLM-as-Judge evaluation
β”‚   β”œβ”€β”€ llm_as_a_judge.py                  # Main judge implementation
β”‚   β”œβ”€β”€ judge_process_logs.py              # Log processing
β”‚   β”œβ”€β”€ cache_manager.py                   # Caching system
β”‚   β”œβ”€β”€ web_search_cache/                  # Cached searches (259 files)
β”‚   └── octotools_version/                 # OctoTools-specific judge
β”‚
β”œβ”€β”€ demos/                                 # Quick demos
β”‚   β”œβ”€β”€ demo_centralized.sh
β”‚   β”œβ”€β”€ demo_adaptive.sh
β”‚   β”œβ”€β”€ demo_planning_overhead_comparison.sh
β”‚   └── README.md
β”‚
β”œβ”€β”€ docs/                                  # Documentation
β”‚   β”œβ”€β”€ SETUP.md                           # Installation guide
β”‚   β”œβ”€β”€ EXPERIMENTS.md                     # Experiments guide
β”‚   └── REPOSITORY_STRUCTURE.md            # Structure documentation
β”‚
β”œβ”€β”€ figures/                               # Visualizations
β”‚   β”œβ”€β”€ *.jpg                              # Performance plots
β”‚   β”œβ”€β”€ pdfs/                              # Publication-ready figures
β”‚   └── svgs/                              # Vector graphics
β”‚
β”œβ”€β”€ cost_analysis/                         # Token usage analysis
β”‚   β”œβ”€β”€ COST_ANALYSIS_SUMMARY.md           # Summary and key findings
β”‚   β”œβ”€β”€ cost_analysis.py                   # Main analysis script
β”‚   β”œβ”€β”€ log_cleaner.py                     # Log cleaning utility
β”‚   └── detailed_token_analysis.csv        # Detailed results (508 experiments)
β”‚
β”œβ”€β”€ README.md                              # This file
β”œβ”€β”€ requirements.txt                       # Python dependencies
β”œβ”€β”€ setup.py                               # Package setup
└── LICENSE                                # CC BY-NC 4.0 License

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 16+ (for MCP server)
  • Google Maps API key

Installation

  1. Clone the repository
git clone <repository-url>
cd dissertation
  1. Install the package in development mode
pip install -e .

This installs all Python dependencies and sets up proper import paths.

  1. Install MCP server dependencies
cd infrastructure/mcp-google-map
npm install
npm run build
cd ../..
  1. Set up environment variables
cp .env.example .env
# Edit .env and add your API keys:
# - GOOGLE_MAPS_API_KEY
# - OPENAI_API_KEY
# - LANGSMITH_API_KEY (optional, for tracing)

Running a Demo

Test a single centralized scenario:

python3 src/agents/centralized_decentralized_agent.py \
    7 \                          # 7 invitees
    0 \                          # preference index 0 (vegetarian)
    "centralized" \              # information complexity
    "medium_overhead" \          # planning overhead
    "gpt-4o-mini"                # model

Running Full Experiments

To reproduce the dissertation results:

cd experiments
./comprehensive_experiment_pipeline.sh

This will:

  1. Run 540 experiments across all conditions
  2. Analyze results with custom metrics
  3. Apply LLM-as-Judge evaluation
  4. Generate visualizations

⚠️ Warning: Full pipeline takes ~24 hours and costs ~$150 in API calls.

πŸ”¬ Experimental Design

Independent Variables

  1. Information Complexity (How information is distributed):

    • Centralized: All participant info provided upfront
    • Decentralized: Agent must query each user separately
    • Adaptive: Users may change preferences mid-conversation
  2. Planning Overhead (Amount of guidance given to agent):

    • Low: Detailed step-by-step instructions (max scaffolding)
    • Medium: Goal + general approach (moderate scaffolding)
    • High: Only the goal (tests autonomous planning)
  3. Agent Architecture:

    • GPT-4o-mini (single agent)
    • GPT-4.1-mini (single agent)
    • OctoTools (multi-agent framework)

Dependent Variables

Reliability Metrics:

  • Tool Compliance Score: Geometric mean of required API call ratios (0 if any tool unused)
  • Task Completion Rate: Percentage yielding valid formatted output

Performance Metrics:

  • Bayesian Decision Quality: Weighted ratings (prior: ΞΌ=3.0, C=50) normalized against optimal baseline
  • Proximity Decision Quality: Walking time scores (10pts for 0-5min, 9pts for 5-10min, etc.) vs optimal
  • Restriction Fulfillment (LLM-as-a-Judge): 0-2 point rubric per venue, averaged and normalized

Combined Score:

  • Geometric mean: βˆ›(Bayesian Γ— Proximity Γ— Restrictions) - penalizes extreme deficiencies

πŸ“ˆ Key Results

Performance by Planning Overhead

Model Low Medium High
GPT-4o-mini 0.92 0.84 0.53
GPT-4.1-mini 0.95 0.87 0.58
OctoTools 0.87 0.79 0.41

Token Usage by Scenario

Agent Centralized Decentralized Adaptive
GPT-4o-mini 4,034 5,721 9,209
GPT-4.1-mini 6,170 6,173 7,101
OctoTools 14,868 20,882 30,337

Success Rates

  • Centralized: 94.7% (GPT-4o-mini best)
  • Decentralized: 89.2% (significant drop)
  • Adaptive: 73.6% (multi-user failures)

πŸ› οΈ Custom Contributions

1. MCP Google Maps Server Extensions

Added to existing @cablate/mcp-google-map server:

  • find_middle_point tool: Calculates geographical midpoint from list of locations
  • minRating parameter: Quality filtering for venue search
  • Enhanced error handling: Improved robustness for agent use

2. Multi-Dimensional Evaluation System

Comprehensive assessment framework combining:

  • Hard Metrics: Bayesian-weighted ratings (C=50 prior confidence), proximity scores (5-min discretization), tool compliance (geometric mean)
  • LLM-as-a-Judge: Web-search enhanced dietary restriction evaluation with structured rubric
  • Optimal Baselines: Systematic comparison against best possible selections from search results
  • Cost Optimization: Web search caching reduces evaluation costs by 90%
  • Combined Score: Geometric mean preventing single-dimension gaming

3. Planning Overhead Manipulation

Novel experimental design systematically varying agent autonomy:

  • Reveals 40% performance drop without scaffolding
  • First systematic study of guidance-performance relationship
  • Challenges assumptions about autonomous agent capabilities

πŸ“Š Analysis Scripts

# Generate performance plots
python3 experiments/evaluations_scripts/new_plots.py

# Analyze unfinished experiments
python3 experiments/evaluations_scripts/unfinished_experiments_analysis.py

# Token cost analysis
python3 cost_analysis/cost_analysis.py

# LLM-as-Judge evaluation
python3 LLM_as_a_judge/judge_process_logs.py <log_dir> <results_csv>

πŸŽ“ Research Context

This project was developed as part of my MSc in Speech and Language Processing at the University of Edinburgh (2025). The research investigates how AI agents perform on open-ended coordination tasks and explores the relationship between task scaffolding and agent autonomy. This work was supervised by PhD Alexandra Birch and PhD Patrick Chen.

Key Research Questions:

  • How does reducing task guidance affect agent performance?
  • When do multi-agent architectures provide advantages over single agents?
  • What evaluation methods effectively measure agent capabilities on complex tasks?

Full Abstract: Understanding how AI agents perform on open-ended coordination tasks with minimal human guidance is an important evaluation challenge. This work varies information access and planning autonomy across three levels each (9 conditions total), then evaluates agents using custom reliability and performance metrics. Through 540 experiments, we identify systematic limitations including 40% performance degradation without scaffolding and persistent multi-user communication failures.

πŸ› οΈ Potential Applications

This framework serves both research and commercial needs:

Research & Development

  • Agent benchmarking: Test any LLM agent on multi-step coordination tasks
  • Tool integration testing: Evaluate how agents use custom tools (MCP)
  • Multi-agent analysis: Compare single vs multi-agent architectures

Commercial Applications (via quickword.app)

  • Coordination Task Automation: Production-ready agent orchestration for multi-participant planning scenarios (event scheduling, resource allocation, group decision-making).

🀝 Built With

πŸ“„ License

This work is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).

You may:

  • βœ… View and review for hiring/recruitment purposes
  • βœ… Use for academic research and education
  • βœ… Share and adapt with attribution

You may NOT:

  • ❌ Use commercially or for profit
  • ❌ Sell or monetize this work

See LICENSE file for full details.

πŸ“§ Contact

AndrΓ©s Cotton MSc Speech and Language Processing, University of Edinburgh

  • πŸ’Ό Open to opportunities in AI/ML Engineering, Agent Development, and NLP
  • πŸ”— LinkedIn | GitHub
  • πŸ“¬ Open an issue for questions about the code

This repository showcases a comprehensive AI agent evaluation framework built with modern tools (LangGraph, MCP, LLM-as-a-Judge) and demonstrates full-stack development from infrastructure (TypeScript MCP server) to evaluation (Python pipeline processing 540 experiments).

About

AI agent evaluation framework for multi-participant coordination tasks. Built with LangGraph, custom MCP tools, and LLM-as-a-Judge evaluation. MSc dissertation project (University of Edinburgh, 2025).

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors