The backend uses FastAPI, SQLAlchemy, PostgreSQL, and Google ADK. The active API surface is mounted under:
Route registration lives in:

Main backend modules

Agent run flow

ADKExecutorV2.execute() is the main runtime interface for chat-driven agent execution. It performs these steps:
1

Validate attachments

Multimodal inputs are checked before model execution.
2

Guard the prompt

Prompt extraction attempts are blocked before agent creation.
3

Build the agent

AgentFactoryV2 loads the agent, model, tools, planner, and generation config.
4

Run the agent

AgentRunner streams events back to the client.
5

Persist the run

Messages, token usage, and traces are saved after execution completes.

Agent construction

AgentFactoryV2.create_agent(agent_id) loads an agent record and creates the correct ADK agent type. The factory also merges the 5-pattern instruction fields into a single instruction:
  1. Identity.
  2. Mission.
  3. Methodology.
  4. Boundaries.
  5. Examples.

Tool reference formats

The tools array on an agent can contain:

Workflow executor

ADKWorkflowExecutor.execute() runs graph workflows and returns JSON:
The workflow runtime validates the graph, compiles an execution plan, runs ready nodes, handles condition routing, prunes dead paths, and records node results.