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

# agent

> Agents for Marvin.

# `marvin.agents.agent`

Agents for Marvin.

An Agent is an entity that can process tasks and maintain state across interactions.

## Constants

### `T`

```python theme={null}
T = TypeVar('T')
```

## Classes

### `Agent`

```python theme={null}
class Agent(name: str = (lambda: random.choice(AGENT_NAMES))(), instructions: str | None = None, description: str | None = None, verbose: bool = False, prompt: str | Path = Path('agent.jinja'), tools: list[Callable[..., Any]] = (lambda: [])(), memories: list[Memory] = (lambda: [])(), mcp_servers: list[Any] = (lambda: [])(), model: KnownModelName | Model | None = None, model_settings: ModelSettings = ModelSettings())
```

An agent that can process tasks and maintain state.

**Methods:**

* **`get_agentlet`**
  ```python theme={null}
  def get_agentlet(self, tools: Sequence[Callable[..., Any]], end_turn_tools: Sequence[EndTurn], active_mcp_servers: list[MCPServer] | None = None) -> pydantic_ai.Agent[Any, Any]
  ```
* **`get_mcp_servers`**
  ```python theme={null}
  def get_mcp_servers(self) -> list[MCPServer]
  ```
* **`get_memories`**
  ```python theme={null}
  def get_memories(self) -> list[Memory]
  ```
* **`get_model`**
  ```python theme={null}
  def get_model(self) -> Model | KnownModelName
  ```
* **`get_model_settings`**
  ```python theme={null}
  def get_model_settings(self) -> ModelSettings
  ```
* **`get_prompt`**
  ```python theme={null}
  def get_prompt(self) -> str
  ```
* **`get_tools`**
  ```python theme={null}
  def get_tools(self) -> list[Callable[..., Any]]
  ```

## Functions

### `handle_event`

```python theme={null}
def handle_event(event: Event, handlers: list[Handler | AsyncHandler] | None = None)
```

Handle an event by passing it to all registered handlers.

***

**Parent Module:** [`agents`](marvin-agents)
