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.
๐ Website โข ๐ฎ Live Platform โข ๐จ๐ณ ็ฎไฝไธญๆ
๐ Table of Contents
- Overview
- Why AgentGenesis?
- Architecture
- Features
- Installation
- Quick Start
- Problem Catalog
- Testing
- Contributing
- License
๐ฏ 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
- Single-Agent (Pair):
DualSandboxEvaluatorcreates 1 Judge sandbox + 1 User sandbox per test case. - Multi-Agent (Isolated):
IsolatedMultiAgentEvaluatorcreates 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
MessageTyperegistry (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:
EvaluationServicepolls 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
- Username:
- Or register your own account.
๐งช 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_moduletests 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:
- ๐จ๐ณ ๅบ้ขๆๅ.md โ Chinese problem authoring guide
- ๐จ๐ณ ๅฟซ้็ๆ้กน็ฎ.md โ Chinese quick start guide
๐ License
AgentGenesis is licensed under the Apache License 2.0.
โญ Star us on GitHub if you find AgentGenesis useful!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31046fe758ff8cf9c775198d0e9c4f579c4e447773c21b88bfa8dfaf02a27f18
|
|
| MD5 |
e769af0adb160db80a5fcb77c0760cc5
|
|
| BLAKE2b-256 |
d47f24f8d32f8e2156f70715fd3bfb41ea94ce665f8322e485cec7d388b328d2
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093f1e20fdefc5c327c3e5d89df203735ea4e9bacdb47a20296a84c6118b5785
|
|
| MD5 |
5cb654c7da750a920516b3e2b1f3e5bf
|
|
| BLAKE2b-256 |
d2609ff32e1d3ada92410f2691699890d9ab443111e4f246c8b5e58aa99f44f5
|