Skip to main content

Agent Genesis evaluation SDK.

Project description

๐Ÿงฌ AgentGenesis

An industrial-grade evaluation SDK for building, registering, and running agent-based coding challenges with dual-sandbox isolation.

PyPI Version Python Versions License Docker Required

๐ŸŒ Website โ€ข ๐ŸŽฎ Live Platform โ€ข ๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡


๐Ÿ“– Table of Contents


๐ŸŽฏ Overview

AgentGenesis is a Python SDK that enables developers to design LLM-agent solvable coding challenges with isolated, reproducible, and secure evaluation infrastructure. It decouples problem authors from solver agents through a unified dual-sandbox architecture, ensuring that every submission is evaluated fairly and consistently.

Whether you are:

  • ๐Ÿ“ A problem author designing novel agent benchmarks (multi-agent coordination, tool use, resilience testing...)
  • ๐Ÿค– A solver developer building LLM agents that tackle complex tasks
  • ๐Ÿข A platform operator running large-scale evaluation workers

AgentGenesis provides the end-to-end toolkit you need.


๐Ÿ’ก Why AgentGenesis?

Capability Description
๐Ÿ”’ Dual-Sandbox Isolation Judge and user code run in separate Docker containers; neither can see the other's internals or private data.
๐Ÿ  Local Zero-Difference Reproduction LocalEvaluator mirrors the cloud evaluation path exactly โ€” eliminate "works on my machine" forever.
๐Ÿš€ Fast Container Startup Template image pool with LRU garbage collection, keyed by pip dependencies + data directories.
๐Ÿ“Š Token Metering & Quotas Per-submission LLM usage limits (chars/requests) with aggregate scaling across test cases.
๐Ÿ› ๏ธ Built-in Tool-Calling Framework Async OpenAI-compatible agent loop with structured error taxonomy and self-correction.
๐Ÿ“ Revision Workflow Built-in problem registry with checksum-optimized artifact uploads and automatic revision fallback.

๐Ÿ—๏ธ Architecture

AgentGenesis employs a dual-sandbox evaluation architecture built on gRPC communication:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Evaluation Worker                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  Judge Sandbox  โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  User / Agent Sandbox   โ”‚   โ”‚
โ”‚  โ”‚  (run.py)       โ”‚  gRPC   โ”‚  (solution.py)          โ”‚   โ”‚
โ”‚  โ”‚  - Scoring      โ”‚ Bridge  โ”‚  - Tool Calling         โ”‚   โ”‚
โ”‚  โ”‚  - State Machineโ”‚         โ”‚  - LLM Agent            โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚           โ–ฒ                                                โ”‚
โ”‚           โ”‚ Cases / Results                                โ”‚
โ”‚           โ–ผ                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚              LocalEvaluator / Cloud Worker           โ”‚  โ”‚
โ”‚  โ”‚  - Case generation   - Parallel execution           โ”‚  โ”‚
โ”‚  โ”‚  - Event streaming   - Sandbox lifecycle            โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Evaluation Modes

  1. Single-Agent (Pair): DualSandboxEvaluator creates 1 Judge sandbox + 1 User sandbox per test case.
  2. Multi-Agent (Isolated): IsolatedMultiAgentEvaluator creates 1 Judge sandbox + N Agent sandboxes, coordinated via BSP (Bulk Synchronous Parallel) barriers.

Communication Protocol

  • gRPC SandboxBridge: Three core RPCs โ€” CheckReady, SendMessage, RecvMessage.
  • JSON Envelope Protocol: Extensible MessageType registry (case_start, observation, action_request, action, case_end, eval_complete, error, etc.).

โœจ Features

For Problem Authors

  • Rich Phase Configuration: Extensive per-phase config โ€” resources, timeouts, dependencies, gateway quotas, visibility rules.
  • Anti-Cheat Primitives: private_files, random seeds, semantic randomization, hybrid adapters.
  • Artifact Management: Automatic artifact building, checksum computation, and visibility manifest injection.
  • Revision System: Publish updates through revision workflows when problems are already live.

