Skip to main content
Back

Technical Architecture

PilotDeck Agent Series

PilotDeck adopts a layered architecture to decouple interaction portals, task execution and basic capabilities. Desktop, web, CLI/TUI, and messaging channels share the same Agent runtime; session, file, and project memories are organized around the WorkSpace, allowing tasks to be continued between different portals.

1. System Panorama​

System panoramic architecture diagram

A request enters the Gateway from the interaction portal, and the corresponding WorkSpace and session are located by session routing, and then handed over to the Agent for execution. Agents coordinate context, models, and tools during runtime, and continuously return responses, status, and artifacts to the interface.

2. Layered Design​

HierarchyResponsibilitiesCollaboration
Interaction and accessReceive input and display responses, status and productsDifferent entrances access unified session capabilities through Gateway
Session and ExecutionManage session lifecycle, advance tasks and tool callsUse session as the unit of continuous work and Turn as the execution unit of a single request.
Context and decision-makingOrganize task information, control context budgets, and select modelsPrepare input relevant to the current task for each model call
Models and ToolsProvide reasoning, file operations, command execution and external servicesUse a unified interface to access and continue to advance tasks through tool results
Persistence and scalingSave conversations, project experiences and file history, and load extended capabilitiesMake sessions recoverable, knowledge reusable, and capabilities scalable by project

3. Task Execution Mechanism​

Agents translate natural language requests into an ongoing understand-action-feedback loop. The model determines the next action, the tool completes the specific operation, and the execution results are returned to the model context; when the task is completed or the execution is terminated, this round of requests ends.

3.1 Sessions and Tasks​

Sessions save the state of ongoing work, including historical messages, model preferences, execution status, and usage. One user input forms a Turn, which is responsible for organizing this round of model invocation and tool execution. Sessions can contain multiple Turns, so users can continue to ask questions, add conditions, or adjust goals based on the results of the previous round.

3.2 Single Round Execution Process​

Single-round execution process: user input, locate WorkSpace and session, prepare context, select model, initiate model request; execute the tool on demand and backfill the results, finally complete the current round of tasks and save the conversation and product

Text, tool calls, and status are continuously output as streaming events. Persistent records are written along with the execution process, allowing the interface to display real-time progress and read the results of this round later.

3.3 Model and Tool Collaboration​

The model is responsible for planning and judgment, and the tool is responsible for interacting with the actual environment. The tool call is executed after parameter verification and permission check, and the results are added to subsequent model requests. The Agent continues to iterate when multiple steps are required; cancellation, an unrecoverable error, or a loop limit ends execution. Recoverable request errors are retried according to the run policy.

4. Context Management​

Context is the basis for model understanding tasks. PilotDeck organizes core instructions, project instructions, skills, historical messages, tool results and related long-term memory as input for this request, and allocates budget according to the context window of the model.

As conversations grow, the system processes larger tool results and compresses historical context when necessary. Large results can be saved to a file to retain read references; historical compression generates summaries while retaining the information and tool call relationships needed to continue execution. When switching models, the budget is rechecked against the target model.

Session compression is used to continue the current task, and long-term memory is used to reuse knowledge across sessions. The two are maintained separately: the compressed summary is not directly equivalent to a long-term memory, and the long-term memory is formed and updated independently through Recall, Index and Dream.

5. Multi-Model Access​

PilotDeck unifies the requests and responses of different services through the model adaptation layer. Agents use consistent message and event formats to perform tasks, and the adaptation layer is responsible for converting them into the interface protocol of the target service. Model selection, routing and fallback can therefore be completed in the same execution flow.

5.1 Unified Messages and Events​

Unified protocols describe text, multimodal content, tool calls, streaming responses, and usage information. The upper-layer session does not need to maintain a separate execution process for each model, and the interaction portal can also present responses and tool status in a consistent manner.

5.2 Interface Protocol​

protocol identifierCorresponding interface
anthropicAnthropic Messages API
openaiOpenAI Chat Completions API and compatible interfaces
openai-responsesOpenAI Responses API
googleGoogle Gemini API

Capabilities such as image input, reflection parameters, and context windows are determined by the specific model and its configuration. Protocol adaptation provides a unified access method, and requests are still organized according to the capabilities of the selected model during runtime.

6. Tools and Permissions​

Tools enable Agents to read data, modify files, execute commands, and access external services. All tools are registered and called through a unified interface, and parameters, working modes, and permissions are checked before execution. Available capabilities vary depending on the operating environment and configuration.

6.1 Tool Capabilities​

AbilityTypical uses
Files and SearchRead, write and edit files, match paths, search content, edit notebooks
Commands and CodesExecute Shell commands and combine multiple tool operations through code
Network and external servicesObtain web pages, search information, and call tools provided by the MCP server
task collaborationManage plans and task lists, call sub-Agents, create and query background tasks
Interaction and outputAsk users for information, generate structured results, and send attachments

6.2 Execution and Scheduling​

Concurrent scheduling arranges calls according to the concurrency safety declared by the tool: operations that can be safely concurrently executed in parallel, the remaining operations are executed sequentially, and the results are returned in the order of the original calls. The runtime also supports sequential scheduling to adapt to different execution needs.

File access is based on the working directory and additional authorized directories, and combined with the current permission mode. WorkSpace provides project context, and the specific scope of operations is determined by permission rules and tool execution methods.

6.3 External Tool Access​

MCP converts external services into tools that the Agent can call. After the server connection is established, its tools enter the unified execution flow, and the model can use these capabilities just like the built-in tools. Global configuration is located at <PilotHome>/mcp.json, the project configuration is located at <project-root>/.pilotdeck/mcp.json;The server with the same name is subject to the project configuration.

7. Extension Mechanism​

PilotDeck extends task capabilities through Skills, Plugins, and lifecycle Hooks. Skills describe the operation methods and knowledge of specific tasks; Plugins provide tools, commands, MCP server and other capabilities; Hooks participate in processing at specified running stages. Extensions can be reused globally or loaded with projects, allowing the universal runtime to adapt to different work scenarios.

Developer Showcase

View all →