Skip to main content
Version: 2026.1

Architecture

This section explains how the bundle works internally. It is for developers who need to understand the system end-to-end - to extend it, debug it, or reason about a failure mode. For "what can the product do," see Features. For YAML/env reference, see Configuration. Terminology is defined once in Core Concepts; this section assumes you have read that page.

System diagram

system_architecture.pngsystem_architecture.pngsystem_architecture.png

Pages

PageWhat you'll learn
01 Agent FrameworkHow the Copilot SDK is wrapped, the two adapters (Copilot/Dummy), LLM auth modes, model resolution, performance instrumentation.
02 Communication FlowsStart here. The system map - every runtime flow (chat/SSE, internal & external MCP, persistence, config export, Mercure, LLM) and the credential each one uses, with links to the canonical detail.
03 Request LifecycleEnd-to-end path of a chat request: auth → session → task → the three event sinks (Mercure / PHP / POST) → catch-up reconnect → completion callback.
04 AuthenticationThe credential reference behind the flow map: session cookie validation + identity cache, the pmcp_ bearer scope, admin bearer token, per-provider LLM auth, Mercure publisher JWT, rate limits, CSRF, audit log.
05 MCP IntegrationInternal vs external MCP servers, tool groups, the meta-tool wrapper, how the pmcp_ bearer and session IDs are forwarded, the token lifecycle.
06 Session StorageWhat is persisted, the DB tables, session lifecycle hooks.
07 Tool SecurityThe pre-tool-use hook, SDK tool whitelist, path sandboxing. Mechanism only - for the tool catalog see the Configuration reference.
08 Configuration SystemHow agent and skill configuration flows from PHP to the agent-server: the three-layer merge, the export endpoint, skill materialization, reload paths, startup recovery.
09 Field Hint SystemHow the bundle teaches agents the correct JSON shape for every Pimcore field type - provider pattern, registry, covered types, recursion depth guard.
10 Document SchemaHow get_document_schema / get_area_brick work - the four signals an LLM receives, the AST analyzer, fixture loading + validation, the <index> placeholder convention, target-group personalization. For the fixture authoring workflow, see Extending → Template Examples.
11 File StagingThe generic read-only file-set primitive: developer-configured sets, how an agent stages and reads them, the roots/denylist security model.
12 Agent Template GenerationThe template write path: private root + Twig namespace, the validator and sandbox, test-render, persistence, clone-and-reassign, the drift-guard lint.
13 Real-time SyncMulti-client chat: live turn delivery to every tab/device via Studio's Mercure per-user topic + GlobalMessageBus, PHP as the record, the catch-up / reconnect-refetch reliability model, busy state.
14 Agent TasksHeadless agent tasks: the AgentTask state machine, settlement, turn orchestration, the Node-owned finalize nudge, the maintenance watchdog, and the delegated-access model.

The frontend is a Pimcore Studio plugin delivered via Module Federation. It has no architecturally distinct surface beyond what Studio itself documents - the one extension point you'll likely touch is the widget renderer registry, covered in Extending → Custom Rich Chat Widgets.

Components at a glance

ComponentDirectoryStack
Agent-serveragent-server/Node.js 22, Fastify 5, TypeScript, @github/copilot-sdk
Frontend pluginassets/React 18, Redux Toolkit, Ant Design / @ant-design/x, RSBuild, Module Federation
PHP bundlesrc/Symfony 7, Pimcore 2026.x, MCP tools, session storage API, installer