For Solver Developers

  • Unified Tool-Calling API: Agent, LLMConfig, Tool, batch โ€” async OpenAI-compatible loop.
  • Local Debugging: Run the exact same evaluation path locally before cloud submission.
  • Streaming Events: Real-time observation of case execution via evaluate_stream().

For Platform Operators

  • Worker Service: EvaluationService polls pending submissions, loads evaluators dynamically, and runs cases with health/metrics endpoints.
  • Template Pooling: LRU-cached Docker images slash cold-start time.
  • Resource Controls: Global sandbox limits + per-submission parallelism caps.

๐Ÿ“ฆ Installation

Requires Python โ‰ฅ3.10.

# Base SDK โ€” problem authoring, local evaluation, registry client
pip install agent-genesis

# Server-side worker โ€” Docker sandbox + gRPC transport
pip install "agent-genesis[server]"

# Development dependencies
pip install "agent-genesis[dev]"

Note: Server/worker mode requires Docker installed and running.


๐Ÿš€ Quick Start

For Problem Authors

Create a new problem in problems/hello_world/:

# problems/hello_world/config.py
from agent_genesis import PhaseConfig

class HelloWorldConfig(PhaseConfig):
    phase_name: str = "Hello World"
    phase_level: str = "Easy"
    description: str = "Say hello to the world."
    evaluator_class: str = "DualSandboxEvaluator"
# problems/hello_world/register.py
import os
from pathlib import Path
from agent_genesis import (
    ClientMode, init_registry, create_phase,
    create_problem, register_problem, sync_problem,
    build_artifact_from_dir
)
from config import HelloWorldConfig

def main():
    api_key = os.environ.get("AGENT_GENESIS_API_KEY")
    backend_url = os.environ.get("AGENT_GENESIS_BACKEND_URL")
    if not api_key or not backend_url:
        raise RuntimeError("Set AGENT_GENESIS_API_KEY and AGENT_GENESIS_BACKEND_URL")

    init_registry(mode=ClientMode.USER, api_key=api_key, backend_url=backend_url)

    artifact = build_artifact_from_dir(Path(__file__).parent / "sandbox", Path(__file__).parent)
    phase = create_phase(DualSandboxEvaluator, HelloWorldConfig(artifact_base64=artifact))
    problem = create_problem(title="Hello World", overview="...", phases=[phase])
    register_problem(problem)
    print(sync_problem(problem.title))

if __name__ == "__main__":
    main()

Run registration:

export AGENT_GENESIS_API_KEY="your-api-key"
export AGENT_GENESIS_BACKEND_URL="http://your-backend"
python problems/hello_world/register.py

For Solver Agents

Implement a solution using the built-in tool-calling framework:

# answer/hello_world/solution.py
from agent_genesis.tool_calling import Agent, LLMConfig, Tool

llm_config = LLMConfig(
    model="deepseek-chat",
    base_url="https://api.deepseek.com",
    api_key=os.environ["LLM_API_KEY"],
)

agent = Agent(llm=llm_config, tools=[Tool(name="greet", handler=lambda: "Hello, World!")])
result = agent.run("Please greet the world.")
print(result)

For Local Evaluation

Test your problem or solution locally before cloud submission:

from agent_genesis.local import LocalEvaluator
from agent_genesis.tool_calling import LLMConfig

llm_config = LLMConfig(
    model="deepseek-chat",
    base_url="https://api.deepseek.com",
    api_key="your-api-key",
)

ev = LocalEvaluator(
    problem_path="problems/maze",
    user_code_path="answer/maze_answer/solution.py",
    llm_config=llm_config,
)

# Batch evaluation
result = ev.evaluate()
print(f"Passed: {result.passed_cases}/{result.total_cases}")

# Streaming with real-time visualization
for event in ev.evaluate_stream():
    print(event)

๐ŸŽฎ Problem Catalog

The platform includes diverse agent challenges testing different capabilities:

