***

title: get_app
slug: /reference/python/agents/agent-base/get-app
description: Get the FastAPI application instance for use with deployment adapters.
max-toc-depth: 3
---------------------

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

Get the fully initialized FastAPI application instance. If the app has not been
created yet, this method initializes it with all routes, middleware, health checks,
and security headers -- the same configuration that `serve()` would create.

This is primarily used with deployment adapters like Mangum (AWS Lambda) or when
embedding the agent in a larger FastAPI application.

## **Parameters**

None.

## **Returns**

`FastAPI` -- The configured FastAPI application instance with all agent endpoints
registered.

## **Examples**

### AWS Lambda with Mangum

```python {7}
from mangum import Mangum
from signalwire import AgentBase

agent = AgentBase(name="lambda-agent")
agent.set_prompt_text("You are a helpful assistant.")

app = agent.get_app()
handler = Mangum(app)
```

### Embed in existing FastAPI app

```python {7}
from fastapi import FastAPI
from signalwire import AgentBase

main_app = FastAPI()
agent = AgentBase(name="assistant", route="/agent")

main_app.mount("/ai", agent.get_app())
```