Skip to content

feat(showcase/pydantic-ai): bring to feature parity with langgraph-python - #4267

Closed
AlemTuzlak wants to merge 22 commits into
mainfrom
feat/showcase-pydantic-ai-parity
Closed

AlemTuzlak wants to merge 22 commits into
mainfrom
feat/showcase-pydantic-ai-parity

Conversation

@AlemTuzlak

Copy link
Copy Markdown
Contributor

Summary

Brings showcase/packages/pydantic-ai/ closer to feature parity with
showcase/packages/langgraph-python/ by porting the portable,
PydanticAI-compatible slice of the langgraph-python demo catalogue: chat-UI
variants, frontend-tool demos, in-app HITL, readonly-state-agent-context,
and the default + custom catch-all tool-rendering demos. All new demos
wire into the existing single-agent PydanticAI backend via agent-name
registration in src/app/api/copilotkit/route.ts, so no new Python agent
code is required.

Lands alongside parallel PRs for claude-sdk-python and claude-sdk-typescript.

Ported demos

  • prebuilt-sidebar — Docked sidebar chat via <CopilotSidebar />.
  • prebuilt-popup — Floating popup chat via <CopilotPopup />.
  • chat-slots — Custom welcomeScreen, input.disclaimer, and
    messageView.assistantMessage slots.
  • chat-customization-css — Scoped re-theme via CopilotKitCSSProperties.
  • headless-simple — Minimal custom chat surface built on useAgent and
    useComponent (show_card tool rendered via useRenderToolCall).
  • frontend-tools — change_background via useFrontendTool.
  • frontend-tools-async — query_notes with an async handler over a local
    mock notes DB; renders via NotesCard.
  • hitl-in-app — Support-console-style approval flow. The agent invokes
    request_user_approval via useFrontendTool with an async handler that
    pops an app-level modal; the user's decision resolves the pending tool
    Promise.
  • readonly-state-agent-context — Frontend-provided read-only context
    (name, timezone, recent activity) via useAgentContext.
  • tool-rendering-default-catchall — Out-of-the-box default tool-call
    rendering via useDefaultRenderTool().
  • tool-rendering-custom-catchall — Single branded wildcard renderer via
    useDefaultRenderTool({ render }).
  • cli-start — Manifest-only demo entry (copy-paste init command).

Skipped demos

Documented in showcase/packages/pydantic-ai/PARITY_NOTES.md:

  • beautiful-chat — Large flagship demo with A2UI catalogs, multi-schema
    tools, and StateStreamingMiddleware; out of scope for this initial pass.
  • headless-complete — Depends on MCP Apps routing.
  • mcp-apps — Requires MCP Apps middleware; no documented path through
    PydanticAI's agent.to_ag_ui() yet.
  • agentic-chat-reasoning, reasoning-default-render,
    tool-rendering-reasoning-chain — Depend on deepagents reasoning
    token emission; PydanticAI does not stream reasoning through AG-UI yet.
  • gen-ui-interrupt, interrupt-headless — Built on LangGraph's
    interrupt() primitive; PydanticAI has no equivalent.
  • declarative-gen-ui, a2ui-fixed-schema, open-gen-ui,
    open-gen-ui-advanced — Need dedicated per-demo A2UI / OGUI agent
    wiring; the shared generate_a2ui tool on the base agent exercises the
    path partially but faithful per-demo schemas were out of scope.

See PARITY_NOTES.md for details and follow-up candidates.

Test plan

  • npx tsc --noEmit — all newly-added pages / components / tests
    typecheck clean (4 pre-existing errors in shared-state and subagents
    pages are unrelated to this PR).
  • Each new Python agent module imports cleanly — N/A for this PR;
    no new Python modules were added. All new demos reuse the existing
    src/agents/agent.py.
  • Playwright specs (minimal smoke) added for each new route.
  • QA stubs added under qa/ for each new demo.

@vercel

vercel Bot commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-with-your-data Ready Ready Preview, Comment Apr 24, 2026 6:10pm
docs Ready Ready Preview, Comment Apr 24, 2026 6:10pm
form-filling Ready Ready Preview, Comment Apr 24, 2026 6:10pm
research-canvas Ready Ready Preview, Comment Apr 24, 2026 6:10pm
travel Ready Ready Preview, Comment Apr 24, 2026 6:10pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@AlemTuzlak

