Metadata-Version: 2.4
Name: arc-agi-3
Version: 0.0.1
Summary: Python SDK for building ARC-AGI-3 agents
Project-URL: Homepage, https://arcprize.org/
Project-URL: Repository, https://github.com/arcprize/ARC-AGI-3-Agents
Project-URL: Documentation, https://docs.arcprize.org/
Author: Jumyung Park, ARC Prize Foundation
License-Expression: MIT
Keywords: agents,ai,arc-agi,benchmark,reasoning
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: numpy>=2.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: requests>=2.32.0
Provides-Extra: agentops
Requires-Dist: agentops>=0.4.0; extra == 'agentops'
Provides-Extra: all
Requires-Dist: agentops>=0.4.0; extra == 'all'
Requires-Dist: langchain-openai>=0.3.0; extra == 'all'
Requires-Dist: langchain>=0.3.0; extra == 'all'
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.0; extra == 'all'
Requires-Dist: langgraph>=0.6.0; extra == 'all'
Requires-Dist: langsmith>=0.1.0; extra == 'all'
Requires-Dist: openai>=1.50.0; extra == 'all'
Requires-Dist: smolagents>=1.0.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.5.0; extra == 'dev'
Provides-Extra: langgraph
Requires-Dist: langchain-openai>=0.3.0; extra == 'langgraph'
Requires-Dist: langchain>=0.3.0; extra == 'langgraph'
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.0; extra == 'langgraph'
Requires-Dist: langgraph>=0.6.0; extra == 'langgraph'
Requires-Dist: langsmith>=0.1.0; extra == 'langgraph'
Provides-Extra: openai
Requires-Dist: openai>=1.50.0; extra == 'openai'
Provides-Extra: smolagents
Requires-Dist: smolagents>=1.0.0; extra == 'smolagents'
Description-Content-Type: text/markdown

# arc-agi-3

Python SDK for building ARC-AGI-3 agents.

ARC-AGI-3 is an Interactive Reasoning Benchmark designed to measure an AI Agent's ability to generalize in novel, unseen environments. By building agents that can play ARC-AGI-3, you're directly contributing to the frontier of AI research.

## Installation

```bash
# Core installation (Random agent only)
pip install arc-agi-3

# With OpenAI support (LLM-based agents)
pip install arc-agi-3[openai]

# With LangGraph support
pip install arc-agi-3[langgraph]

# With SmolAgents support
pip install arc-agi-3[smolagents]

# With AgentOps observability
pip install arc-agi-3[agentops]

# Everything
pip install arc-agi-3[all]
```

## Quick Start

### 1. Get an API Key

1. Go to [three.arcprize.org](https://three.arcprize.org/)
2. Create an account and get your API key
3. Set it as an environment variable:

```bash
export ARC_API_KEY="your-api-key-here"
```

Or create a `.env` file:

```
ARC_API_KEY=your-api-key-here
```

### 2. Run an Agent

Using the CLI:

```bash
# Run a random agent on the ls20 game
arc-agi-3 --agent=random --game=ls20

# Run with tags for tracking
arc-agi-3 --agent=random --game=ls20 --tags=experiment,v1.0

# List available agents
arc-agi-3 --list-agents
```

Or programmatically:

```python
from arc_agi_3 import Swarm, AVAILABLE_AGENTS

# Run a swarm of agents
swarm = Swarm(
    agent="random",
    ROOT_URL="https://three.arcprize.org",
    games=["ls20"],
    tags=["my-experiment"],
)
scorecard = swarm.main()
print(f"Final score: {scorecard.score}")
```

## Available Agents

| Agent | Extra Required | Description |
|-------|----------------|-------------|
| `random` | None | Random action selection |
| `llm` | `openai` | Basic LLM agent using GPT-4o-mini |
| `fastllm` | `openai` | LLM agent without observation step |
| `reasoningllm` | `openai` | LLM with o4-mini reasoning |
| `guidedllm` | `openai` | LLM with game-specific guidance |
| `reasoningagent` | `openai` | Hypothesis-driven reasoning agent |
| `langgraphrandom` | `langgraph` | Random agent using LangGraph workflow |
| `langgraphfunc` | `langgraph` | LangGraph functional API agent |
| `langgraphtextonly` | `langgraph` | LangGraph without image frames |
| `smolcodingagent` | `smolagents` | SmolAgents CodeAgent |
| `smolvisionagent` | `smolagents` | SmolAgents with vision |

## Building Your Own Agent

Subclass the `Agent` base class:

```python
from arc_agi_3 import Agent
from arc_agi_3._structs import FrameData, GameAction, GameState

class MyAgent(Agent):
    MAX_ACTIONS = 80

    def is_done(self, frames: list[FrameData], latest_frame: FrameData) -> bool:
        return latest_frame.state is GameState.WIN

    def choose_action(
        self,
        frames: list[FrameData],
        latest_frame: FrameData,
    ) -> GameAction:
        # Your logic here
        if latest_frame.state in [GameState.NOT_PLAYED, GameState.GAME_OVER]:
            return GameAction.RESET

        # Choose an action based on the frame data
        action = GameAction.ACTION1
        action.reasoning = "My reasoning for this action"
        return action
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `ARC_API_KEY` | Your ARC-AGI-3 API key | Required |
| `SCHEME` | HTTP scheme | `https` |
| `HOST` | API host | `three.arcprize.org` |
| `PORT` | API port | (standard) |
| `RECORDINGS_DIR` | Directory for session recordings | `.` |
| `AGENTOPS_API_KEY` | AgentOps API key for observability | Optional |
| `OPENAI_API_KEY` | OpenAI API key for LLM agents | Required for LLM agents |
| `DEBUG` | Enable debug logging | `False` |

## Data Structures

### GameAction

Available actions:
- `RESET` - Start or restart a game
- `ACTION1` - Simple action (typically Up/W)
- `ACTION2` - Simple action (typically Down/S)
- `ACTION3` - Simple action (typically Left/A)
- `ACTION4` - Simple action (typically Right/D)
- `ACTION5` - Simple action (typically Enter/Space)
- `ACTION6` - Complex action with x,y coordinates (Click/Point)
- `ACTION7` - Simple action

### GameState

- `NOT_PLAYED` - Game hasn't started
- `NOT_FINISHED` - Game in progress
- `WIN` - Game won
- `GAME_OVER` - Game lost

### FrameData

Each frame contains:
- `game_id` - The game identifier
- `frame` - 3D list of grid data (list of 2D grids)
- `state` - Current GameState
- `score` - Current score (0-254)
- `available_actions` - List of valid actions for this state

## Links

- [ARC Prize](https://arcprize.org/)
- [ARC-AGI-3 Preview](https://three.arcprize.org/)
- [Documentation](https://docs.arcprize.org/)
- [GitHub Repository](https://github.com/arcprize/ARC-AGI-3-Agents)

## License

MIT License - see the original [ARC-AGI-3-Agents](https://github.com/arcprize/ARC-AGI-3-Agents) repository.
