Skip to main content

What is A1?

A1 is a direct replacement for agent frameworks. While prior art generates a static while loop program for each agent, an agent compiler generates a program optimized for each unique agent input.

Why use an agent compiler?

  1. Safety - Minimizes exposure of sensitive data to an LLM.
  2. Speed - Up to 10x faster code generation.
  3. Determinism - Code is optimized for minimal non-deterministic behavior (e.g. LLM calls replaced with code where possible).
  4. Flexibility - Skills and Tools from any existing OpenAPI, MCP server, databases, fsspec paths, Python functions

Key Features

Quick Example

pip install a1-compiler
from a1 import Agent, tool, LLM
from pydantic import BaseModel

@tool
async def add(a: int, b: int) -> int:
    return a + b

class MathInput(BaseModel):
    problem: str

class MathOutput(BaseModel):
    answer: int

agent = Agent(
    name="math_agent",
    description="Solves simple math problems",
    input_schema=MathInput,
    output_schema=MathOutput,
    tools=[add, LLM("gpt-4.1")],
)

# Compile ahead-of-time
compiled = await agent.aot()
result = await compiled.execute(problem="What is 2 + 2?")

# Or execute just-in-time
result = await agent.jit(problem="What is 5 + 3?")

Get Started