Architecture
Architecture overview
Understand how the Pinter frontend, backend, and ADK execution modules fit together.
Pinter is split into a React frontend and a FastAPI backend.
The frontend owns the user interface. The backend owns authentication, persistence, agent configuration, tool resolution, ADK execution, and API routes.
System shape
flowchart TD
User[User] --> FE[Pinter frontend]
FE --> API[FastAPI /api]
API --> DB[(PostgreSQL)]
API --> ADK[ADK execution modules]
ADK --> Tools[Tools and MCP servers]
ADK --> Models[Model providers]
ADK --> DB
Main seams
| Seam | Interface | Implementation |
|---|---|---|
| Frontend API seam | api, stream, upload in src/shared/auth/authenticated.ts | Fetch calls with token refresh and AuthError. |
| Route seam | TanStack file routes in src/routes | Domain packages under src/apps; cross-domain imports use package exports. |
| Agent execution seam | ADKExecutor.execute() | Agent factory, runner, persister, prompt guard, token usage. |
| Agent construction seam | AgentFactory.create_agent() | DB config loading, instruction merge, model resolution, tool resolution. |
| Tool resolution seam | ToolRegistry.resolve_tools() | Built-ins, tool rows, agent tools, MCP toolsets, integrations. |
| Workflow execution seam | ADKWorkflowExecutor.execute() | Graph validation, execution plan, node runners, state, token usage. |
These seams are deep modules: callers learn a small interface and get a large amount of behavior behind it.
Request flow
sequenceDiagram
actor User
participant FE as Frontend
participant API as FastAPI route
participant Executor as ADKExecutor
participant Factory as AgentFactory
participant Runner as AgentRunner
participant DB as PostgreSQL
User->>FE: Send chat message
FE->>API: POST /api/conversations/{id}/send
API->>Executor: execute(agent_id, input_text)
Executor->>Factory: create_agent(agent_id)
Factory->>DB: Load agent, model, tools
Factory-->>Executor: ADK agent
Executor->>Runner: Run agent
Runner-->>FE: SSE chunks
Executor->>DB: Persist messages, token usage, traces
Code map
| Area | Path |
|---|---|
| Frontend routes | pinter-fe/src/routes |
| Frontend domains | pinter-fe/src/apps |
| Shared frontend modules | pinter-fe/src/shared |
| Backend domain composition | pinter-be/routes/api.py |
| Backend domains | pinter-be/modules/{identity,agents,conversations,knowledge,integrations,evaluations,governance,content} |
| Agent runtime | pinter-be/modules/agents/runtime |
| Database models | pinter-be/db/models |