Copy link
Copy Markdown
Contributor Author

Follow-up pass: closed-gap demos

Appended 6 commits to this branch (head 33f6e2b8c) that port the 6 demos the initial pass left on the skipped list:

Demo Commit
open-gen-ui + open-gen-ui-advanced 7a6d80f6d
declarative-gen-ui (A2UI dynamic) df0922051
a2ui-fixed-schema d3311233f
headless-complete 72d1f9b2e
beautiful-chat 2964dd4a1
PARITY_NOTES.md delta 33f6e2b8c

Backend architecture change

src/agent_server.py now mounts demo-specific PydanticAI agents at dedicated sub-paths (/open_gen_ui, /open_gen_ui_advanced, /a2ui_dynamic, /a2ui_fixed, /headless_complete, /beautiful_chat). The existing sales agent stays at root, so every demo from the initial pass keeps working unchanged. The corresponding TS routes (new copilotkit-ogui, copilotkit-declarative-gen-ui, copilotkit-a2ui-fixed-schema, copilotkit-beautiful-chat, plus headless-complete grafted into the main copilotkit route) proxy to the matching sub-path.

Dependency additions

  • @ag-ui/core (made explicit — previously transitive via @ag-ui/client; needed by headless-complete's message dispatch).
  • @radix-ui/react-checkbox, @radix-ui/react-separator, class-variance-authority, clsx, lucide-react, tailwind-merge (required by beautiful-chat's copied UI primitives and shared-todos canvas).

Remaining PARITY_NOTES skips (genuinely framework-limited)

  • mcp-apps — no MCP client path through the PydanticAI SDK yet. beautiful-chat and headless-complete are shipped without their Excalidraw suggestion pills.
  • gen-ui-interrupt, interrupt-headless — no interrupt() primitive in PydanticAI.
  • agentic-chat-reasoning, reasoning-default-render, tool-rendering-reasoning-chain — no THINKING_* event bridge yet.

Partial-parity notes

  • headless-complete omits the reasoning-message branch because @ag-ui/[email protected] (the version pinned in this package) does not export ReasoningMessage and PydanticAI's AG-UI adapter does not emit reasoning content today. Documented inline with a restore path.
  • beautiful-chat uses StateSnapshotEvent instead of per-token StateStreamingMiddleware deltas — the shared todo state still syncs, just without character-by-character streaming animation.

Verification

  • npx tsc --noEmit produces only the 4 pre-existing labels.title errors on shared-state-* + subagents — no new errors from this pass.
  • Python imports verified against the same import surface used by the existing src/agents/agent.py (no new runtime dependencies beyond the existing pydantic_ai/openai/ag_ui.core set).

AlemTuzlak and others added 7 commits April 24, 2026 19:20
Ports prebuilt-sidebar, prebuilt-popup, chat-slots, chat-customization-css,
headless-simple from langgraph-python. All wire to the existing single-agent
backend via agent-name registration in the copilotkit route.
Wires the newly-ported demos into manifest.yaml (features + demos lists with
matching highlight paths) and adds PARITY_NOTES.md explaining which demos were
skipped from the langgraph-python baseline (beautiful-chat, headless-complete,
mcp-apps, reasoning variants, interrupt-based demos, A2UI demos, open-gen-ui
variants) and why.
@AlemTuzlak

Copy link
Copy Markdown
Contributor Author

BLITZ B1'' update — 6 post-#4271 demos ported

Fresh commits on top of this branch add the six new demos introduced in reference by PR #4271 (langgraph-python), adapted to PydanticAI:

  • byoc-json-render — PydanticAI agent emits {root, elements} JSON matching @json-render/react's flat spec. Kept the post-fix(showcase/langgraph-python): repair six demo runtime regressions (byoc-json-render, hashbrown, multimodal, voice, agent-config, auth) #4271 frontend fixes: <JSONUIProvider> wrapping <Renderer />, and MetricCard registry wrapper forwarding children. Dedicated route at /api/copilotkit-byoc-json-render proxying to /byoc_json_render/ on the Python server.
  • byoc-hashbrown — PydanticAI agent emits the post-fix(showcase/langgraph-python): repair six demo runtime regressions (byoc-json-render, hashbrown, multimodal, voice, agent-config, auth) #4271 JSON envelope {"ui":[{componentName:{"props":{...}}}]} verbatim (no XML). Dedicated route and backend mount.
  • multimodal — Vision-capable OpenAIResponsesModel("gpt-4o") agent. Images flow native via AG-UI binary → image_url rewrite; PDFs flatten to text via pypdf inside a PydanticAI history_processors hook (equivalent to langgraph-python's _PdfFlattenMiddleware). The frontend's onRunInitialized shim + LFS-pointer guard are kept intact. pypdf added to requirements.txt.
  • voice — Shared sales agent at root as the neutral backing agent. GuardedOpenAITranscriptionService + direct-instance transcription wiring lifted verbatim from langgraph-python — missing OPENAI_API_KEY maps to a typed 401 instead of an opaque 5xx. @copilotkit/voice + openai added to package.json.
  • agent-config — PydanticAI-specific adaptation: the TS route subclasses HttpAgent and repacks provider properties into an AG-UI context entry tagged agent-config-properties. The Python agent's dynamic @agent.system_prompt reads that entry and composes the prompt from tone/expertise/responseLength. Functionally equivalent to langgraph-python's forwardedProps.config.configurable.properties path; documented in PARITY_NOTES.md.
  • auth — Built on framework-agnostic createCopilotRuntimeHandler from @copilotkit/runtime/v2 with onRequest hook. Post-fix(showcase/langgraph-python): repair six demo runtime regressions (byoc-json-render, hashbrown, multimodal, voice, agent-config, auth) #4271 fixes preserved: default useDemoAuth = true, ChatErrorBoundary wrapping <CopilotChat />, inverted sign-in/sign-out button labels.

Verification

  • npx tsc --noEmit — no new errors vs baseline beyond the 4 pre-existing labels.title errors on shared-state-*/subagents. The only additional errors are 4 registry.tsx implicit-any warnings that are identical to the langgraph-python reference (module-resolution artifact on @json-render/react types — not a regression).
  • Python python -c "import ..." was not run here (no local venv with deps installed); each new agent module is mounted in src/agent_server.py at a dedicated sub-path and follows the same pattern as the existing demo agents.

Files touched (pydantic-ai only)

  • src/agents/{byoc_json_render_agent,byoc_hashbrown_agent,multimodal_agent,agent_config_agent}.py
  • src/app/demos/{byoc-json-render,byoc-hashbrown,multimodal,voice,agent-config,auth}/ (full trees)
  • src/app/api/copilotkit-{byoc-json-render,byoc-hashbrown,multimodal,voice,agent-config,auth}/route.ts
  • src/agent_server.py (new mounts), manifest.yaml, PARITY_NOTES.md, package.json, requirements.txt
  • qa/*.md, tests/e2e/*.spec.ts for each demo
  • public/demo-audio/sample.wav, public/demo-files/sample.{png,pdf} (binaries copied over preserving content)

Seven commits on the branch, feat/showcase-pydantic-ai-parity is rebased onto the post-style-fix head. PR #4267 updates automatically.

@jpr5

jpr5 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Superseded by #4280 (omnibus parity PR)

@jpr5 jpr5 closed this Apr 25, 2026
jpr5 added a commit that referenced this pull request Apr 25, 2026
…demos (#4280)

## Summary

Consolidates 13 showcase parity PRs into a single omnibus PR. Each
integration framework has been brought to near-parity with the LangGraph
Python reference (~37 demos each).

### Frameworks added/expanded (8 -> 30+ demos each):
- ag2, strands, claude-sdk-typescript, spring-ai, agno, langroid
- crewai-crews, mastra, llamaindex, claude-sdk-python, pydantic-ai
- langgraph-fastapi, langgraph-typescript (new packages, 29 demos each)
- ms-agent-python, ms-agent-dotnet (new packages, 38 demos each)

### Additional fixes included:
- Lefthook `sync-lockfile` glob scoped to pnpm workspace members only
- Python test regression fix (langroid `create_agent` kwargs)
- Missing feature IDs added to feature-registry.json
(hitl-in-chat-booking, hitl)
- Manifest highlight path fixes (langgraph-fastapi, langgraph-python,
langgraph-typescript, ms-agent-dotnet)
- Fixture tool surface validator updated for wildcard renderers
(useDefaultRenderTool)
- Constraints allowlist updated for new feature IDs
- Starters regenerated for all 17 frameworks
- fail-baseline.json ratcheted (112 -> 127) for new framework pin FAILs

### Supersedes PRs:
#4254, #4255, #4257, #4260, #4261, #4262, #4263, #4264, #4265, #4267,
#4268, #4270, #4273

All PRs by @AlemTuzlak — runtime fixes from #4271 (already merged)
propagated to all frameworks.

## Test plan
- [ ] CI green on this PR
- [ ] `pnpm dev` spot-check on 2-3 frameworks (byoc-hashbrown, voice,
auth demos)
- [ ] Dashboard cells tab shows new framework rows populated
- [ ] Feature registry validation passes
- [ ] Starters generate cleanly (`npx tsx
showcase/scripts/generate-starters.ts`)
- [ ] Registry generates cleanly (`npx tsx
showcase/scripts/generate-registry.ts`)
- [ ] Demo content bundles cleanly (`npx tsx
showcase/scripts/bundle-demo-content.ts`)
@jpr5
jpr5 deleted the feat/showcase-pydantic-ai-parity branch June 1, 2026 18:49
zeekay pushed a commit to Dream-AI-4444/CopilotKit that referenced this pull request Sep 11, 2026
…demos (CopilotKit#4280)

## Summary

Consolidates 13 showcase parity PRs into a single omnibus PR. Each
integration framework has been brought to near-parity with the LangGraph
Python reference (~37 demos each).

### Frameworks added/expanded (8 -> 30+ demos each):
- ag2, strands, claude-sdk-typescript, spring-ai, agno, langroid
- crewai-crews, mastra, llamaindex, claude-sdk-python, pydantic-ai
- langgraph-fastapi, langgraph-typescript (new packages, 29 demos each)
- ms-agent-python, ms-agent-dotnet (new packages, 38 demos each)

### Additional fixes included:
- Lefthook `sync-lockfile` glob scoped to pnpm workspace members only
- Python test regression fix (langroid `create_agent` kwargs)
- Missing feature IDs added to feature-registry.json
(hitl-in-chat-booking, hitl)
- Manifest highlight path fixes (langgraph-fastapi, langgraph-python,
langgraph-typescript, ms-agent-dotnet)
- Fixture tool surface validator updated for wildcard renderers
(useDefaultRenderTool)
- Constraints allowlist updated for new feature IDs
- Starters regenerated for all 17 frameworks
- fail-baseline.json ratcheted (112 -> 127) for new framework pin FAILs

### Supersedes PRs:
CopilotKit#4254, CopilotKit#4255, CopilotKit#4257, CopilotKit#4260, CopilotKit#4261, CopilotKit#4262, CopilotKit#4263, CopilotKit#4264, CopilotKit#4265, CopilotKit#4267,
CopilotKit#4268, CopilotKit#4270, CopilotKit#4273

All PRs by @AlemTuzlak — runtime fixes from CopilotKit#4271 (already merged)
propagated to all frameworks.

## Test plan
- [ ] CI green on this PR
- [ ] `pnpm dev` spot-check on 2-3 frameworks (byoc-hashbrown, voice,
auth demos)
- [ ] Dashboard cells tab shows new framework rows populated
- [ ] Feature registry validation passes
- [ ] Starters generate cleanly (`npx tsx
showcase/scripts/generate-starters.ts`)
- [ ] Registry generates cleanly (`npx tsx
showcase/scripts/generate-registry.ts`)
- [ ] Demo content bundles cleanly (`npx tsx
showcase/scripts/bundle-demo-content.ts`)

This branch was successfully deployed

5 active deployments
Preview – travel — 0e6b6a18 Deployed Apr 24, 2026 by vercel[bot]
Preview – docs — 0e6b6a18 Deployed Apr 24, 2026 by vercel[bot]
Preview – research-canvas — 0e6b6a18 Deployed Apr 24, 2026 by vercel[bot]
Preview – chat-with-your-data — 0e6b6a18 Deployed Apr 24, 2026 by vercel[bot]
Preview – form-filling — 0e6b6a18 Deployed Apr 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants