> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Agent > LiveKit-compatible agent class that holds instructions, tools, and lifecycle hooks. [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** **`instructions`** `str` The system prompt text for the agent. --- **`session`** `AgentSession | None` — default: None The [`AgentSession`][agentsession] this agent is bound to. Set automatically when `session.start(agent)` is called. --- ## **Methods** #### [on\_enter](/docs/server-sdks/reference/python/agents/livewire/agent/on-enter) Lifecycle hook called when the agent enters. #### [on\_exit](/docs/server-sdks/reference/python/agents/livewire/agent/on-exit) Lifecycle hook called when the agent exits. #### [on\_user\_turn\_completed](/docs/server-sdks/reference/python/agents/livewire/agent/on-user-turn-completed) Lifecycle hook called when the user finishes speaking. #### [update\_instructions](/docs/server-sdks/reference/python/agents/livewire/agent/update-instructions) Update the agent's system prompt mid-session. #### [update\_tools](/docs/server-sdks/reference/python/agents/livewire/agent/update-tools) Replace the agent's tool list mid-session. #### [Pipeline Nodes](/docs/server-sdks/reference/python/agents/livewire/agent/pipeline-nodes) No-op pipeline stubs: stt\_node, llm\_node, tts\_node. > LiveKit-compatible agent class that holds instructions, tools, and lifecycle hooks. ## Docs - [on_enter](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/on-enter.md): Lifecycle hook called when the agent enters a session. - [on_exit](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/on-exit.md): Lifecycle hook called when the agent exits a session. - [on_user_turn_completed](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/on-user-turn-completed.md): Lifecycle hook called when the user finishes speaking. - [Pipeline Nodes](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/pipeline-nodes.md): No-op pipeline stubs for LiveKit API compatibility. - [update_instructions](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/update-instructions.md): Update the agent's system prompt mid-session. - [update_tools](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/update-tools.md): Replace the agent's tool list mid-session.