This document models the VDSAgents multi-agent system as a Role-Based Dynamic Bayesian Network (RB-DBN). Unlike traditional multi-agent models that bind actions to specific static agents, this system utilizes Role Ports.
In this architecture, "Planner", "Worker", and "Reflector" are not fixed agent instances, but Role Classes (or Ports).
-
Role (
$R_t$ ): A dynamic functional interface selected based on the system state. -
Action (
$A_t$ ): An operation belonging to the active Role's action space, not a specific agent's identity.
The system dynamically schedules a "Role" to handle the current context, effectively decoupling the what (Action) from the who (Agent Instance).
The causal flow for a single time step
The composite state of the data science lifecycle.
-
$S_t \in \mathcal{S}$ : The state space. -
Components:
-
FSM_State:${ \text{IDLE}, \text{STAGE_RUNNING}, \text{STEP_RUNNING}, \text{BEHAVIOR_RUNNING}, \text{BEHAVIOR_COMPLETED}, \text{STEP_COMPLETED}, \text{STAGE_COMPLETED} }$ -
Location:${ \text{StageID}, \text{StepID}, \text{BehaviorID}, \text{Iteration}, \text{Progress} }$ -
Context:${ \text{Variables}, \text{NotebookContent}, \text{ExecutionEffects}, \text{Artifacts} }$
-
A structured projection of the state available to the active role.
-
$O_t = f(S_t)$ : Deterministic projection. -
Features:
$O_{err}$ (Errors),$O_{goal}$ (Goal Status),$O_{art}$ (Artifacts).
The decision variable determining which Role Port is active for the current time step.
-
$R_t \in \mathcal{R}$ : The role space. -
Values:
-
$\text{PlannerRole}$ : Responsible for structural decomposition. -
$\text{WorkerRole}$ : Responsible for code/text generation. -
$\text{ReflectorRole}$ : Responsible for evaluation and correction.
-
The specific operation executed, drawn from the Action Space of the selected Role
-
If
$R_t = \text{PlannerRole}$ :$A_t \in \mathcal{A}_{plan}$ -
PlanStage,PlanStep,DelegateTask,CompletePlanning
-
-
If
$R_t = \text{WorkerRole}$ :$A_t \in \mathcal{A}_{work}$ -
ExecCode,AddText,CommentResult
-
-
If
$R_t = \text{ReflectorRole}$ :$A_t \in \mathcal{A}_{ref}$ -
BugAnalysis,UpdateCode,ExecNewVersion,CompleteReflection
-
The system deterministically or probabilistically selects the active role based on the FSM state.
Actions are generated conditionally on the Role and Observation.
- High probability of
ExecCodefor calculation tasks. - High probability of
AddTextfor explanation tasks.
Transitions are driven by the executed action.
-
$T(..., A_{complete}) \rightarrow \text{BEHAVIOR_RUNNING}$ (Loop) or$\text{STEP_COMPLETED}$ -
$T(..., A_{retry}) \rightarrow \text{BEHAVIOR_COMPLETED}$ (Self-loop for re-evaluation)
graph TD
subgraph Time t
S_t[State S_t] --> O_t[Observation O_t]
O_t --> R_t{Role Selection R_t}
R_t -- "Planner" --> A_plan[Action Space: Planner]
R_t -- "Worker" --> A_work[Action Space: Worker]
R_t -- "Reflector" --> A_ref[Action Space: Reflector]
A_plan --> A_t((Action A_t))
A_work --> A_t
A_ref --> A_t
A_t --> S_next[State S_{t+1}]
end
style R_t fill:#f9f,stroke:#333,stroke-width:2px
style A_t fill:#ff9,stroke:#333,stroke-width:2px
For academic representation, the RB-DBN can be described as:
Where:
-
$R_t$ acts as a Switching Variable (or Multiplexer) that determines the conditional distribution of$A_t$ .
- Dynamic Dispatch: The system doesn't "have" 3 agents waiting. It "instantiates" a role behavior on demand.
-
Contextual Action Space: The valid actions
$A_t$ are constrained strictly by$R_t$ . A Worker cannot mark a step complete; only a Reflector can. -
Scalability: New roles (e.g., "Reviewer", "Optimizer") can be added simply by expanding the domain of
$R_t$ and defining$\mathcal{A}_{new}$ , without changing the core DBN structure.