Architecture overview
DataAgent divides a local execution into five layers. Upper layers may call lower layers; lower layers do not import the host in reverse.
flowchart TB
subgraph hosts [Hosts]
Web[ui/web]
TUI[ui/tui]
REST[dataagent.server]
A2A[dataagent.server.a2a]
SDK[Python SDK]
end
subgraph product [Product assembly]
Client[client.Agent]
Agent[assembly.graph.build_graph]
Ext[Extension compilation]
Prompt[assembly.prompts]
end
subgraph prep [Preparation]
Boot[bootstrap.prepare_runtime]
end
subgraph contracts [Declarations]
Settings[config.settings]
Decl[config.declarations]
end
subgraph core [Bundled core]
Graph[create_deep_agent]
end
Web --> REST
TUI --> REST
A2A --> Client
REST --> Client
SDK --> Client
Client --> Agent
Agent --> Ext
Agent --> Prompt
Agent --> Graph
REST --> Boot
A2A --> Boot
SDK --> Boot
Boot --> Settings
Settings --> Decl
Ext --> Declpyproject.toml defines the datagallery-dataagent Python distribution. Source code lives in dataagent/, and both the import name and CLI are dataagent. The package contains the runtime, HTTP/A2A services, SDK, Home templates, and built-in plugins.
| Module | Responsibility |
|---|---|
config/declarations.py |
Describe plugin, Hook, and MCP data shapes |
config/settings.py |
Define effective product configuration. Configuration readers and plugin manifest parsing also live in config/ |
bootstrap/ |
Resolve paths, environment, and configuration; locate extensions; return PreparedRuntime |
extensions/ |
Compile selected declarations into Deep Agents arguments |
assembly/prompts/ |
Compose filesystem instructions and extension prompts |
assembly/graph.py |
Add limits, session directories, and tracing, then call create_deep_agent |
assembly/context.py / semantic_client/ |
Supply model and semantic HTTP clients |
model_stream.py |
Merge model message chunks; plugins can call SDK collect_model_stream |
client.py |
Implement Agent and create_agent, manage graphs per session, and inject context into SDK and AG-UI calls |
diagnostics/ |
Define structured exceptions, render redacted errors and log events, and configure logging |
server/ |
Provide health checks, product routes, session indexes, and event streams |
server/a2a/ |
Expose the same graph as an A2A 1.0 service. dataagent serve mounts these routes; serve-a2a starts a separate process |
core/ |
Provide the Deep Agents graph, file tools, summarization, and subagents |
Hosts enter the product through the public SDK and dataagent.host. When a session first needs a graph, client.py calls assembly.graph.build_graph, which loads extensions and host configuration into the engine's graph. Later calls fetch that session's graph through client.py and run it. bootstrap uses config to read and validate configuration and diagnostics to report problems. import dataagent stays lightweight; LangChain-related objects load lazily.
Follow the execution path
- Bootstrap explains how configuration becomes PreparedRuntime.
- Execution explains session graph assembly and the difference between standard graphs and compiled entries.
- Extension lifecycle records compilation, caching, and refresh coordination.
- Path resolution and session bindings and state and storage explain directories, bindings, and checkpoints.
- Context and prompts, runtime logs, execution traces, and security boundaries explain message management, diagnostics, and access.
See the user-facing architecture overview for client connections and core maintenance for bundled-core maintenance rules.