Skip to main content

Package layout

At runtime the server also creates agents_pool/, artifacts_store/ and uploads/.

Runtime architecture

This runtime view highlights the main execution path: incoming requests reach the FastAPI entry point, the app bootstraps the internal services and ADK runtime, and persistence is kept in the database plus the artifact storage layer.

Startup sequence

1

Create runtime directories

agents_pool/, artifacts_store/, uploads/.
2

Run auto-migrations

ensure_* functions bring every table up to date. There is no separate migration command — the schema converges at boot.
3

Generate agent modules

Each agent stored in the database is materialised as a Python module under agents_pool/.
4

Start background tasks

Webhook renewal runs every six hours.
5

Mount the ADK sub-application

The Google ADK FastAPI application is mounted into the main app.
6

Load extensions

Modules named in TH2_EXTENSIONS register their routers, which are mounted after the core’s. See Editions.
Migrations run at boot. Rolling the application back to a previous release does not roll the schema back — plan a database backup before upgrading a production instance.

Database models

Supported models

Model access goes through LiteLLM, so provider strings follow its convention:
  • Anthropic — anthropic/claude-sonnet-4-5-20250929
  • OpenAI — openai/gpt-4o
  • Mistral — mistral/mistral-large-latest
  • Google — gemini/gemini-pro
  • OVHcloud — ovhcloud/DeepSeek-R1-Distill-Llama-70B
  • Eden AI — edenai/anthropic/claude-haiku-5-5
Eden AI is a gateway, so its ids already name the downstream provider. The edenai/ prefix keeps that id whole and sends the call to https://api.edenai.run/v3, so an agent needs only its Eden AI key and no endpoint. Set model_api_base to point elsewhere, for instance https://api.eu.edenai.run/v3 for the EU region.