Skip to main content

Package layout

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

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:
  • Anthropicanthropic/claude-sonnet-4-5-20250929
  • OpenAIopenai/gpt-4o
  • Mistralmistral/mistral-large-latest
  • Googlegemini/gemini-pro
  • OVHcloudovhcloud/DeepSeek-R1-Distill-Llama-70B

Related topics

Installation