Wave-2 follow-up — ag2: - hitl-in-chat-booking is functionally identical to hitl-in-chat on AG2 (both use useHumanInTheLoop with TimePickerCard); aliased to the same /demos/hitl-in-chat route, mirroring the langgraph-python manifest. Earlier 'skipped — missing primitive' note was incorrect (it conflated the booking variant with the useInterrupt-driven flow). - Added not_supported_features: [gen-ui-interrupt, interrupt-headless] to the manifest. Both depend on LangGraph interrupt() resumable round-trips that AG2 ConversableAgent cannot reproduce. - PARITY_NOTES updated to reflect the corrected classification.
8.0 KiB
AG2 Parity Notes
Status of AG2 showcase demos relative to the langgraph-python canonical set.
Ported
Batch 1 — Frontend variants over the shared ConversableAgent
These demos reuse the existing src/agents/agent.py (one ConversableAgent
wrapped with AGUIStream). The runtime route registers each agent name,
all pointing to the same HTTP backend.
prebuilt-sidebar—<CopilotSidebar />docked layoutprebuilt-popup—<CopilotPopup />floating launcherchat-slots— slot-overridden<CopilotChat />(welcomeScreen, disclaimer, assistantMessage)chat-customization-css— scoped CSS theming of built-in classesheadless-simple— bespoke chat built onuseAgent/useComponentreadonly-state-agent-context—useAgentContextread-only contextreasoning-default-render— built-inCopilotChatReasoningMessage(no custom slot)tool-rendering-default-catchall—useDefaultRenderTool()(built-in card)tool-rendering-custom-catchall— single branded wildcard rendererfrontend-tools—useFrontendToolwith sync handler (change_background)frontend-tools-async—useFrontendToolwith async handler (notes-card)hitl-in-app— asyncuseFrontendTool+ app-level modal (approval-dialog)
Previously ported (kept)
agentic-chat,hitl-in-chat,tool-rendering,gen-ui-tool-based,gen-ui-agent,shared-state-streaming
Batch 3 — Headless complete + manifest-only entries
cli-start— informational manifest entry (copy-paste starter command).gen-ui-tool-based— already shipped; manifest entry added.headless-complete— TRULY headless chat re-composed from low-level hooks (useRenderToolCall,useRenderActivityMessage,useRenderCustomMessages). Backend: dedicated AG2ConversableAgent(agents/headless_complete.py) mounted at/headless-complete/withget_weather+get_stock_pricetools;highlight_noteis registered on the frontend viauseComponent.
Batch 4 — A2UI / OGUI / MCP + reasoning ports (this batch)
Each demo gets its own AG2 sub-app mounted at a named path, plus
(where required) its own dedicated /api/copilotkit-* runtime route so
the runtime middleware config doesn't leak into other cells.
declarative-gen-ui— A2UI Dynamic Schema. Backend (src/agents/a2ui_dynamic.py) owns thegenerate_a2uitool, which invokes a secondary OpenAI client bound torender_a2uiand returns ana2ui_operationscontainer. Runtime route atapi/copilotkit-declarative-gen-ui/route.tswitha2ui.injectA2UITool: false.a2ui-fixed-schema— A2UI Fixed Schema. Backend (src/agents/a2ui_fixed.py) shipsflight_schema.jsonand exposes adisplay_flight(origin, destination, airline, price)tool that emitsa2ui_operationsdirectly. Runtime route atapi/copilotkit-a2ui-fixed-schema/route.tswitha2ui.injectA2UITool: false.mcp-apps— Backend (src/agents/mcp_apps_agent.py) is a no-tools ConversableAgent; the runtime route atapi/copilotkit-mcp-apps/route.tsconfiguresmcpApps.serverspointing at the public Excalidraw MCP server, and the runtime middleware injects MCP tools at request time.open-gen-ui,open-gen-ui-advanced— Backends are no-tools ConversableAgents (src/agents/open_gen_ui_agent.pyandsrc/agents/open_gen_ui_advanced_agent.py). Shared runtime route atapi/copilotkit-ogui/route.tsenablesopenGenerativeUI: { agents: [...] }so the runtime middleware converts streamedgenerateSandboxedUitool calls intoopen-generative-uiactivity events.agentic-chat-reasoning,tool-rendering-reasoning-chain— Frontend ports of the LangGraph reasoning cells. The customreasoningMessageslot is wired exactly as in the canonical reference. Backend caveat: AG2'sConversableAgentdoes not natively emit AG-UIREASONING_MESSAGE_*events the way LangGraph'sdeepagentsdoes, so the reasoning slot may render empty on every turn until a future AG2 release adds reasoning emission. The tool chain (tool-rendering-reasoning-chainbackend atsrc/agents/tool_rendering_reasoning_chain.py, mounted at/tool-rendering-reasoning-chain/) still exercises end-to-end.
Batch 2 — Dedicated AG2 sub-apps
These demos own their own ConversableAgent(s) plus FastAPI sub-app
mounted at a named path (agent_server.py mounts each one before the
catch-all /). The Next.js runtime points an HttpAgent at the
matching path so each demo gets its own ContextVariables-backed state
slot, isolated from the shared default agent.
shared-state-read-write— bidirectional shared state via AG2ContextVariables+ReplyResult. Agent callsget_current_preferencesto read UI-written prefs andset_notesto write back.subagents— supervisorConversableAgentthat delegates to three sub-ConversableAgents (research/writing/critique) exposed as tools; each delegation appends todelegationsin shared state for the live log UI.
Deferred (require per-demo agent specialization)
AG2's AG-UI integration mounts a single AGUIStream over one
ConversableAgent at the FastAPI root. Achieving per-demo specialized
behavior (tailored system prompts, dedicated tool sets, backend-owned
A2UI tools, MCP integration, vision input, structured-output BYOC, etc.)
requires adding additional Python agent modules AND either (a) mounting
each as its own ASGI app at a distinct path and pointing a dedicated
HttpAgent({ url }) at it from a per-demo Next.js runtime route, or
(b) adopting AG2's GroupChat to host multiple specialized agents
behind a single stream with router logic. Both approaches are feasible
but represent a distinct engineering investment and are not a pure port
of the langgraph-python cell.
The following demos fall into that bucket and are deferred, not strictly "missing primitive" skips:
agent-config— needs the agent to re-materialize system prompt from forwardedProps on every turn (AG2 ConversableAgent supports this but a dedicated runtime wiring is required).auth— pure runtimeonRequesthook demo; dedicated/api/copilotkit-authroute; agent stays unchanged. Straightforward but requires a new route.byoc-hashbrown,byoc-json-render— streaming structured-output BYOC with Zod-validated catalogs; each has its own runtime route, catalog, renderer, and supporting components.multimodal— vision-capable AG2 agent + dedicated/api/copilotkit-multimodal.voice— frontend voice STT; needs dedicated/api/copilotkit-voiceand the lazy-init agent shape from langgraph-python.
Shipped — wave 2 follow-up
beautiful-chat— simplified port: combines A2UI Dynamic + Open Generative UI on a dedicated runtime (/api/copilotkit-beautiful-chat). MCP Apps is intentionally out-of-scope (covered separately by/demos/mcp-apps); the canonical reference's app-mode toggle / todos canvas is also not ported. Frontend reuses the catalog from/demos/declarative-gen-uito avoid duplication.hitl-in-chat-booking— manifest alias to the existinghitl-in-chatcell. The langgraph reference itself aliases the booking variant to the same/demos/hitl-in-chatroute; AG2'suseHumanInTheLoopsurface (TimePickerCard) is functionally equivalent for the booking flow. NOT a missing-primitive case — the earlier "skipped" entry was incorrect (it conflatedhitl-in-chat-bookingwith theuseInterrupt-driven flow, which it isn't).
Skipped (missing primitive)
gen-ui-interrupt— requires a LangGraph-styleinterrupt()that round-trips a resumable graph pause through the event stream. AG2'shuman_input_modeis a synchronous request/reply; it does not resume the same run from a persisted checkpoint. Marked asnot_supported_featuresinmanifest.yaml; the route renders a stub page pointing athitl-in-chat/hitl-in-app.interrupt-headless— same underlying primitive asgen-ui-interrupt. Markednot_supported_features; stub page points athitl-in-app/frontend-tools-async.