***

title: Agent
slug: /reference/python/agents/livewire/agent
description: LiveKit-compatible agent class that holds instructions, tools, and lifecycle hooks.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[agentsession]: /docs/server-sdks/reference/python/agents/livewire/agent-session

[agentbase]: /docs/server-sdks/reference/python/agents/agent-base

[functiontool]: /docs/server-sdks/reference/python/agents/livewire/function-tool

[onenter]: /docs/server-sdks/reference/python/agents/livewire/agent/on-enter

[onexit]: /docs/server-sdks/reference/python/agents/livewire/agent/on-exit

[onuserturncompleted]: /docs/server-sdks/reference/python/agents/livewire/agent/on-user-turn-completed

[updateinstructions]: /docs/server-sdks/reference/python/agents/livewire/agent/update-instructions

[updatetools]: /docs/server-sdks/reference/python/agents/livewire/agent/update-tools

[pipeline-nodes]: /docs/server-sdks/reference/python/agents/livewire/agent/pipeline-nodes

The `Agent` class mirrors a LiveKit agent. It holds the system prompt (instructions),
a list of tools, and optional lifecycle hooks. When bound to an
[`AgentSession`][agentsession], the session
translates this into a SignalWire
[`AgentBase`][agentbase] under the hood.

```python {8}
from signalwire.livewire import Agent, function_tool

@function_tool
def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"It is sunny in {city}."

agent = Agent(
    instructions="You are a helpful weather assistant.",
    tools=[get_weather],
)
```

## **Properties**

<ParamField path="instructions" type="str" toc={true}>
  The system prompt text for the agent.
</ParamField>

<ParamField path="session" type="Optional[AgentSession]" toc={true}>
  The [`AgentSession`][agentsession] this
  agent is bound to. Set automatically when `session.start(agent)` is called.
</ParamField>

## **Methods**

<CardGroup cols={2}>
  <Card title="on_enter" href="/docs/server-sdks/reference/python/agents/livewire/agent/on-enter">
    Lifecycle hook called when the agent enters.
  </Card>

  <Card title="on_exit" href="/docs/server-sdks/reference/python/agents/livewire/agent/on-exit">
    Lifecycle hook called when the agent exits.
  </Card>

  <Card title="on_user_turn_completed" href="/docs/server-sdks/reference/python/agents/livewire/agent/on-user-turn-completed">
    Lifecycle hook called when the user finishes speaking.
  </Card>

  <Card title="update_instructions" href="/docs/server-sdks/reference/python/agents/livewire/agent/update-instructions">
    Update the agent's system prompt mid-session.
  </Card>

  <Card title="update_tools" href="/docs/server-sdks/reference/python/agents/livewire/agent/update-tools">
    Replace the agent's tool list mid-session.
  </Card>

  <Card title="Pipeline Nodes" href="/docs/server-sdks/reference/python/agents/livewire/agent/pipeline-nodes">
    No-op pipeline stubs: stt\_node, llm\_node, tts\_node.
  </Card>
</CardGroup>