Skip to main content
A programmatically built AgentOS cannot hot-reload — serve(reload=True) warns and serves without reload.

Quick Start

1

What happens today

serve(reload=True) on a programmatic AgentOS emits a UserWarning and runs without reload:
The CLI praisonai app --reload prints the same guidance in yellow.
2

Get reload with a module factory

Expose your AgentOS as a module-level factory and run uvicorn against the import string:

Why reload is unsupported

Uvicorn’s reload worker runs in a separate process and re-imports the target module. A programmatically built AgentOS(agents=[...]) has no importable module-level app. The reload worker would start empty and fail, so serve(reload=True) warns and serves without reload rather than crash.
Non-reload serving is unchanged. AgentOS(agents=[...]).serve() works exactly as before.

Common Patterns

Development with reload

Point uvicorn at your factory so edits to mymodule.py reload automatically:

Production without reload

For production, call serve() directly — reload is a development-only convenience:

Best Practices

Expose create_app() returning AgentOS(...).get_app() and run uvicorn "mymodule:create_app" --factory --reload. Uvicorn controls the import, so each edit re-imports cleanly.
Reload re-imports on every change and adds overhead. Serve with AgentOS(...).serve() (no reload) in production.
praisonai serve agents --reload, praisonai serve unified --reload, and praisonai serve recipe --reload all hot-reload because they load from a file via an app factory. See Serve.

Serve

--reload support across CLI serve commands

Recipe Serve Advanced

App-factory pattern for workers and reload