RFC: Declarative (JSON/YAML) definition of Action-Driven Networks with per-turn structured-output enforcement #3201
elCaptnCode
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We build a framework (Mozaiks, OSS) that treats AG2 as its agentic execution backbone. Our workflows are declarative contracts: agents, tools, transition rules, and structured-output schemas are declared in strict YAML, validated against typed models, and then compiled at runtime into AG2-native objects (
TransitionGraph,WorkflowAdapter,ContextEquals,ToolCalled, etc.) through a thin adapter. Determinism is the core requirement — routing decisions and artifact shapes must be reproducible from the declared contract, with the LLM's freedom confined to producing schema-validated structured outputs.The Action-Driven Network design (blog post) fits this well conceptually — stateless adapters, state as a pure fold of the WAL. But today we maintain several adapter-layer workarounds to keep the declarative/deterministic contract, and we'd like to know which of these AG2 intends to own natively:
Declarative network definition. Is a canonical serialized schema (JSON/YAML) planned for defining a Workflow channel — agents,
TransitionGraphrules, adapter config — so a network can be loaded, validated, and diffed as data rather than constructed only in Python? Today we compile our own YAML into the Python objects; a first-class serialized form (or a stable "compile target" schema) would let external frameworks target the Action-Driven Network without private adapters.Per-agent
response_schemaon Workflow channels.Agent.ask()supportsresponse_schema, but network turns don't appear to. We currently validate structured outputs after reading the WAL and treat our validation as the artifact authority. Is provider-level schema enforcement per agent turn on Workflow channels planned? (We'd still keep our own validation as the contract authority — we want model-side pressure, not replacement.)Composable, data-declarable transition conditions. Our contracts declare source-scoped deterministic routes (
source_agent+ context equality / tool-called / small context-variable expressions). AG2's built-in conditions don't compose (FromSpeaker AND ContextEquals) and there's no expression evaluator, so we register custom conditions. Is native condition composition and/or a serializable condition grammar planned, so routing rules can live entirely in the declared file?A public round-end packet hook. Our tools mutate context variables that routing must see before
WorkflowAdapter.fold(...)selects the next speaker; we currently wrap the default notify handler to merge those updates into the round-end packet, which is our most fragile divergence. Is a supported hook or native context-update path planned?Typed one-shot Consulting primitive. Many of our control-plane checkpoints are exactly the Consulting shape (one question, one schema-validated reply, hard close). Is a typed one-shot Consulting API with
response_schemaplanned, so these don't need to go throughAgent.ask()outside a channel?The overall question: does AG2 see "the network as a validated data artifact" — declarative definition, typed conditions, per-turn schema enforcement — as in scope for the Action-Driven Network roadmap, or should frameworks like ours plan to permanently own the compile-from-declaration layer and keep only the runtime execution on AG2? Either answer helps us draw the boundary correctly; we'd rather consume native primitives than maintain parallel ones.
Happy to share our adapter code and YAML contract shapes if useful.
All reactions