|
1 | 1 | # Open Generative UI |
2 | 2 |
|
3 | | -An open-source showcase for building rich, interactive AI-generated UI with [CopilotKit](https://copilotkit.ai) and [LangGraph](https://langchain-ai.github.io/langgraph/). Ask the agent to visualize algorithms, create 3D animations, render charts, or generate interactive diagrams — all rendered as live HTML/SVG inside a sandboxed iframe. |
| 3 | +An open-source showcase for building rich, interactive AI-generated UI with [CopilotKit](https://copilotkit.ai) and [LangChain Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview). Ask the agent to visualize algorithms, create 3D animations, render charts, or generate interactive diagrams — all rendered as live HTML/SVG inside a sandboxed iframe. |
4 | 4 |
|
5 | 5 | https://github.com/user-attachments/assets/ed28c734-e54e-4412-873f-4801da544a7f |
6 | 6 |
|
@@ -104,14 +104,27 @@ Turborepo monorepo with three packages: |
104 | 104 | ``` |
105 | 105 | apps/ |
106 | 106 | ├── app/ Next.js 16 frontend (CopilotKit v2, React 19, Tailwind 4) |
107 | | -├── agent/ LangGraph Python agent (GPT-5.4, CopilotKit middleware) |
| 107 | +├── agent/ Deep Agent (deepagents + CopilotKit middleware, skills-based) |
108 | 108 | └── mcp/ Standalone MCP server (design system + skills + document assembler) |
109 | 109 | ``` |
110 | 110 |
|
| 111 | +### Deep Agent + Skills |
| 112 | + |
| 113 | +The agent backend uses [LangChain Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) (`create_deep_agent`) with a skills-based architecture. Instead of injecting all visualization instructions into the system prompt, skills are defined as `SKILL.md` files in `apps/agent/skills/` and loaded on-demand via progressive disclosure: |
| 114 | + |
| 115 | +``` |
| 116 | +apps/agent/skills/ |
| 117 | +├── advanced-visualization/SKILL.md # UI mockups, dashboards, Chart.js, generative art |
| 118 | +├── master-playbook/SKILL.md # Response philosophy, decision trees, narration patterns |
| 119 | +└── svg-diagrams/SKILL.md # SVG generation rules, component patterns, diagram types |
| 120 | +``` |
| 121 | + |
| 122 | +Deep agents also provide built-in planning (`write_todos`), filesystem tools, and sub-agent support. |
| 123 | + |
111 | 124 | ### How It Works |
112 | 125 |
|
113 | 126 | 1. **User sends a prompt** via the CopilotKit chat UI |
114 | | -2. **Agent decides** whether to respond with text, call a tool, or render a visual component |
| 127 | +2. **Deep agent decides** whether to respond with text, call a tool, or render a visual component — consulting relevant skills as needed |
115 | 128 | 3. **`widgetRenderer`** — a frontend `useComponent` hook — receives the agent's HTML and renders it in a sandboxed iframe |
116 | 129 | 4. **Skeleton loading** shows while the iframe loads, then content fades in smoothly |
117 | 130 | 5. **ResizeObserver** inside the iframe reports content height back to the parent for seamless auto-sizing |
@@ -154,7 +167,7 @@ apps/ |
154 | 167 |
|
155 | 168 | ## Tech Stack |
156 | 169 |
|
157 | | -Next.js 16, React 19, Tailwind CSS 4, LangGraph, CopilotKit v2, Turborepo, Recharts |
| 170 | +Next.js 16, React 19, Tailwind CSS 4, LangChain Deep Agents, LangGraph, CopilotKit v2, Turborepo, Recharts |
158 | 171 |
|
159 | 172 | ## License |
160 | 173 |
|
|
0 commit comments