Pinter
ENID
Architecture
View as Markdown

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

SeamInterfaceImplementation
Frontend API seamapi, stream, upload in src/shared/auth/authenticated.tsFetch calls with token refresh and AuthError.
Route seamTanStack file routes in src/routesDomain packages under src/apps; cross-domain imports use package exports.
Agent execution seamADKExecutor.execute()Agent factory, runner, persister, prompt guard, token usage.
Agent construction seamAgentFactory.create_agent()DB config loading, instruction merge, model resolution, tool resolution.
Tool resolution seamToolRegistry.resolve_tools()Built-ins, tool rows, agent tools, MCP toolsets, integrations.
Workflow execution seamADKWorkflowExecutor.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

AreaPath
Frontend routespinter-fe/src/routes
Frontend domainspinter-fe/src/apps
Shared frontend modulespinter-fe/src/shared
Backend domain compositionpinter-be/routes/api.py
Backend domainspinter-be/modules/{identity,agents,conversations,knowledge,integrations,evaluations,governance,content}
Agent runtimepinter-be/modules/agents/runtime
Database modelspinter-be/db/models