> ## Documentation Index
> Fetch the complete documentation index at: https://docs.a1project.org/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.a1project.org/_mintlify/feedback/ourera/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# Agents

> Specify what agents can do

## Creating an Agent

```python  theme={null}
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

# Create agent
agent = Agent(
    name="calculator",
    description="Solves mathematical expressions",
    input_schema=MathInput,
    output_schema=MathOutput,
    tools=[add, multiply, LLM(model="gpt-4.1")],
)
```

## Running Agents

Execute agents with JIT (Just-in-Time):

```python  theme={null}
result = await agent.jit(problem="What is 2 + 3?")
print(result.answer)
```

For AOT compilation to turn agents into reusable tools, see [Compilation](/guide/compilation).

## Agent Properties

* **name**: Unique identifier
* **description**: What the agent does
* **input\_schema**: Pydantic model for inputs
* **output\_schema**: Pydantic model for outputs
* **tools**: Available tools (Tool, ToolSet, or LLM instances)
* **skills**: Optional reusable knowledge

## Accessing Tools

```python  theme={null}
# Get all tools (flattens ToolSets)
all_tools = agent.get_all_tools()

# Get specific tool
add_tool = agent.get_tool("add")
```

## Saving and Loading

```python  theme={null}
# Save to file
agent.save_to_file("my_agent.json")

# Load from file
agent = Agent.load_from_file("my_agent.json")
```

## Next Steps

* Learn about [Tools](/guide/tools)
* Explore [Compilation](/guide/compilation)
* Use [RAG](/guide/rag) for knowledge


Built with [Mintlify](https://mintlify.com).