# How Harmonic 4x'd User Retention by Building on Deep Agents
<!--
ref: @content/youtube/langchain/2026-08-07-how-harmonic-4xd-user-retention-by-building-on-deep-agents
version: 3
updated_at: 2026-10-31T18:32:09.833Z
-->

From LangChain, 2026-08-07: Harmonic replaced a heavily tuned, multi-node LangGraph query parser with a simple loop: a frontier model plus about 50 tools, running on the LangChain deep agents harness. Week-1-to-week-4 retention went up 4x.

**[Watch on YouTube](https://www.youtube.com/watch?v=pGdZBK___jM)**


*Synthesized from a Harmonic engineer on LangChain, 2026-08-07.*

The speaker is an engineer on Harmonic's Scout agent. The transcript never gives their name, so this summary calls them "the Harmonic speaker." They refer to an earlier presenter, "Robert," who had already covered deep agents middleware.

## Core Thesis
Harmonic replaced a heavily tuned, multi-node LangGraph query parser with a simple loop: a frontier model plus about 50 tools, running on the LangChain deep agents harness. Week-1-to-week-4 retention went up 4x. The speaker's main lesson for product teams is that an agent is a model plus a harness, and a product is that agent plus a UX. The model only knows what is in its messages list or what the harness lets it find through tools. Any UI element the model can't progressively reach is invisible to it, so the UX has to follow the harness's rules for sharing context.

## Key Insights
- **Harmonic's scale:** It is a real-time database of the startup ecosystem covering 37 million companies, 200 million people and 220,000 investors, and it grows weekly. The speaker says 9 of the top 10 current VCs use it for sourcing.
- **What Scout is:** A natural-language layer over that data, running on deep agents. It answers simple lookups ("who is the CEO of LangChain") and long composite tasks, such as mapping an industry, drawing a market-map visualization and scoring a team 1–10 against a rubric. Answers show up in a chat plus custom interactive UI, where users can click companies, add them to lists and open sidebars.
- **Results:** Retention from week 1 to week 4 rose 4x after the move to deep agents. Qualitatively, users called Scout their "secret weapon," and one said it was "like my heaven."
- **Scout 1.0 (the "spaghetti graph"):** Built about a year and a half earlier, it took a query like "fintech SaaS companies in New York that raised in the last two months" and split it up. The semantic part ("fintech SaaS") went to embeddings search. Location and funding filters were translated into Harmonic's custom search language. Every LangGraph node had its own model and its own evals, and keeping them passing took constant tuning and a lot of maintenance.
- **Scout 2.0 architecture:** The new design is one tool-call loop of model, tools and middleware. Middleware hooks run before and after the model call and before and after the whole agent run. Tools include entity search, web search via **Tavily**, enrich-by-ID, enrich-by-URL, and CRM actions (add to list, edit lists, move items). With a frontier model and this harness, the agent picks correctly among **~50 tools** and finishes long composite tasks.
- **Why deep agents specifically:**
  - *Context management:* A company search can return 1,000 results, each with nested team and funding data. That can mean thousands to tens of thousands of lines. Deep agents runs **compaction** when the messages list gets long, so threads can continue "pretty much infinitely."
  - *Tool-call eviction:* Very large tool outputs are written to the file system. The model gets back a pointer plus a way to read the output in chunks, so the full response never fills its context.
  - *Skills and custom middleware:* These pull prompt material in at runtime, so it isn't sent on every call.
  - *File-system abstractions:* The agent can read and write any artifact.
  - *Deployment continuity:* Harmonic was already on **LangSmith Deployment** with the old graph. They plugged the new framework into the existing graph, kept the same chat UI, and A/B tested users over gradually.
- **The central tension:** Models are trained on code, tool calling and structured JSON/XML, and the harness adds file paths and markdown files. Most Harmonic users are non-technical and don't want to see "I wrote this file to this path." The goal is to keep the model's freedom to reason and act while showing rich elements that render predictably.
- **The harness contract:** The model only ever sees a list of assistant, human and tool messages. The harness removes material from that list to avoid hitting the context window and to prevent context rot. Its obligation is that anything it removes must still be reachable through tools, for example a file pointer plus chunked-read tools. That is progressive disclosure: the model gets a lightweight one-line description first and pulls in more as needed. Anything outside both the messages list and the harness's discoverable offload is invisible to the model.
- **Visualizations (small artifacts):** Users started asking for charts and market maps, and the model began producing SVG and HTML/CSS on its own, which looked good out of the box.
  - *Wrong way:* A "render this data" tool that returns `success: true` while the front end intercepts it and draws the chart. The model is "firing into the void" and can't explain or change what the user sees.
  - *Right way:* Prompt the model to wrap HTML in a delimiter, such as an XML tag like `<html-visualization>`, inside its assistant message. The front end detects the tag and renders it live. Because the visualization is in the messages list, the model can explain it ("why is that company on the left?") and edit it ("move these three to the right, change the background color").
- **Company search (large artifacts):** A query like "fintech in New York" can return tens of thousands of results, far too many to put in the messages list.
  - *Naive (Harmonic's original approach, which caused problems):* Fire and forget. The model triggers the search, the front end renders the results, and nothing comes back to the model. It can't answer "tell me about the CEO of the second company."
  - *Better:* A `start company search` tool that returns a search ID, a status and a result count. The front end renders from that. The model gets inspection tools such as "get search status for ID" and "fetch the first 10 results of batch 2," so it can build context when asked.
  - *Best (deep agents native):* Use the **scoped file system as shared storage** for the main agent, the front end and any deterministic processes. The main agent has file tools (read, `ls`, `cd`, `grep`). A separate **search sub-agent** mounts the same file system and runs long searches, custom evaluation, ranking, sorting and annotation, writing as it goes. The front end reads the same files through an API, so up to tens of thousands of ranked, annotated results render as they arrive. The main agent knows the path and can read 10 lines at a time to answer follow-ups such as "why are these five at the top?" or "draft outreach emails for the top five."

## Actionable Takeaways
1. **Collapse brittle multi-node parsing graphs into one tool loop** of frontier model, tools and middleware. Expect a capable model to pick correctly among about 50 domain tools, such as search entities, Tavily web search, enrich by ID/URL and CRM list actions.
2. **Use a harness that manages context for you.** Rely on compaction for long threads and tool-call eviction for big outputs, meaning write to the file system and return a pointer plus chunked-read tools. Don't put 10,000-line responses into a tool message.
3. **Load prompt material at runtime** through skills and custom middleware so it isn't sent on every call.
4. **Migrate on your existing deployment.** If you already serve a LangGraph agent on LangSmith Deployment, swap in the deep agents graph behind the same chat UI and A/B test users over gradually.
5. **For small rendered artifacts (charts, market maps):** Have the model write HTML/SVG inline in its assistant message, wrapped in an agreed XML delimiter. Have the front end parse and render that tag. Don't use a render tool that only returns `success: true`.
6. **For large rendered artifacts (search results):** At minimum, return an artifact ID, status and count, plus tools to page through results (e.g., fetch first 10, fetch batch N). Ideally, have a sub-agent write results to a shared scoped file system that the front end also reads through an API, so the main agent can `ls`/`grep`/read slices on demand.
7. **Apply the visibility test to every UI element.** If something is shown to the user, it must be either in the messages list or offloaded by the harness with a discoverable tool path. Otherwise the model can't reason about it.
8. **Use the "fighting the model" sniff test.** If your prompt says things like "trust that this is being rendered; the user will see it; don't include it in your response," something is probably invisible to the model. Redesign how context flows between harness and model instead of adding more prompt instructions.

## Notable Quotes
> "We had four times the retention from week one to week four since we switched over to deep agents." — Harmonic speaker

> "I think everyone's secret weapon is becoming Scout." — Harmonic user, quoted by the Harmonic speaker

> "These agents love things that feel like code." — Harmonic speaker

> "Anything that the harness kind of pulls out of the messages list, it has to make available to the model through tools." — Harmonic speaker

> "If you find yourself kind of fighting with against the model… it's kind of a sniff test that something might be invisible to the model." — Harmonic speaker

> "The model needs to have progressive visibility into any artifacts shown to the user, or else it's invisible to the model." — Harmonic speaker

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*