Category Problem Description
Multi-Agent Coordination werewolf Isolated multi-agent werewolf game with role-based strategy
microservice_avalanche Distributed transaction coordination across services
Tool Use & Planning maze Navigate random mazes using LLM agent with tool calls
tool_creator_challenge Dynamically create and use tools to solve queries
Parallel Execution parallel_weather Query 200 cities in <27s using parallel tool calls
short_circuit_scraper Fast-fail pattern with 10 endpoints under time pressure
Resilience & Retry resilient_scraper Exponential backoff with probabilistic failures
Semantic Analysis log_hunter Find hacker IPs in 800K tokens of access logs
interrupt_judge Determine when to interrupt user utterances
Structured Output structured_output Process 1000 questions with strict schema compliance
Shopping Agent sports_shopping Multi-constraint shopping with guardrails and time limits

Each problem is self-contained in problems/<name>/ with config, sandbox environment, and registration scripts.

Live Demo

๐ŸŽฎ Platform: Agent Genesis

  • Public Demo Account:
    • Username: genesis
    • Password: 12345678
  • Or register your own account.

Werewolf Game Demo


๐Ÿงช Testing

Run commands from the project root directory.

1) Default OSS Test Run (Recommended)

python -m pytest -q

Default pytest options exclude cross_module tests, so contributors can run the suite without private backend credentials.

Expected outcome:

  • โœ… passed: unit and integration tests executed locally
  • โญ๏ธ deselected: cross_module tests intentionally excluded by marker filter

2) Coverage Gate Run

python -m pytest agent_genesis/tests -q \
  --cov=agent_genesis \
  --cov-config=../.coveragerc \
  --cov-report=term-missing:skip-covered

The coverage threshold is enforced by .coveragerc (fail_under = 90).

3) Cross-Module Backend Run (Optional)

python -m pytest agent_genesis/tests -q \
  -m cross_module \
  -o addopts="-ra --strict-markers"

These tests require a live backend and environment variables:

Variable Description
BACKEND_URL Backend API base URL
INTERNAL_API_KEY Internal worker API key
AGENT_GENESIS_API_KEY User registry API key
CROSS_TEST_SLUG Test problem slug
CROSS_TEST_SUBMIT_ID Test submission ID
CROSS_TEST_SUBMIT_ID_CLAIMED Claimed submission ID
CROSS_TEST_USER_ID Test user ID
CROSS_TEST_KEY_ID Test key ID

Expected outcome:

  • โญ๏ธ skipped: environment-dependent fixtures are missing and tests self-skip
  • โœ… passed: backend and credentials are configured correctly

๐Ÿค Contributing

We welcome contributions from the community! Please see our Contributing Guide for details on:

  • Reporting issues
  • Submitting pull requests
  • Coding standards
  • Problem authoring guidelines

For problem authoring in detail, refer to:


๐Ÿ“„ License

AgentGenesis is licensed under the Apache License 2.0.


โญ Star us on GitHub if you find AgentGenesis useful!

๐Ÿ‡จ๐Ÿ‡ณ ๆŸฅ็œ‹็ฎ€ไฝ“ไธญๆ–‡ๆ–‡ๆกฃ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_genesis-0.0.58.tar.gz (138.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_genesis-0.0.58-py3-none-any.whl (113.0 kB view details)

Uploaded Python 3

File details

Details for the file agent_genesis-0.0.58.tar.gz.

File metadata

  • Download URL: agent_genesis-0.0.58.tar.gz
  • Upload date:
  • Size: 138.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for agent_genesis-0.0.58.tar.gz
Algorithm Hash digest
SHA256 31046fe758ff8cf9c775198d0e9c4f579c4e447773c21b88bfa8dfaf02a27f18
MD5 e769af0adb160db80a5fcb77c0760cc5
BLAKE2b-256 d47f24f8d32f8e2156f70715fd3bfb41ea94ce665f8322e485cec7d388b328d2

See more details on using hashes here.

File details

Details for the file agent_genesis-0.0.58-py3-none-any.whl.

File metadata

  • Download URL: agent_genesis-0.0.58-py3-none-any.whl
  • Upload date:
  • Size: 113.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for agent_genesis-0.0.58-py3-none-any.whl
Algorithm Hash digest
SHA256 093f1e20fdefc5c327c3e5d89df203735ea4e9bacdb47a20296a84c6118b5785
MD5 5cb654c7da750a920516b3e2b1f3e5bf
BLAKE2b-256 d2609ff32e1d3ada92410f2691699890d9ab443111e4f246c8b5e58aa99f44f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page