TL;DR
DeepAgent for funnels is a pair of self-planning agents, built on LangChain DeepAgents, that take a direct response funnel from one request to a QA-verified live deploy. I built it solo, on my own initiative, on top of Unify CMS. Approval is enforced on the server in two layers, so an agent can propose anything but change nothing without a human yes.
The Problem
Launching a funnel meant stitching together a builder, a CRM, SSL, email, captcha, BIN routing and ad pixels, then re-typing the same products, prices and shipping rules across every tool. The platform removed the need for a developer. It still left hours of manual research, design and setup per funnel.
The question I set out to answer: can an agent do that setup the way an experienced operator would, and what has to be true before it is allowed to touch a live funnel that runs on a $6M/day checkout?
How it works
It is two self-planning agents, built on LangChain DeepAgents, that operate the platform the way an experienced operator would.
The agent console: a self-written live plan, parallel research and design subagents, approval gate cards with exact tool arguments, and token-level streaming.
Clone agent — the end-to-end chain. Give it a request ("I want a funnel for unisex t-shirts, USA, 18–35") and it runs the full lifecycle a human team used to do manually:
- Research agent — market research with cited sources: what funnel type is working in this niche (one-page, two-page, e-commerce), how many upsells and downsells the offer should carry, which templates fit.
- Design agent — runs in parallel: best-fit palette, typography, and hero copy for the niche.
- Approval gate — everything is gated. The merged research + design + build plan waits for the user, who can approve, edit, or answer with their own direction. Nothing mutates without it.
- Supervising coding agent — once approved, an orchestrated coding lead dispatches N parallel sub-agents, each owning a different file so there's no conflict.
- QA agent — checks the deployed funnel end to end before the run is called done.
What used to take days of manual research, design, and coding is now one request to a QA-verified live funnel.
Edit agent — opens a funnel by id, shows current state, presents a before → after diff for requested changes, and offers flowboard-version rollback if a deploy goes wrong.
Decisions at a glance
| Product decision | Reasoning |
|---|---|
| Agent vs deterministic pipeline | Both exist. The deterministic LangGraph onboarding pipeline handles the known path; DeepAgents handle the open-ended one. Separate workspaces so neither can break the other. |
| Acceptable failure mode | An agent proposing a bad funnel is fine; an agent mutating anything unapproved is not. Approval is server-enforced in two layers — LangGraph interrupts on every mutating tool, plus a deterministic gate that refuses execution without an explicit approval in the current turn. The prompt is defence-in-depth, not the barrier. |
| Why parallel subagents | Research and design are independent; running them concurrently roughly halves time-to-plan and keeps each context small. |
| How it's evaluated | Offline evals plus online scoring: every 👍/👎 in the UI is recorded into the eval set, Langfuse traces every run, and an opt-in loop mode does graded auto-retry with critique and human-approved prompt self-tuning. |
| Memory | Three-layer durable memory with time-travel rewind — threads survive restarts through durable checkpoints; conversations over 60k tokens are summarized, keeping the last 20 messages verbatim. |
| Key handling | BYOK — the user's OpenAI/Anthropic key lives in the browser tab's sessionStorage only, never on the server. |
Agent stack
- Agent framework: LangChain DeepAgents — two self-planning agents (Clone, Edit) with parallel subagent dispatch
- Orchestration & gating: LangGraph — deterministic onboarding pipeline for the known path; interrupts on every mutating tool plus a deterministic approval gate for the open-ended one
- Observability & evals: Langfuse traces every run; 👍/👎 from the UI feeds the eval set; opt-in graded auto-retry with critique
- Memory: three-layer durable memory — durable checkpoints for thread survival, summarization past 60k tokens with the last 20 messages verbatim, time-travel rewind
- Models & keys: BYOK — user's OpenAI/Anthropic key stays in the browser tab's sessionStorage, never on the server
- Console: live self-written plan, approval gate cards with exact tool arguments, token-level streaming
See it yourself: the full interactive showcase covers architecture, the clone flow, evals, security, and a recorded end-to-end session — clone → research ∥ design → approval gates → deploy → live verification.
What broke building this, and what I changed
- Context was eating the token budget. My first DeepAgent pulled so much context into every run that token use ballooned. I optimized what it grabs, so each run loads what the task needs and nothing more.
- Test runs kept starting from zero. In internal test mode, before production, every run started again from the beginning, paying the same tokens, time, and cost for work it had already done. So I built memory recall: when the same kind of situation comes up, the agent recalls it from memory instead of redoing it. That cut a lot of token cost and run time.
Agents that deploy live funnels on a $6M/day checkout can't be trusted on good behaviour, so these failure modes were designed out before production:
- A prompt is not a barrier. An agent told to wait for approval can still call a mutating tool. So approval is server-enforced in two layers: LangGraph interrupts on every mutating tool, plus a deterministic gate that refuses execution without an explicit approval in the current turn. The prompt is defence in depth.
- A deploy goes wrong. The edit agent shows a before → after diff for every change and offers flowboard-version rollback if a deploy misbehaves.
- "Done" that isn't done. A run isn't finished when the coding agents stop. The QA agent checks the deployed funnel end to end first.
- Customer keys leaking. BYOK: the user's model key lives only in the browser tab's session storage, never on the server.
- Long runs losing the plot. Threads survive restarts through durable checkpoints, and conversations past 60k tokens are summarized with the last 20 messages kept verbatim.