Stop me if you’ve heard this one: You build an AI Agent. You give it a complex task. It works perfectly for the first 3 steps. Then, somewhere around Step 4, it forgets the plan, hallucinates a database column, and confidently announces it has finished the job (it hasn’t).
We are all stuck in the "Goldfish Memory" era of AI. Chatbots are great at single-turn Q&A. They are terrible at 30-minute, 50-step workflows.
But Hightouch (the Data Activation unicorn) recently cracked this code with an internal architecture they call "The Harness."
This isn’t just "Prompt Engineering." This is "Context Engineering." Here is the breakdown of how they built a production-grade Agent that actually finishes what it starts—and how you can steal their architecture.
…
Stop me if you’ve heard this one: You build an AI Agent. You give it a complex task. It works perfectly for the first 3 steps. Then, somewhere around Step 4, it forgets the plan, hallucinates a database column, and confidently announces it has finished the job (it hasn’t).
We are all stuck in the "Goldfish Memory" era of AI. Chatbots are great at single-turn Q&A. They are terrible at 30-minute, 50-step workflows.
But Hightouch (the Data Activation unicorn) recently cracked this code with an internal architecture they call "The Harness."
This isn’t just "Prompt Engineering." This is "Context Engineering." Here is the breakdown of how they built a production-grade Agent that actually finishes what it starts—and how you can steal their architecture.
🏗️ The Problem: "Chat" is the Wrong UI for Agents
Most developers build agents by stitching together a history array of messages.
User: "Analyze my churn." Assistant: "Ok, querying SQL..." Assistant: "Here is the SQL."
The problem? As the conversation grows, the "Signal-to-Noise" ratio tanks.
- Context Window Bloat: You fill up 128k tokens with useless intermediate SQL errors.
- Loss of Objective: The model forgets why it ran that query 10 turns ago.
The Solution: You need a "Harness"—a runtime environment that separates Planning from Execution.
đź”§ The 3 Pillars of the "Harness" Architecture
According to the engineering deep dive from Amplify Partners, Hightouch moved beyond the simple DAG (Directed Acyclic Graph) and built a dynamic state machine.
1. The "Plan-Execute-Update" Loop 🔄
Instead of just "doing" the task, the agent is forced to write a plan first. And crucially, it can update that plan mid-flight.
The Workflow:
- User: "Why did sales drop last week?"
- Agent (Planning Mode): Writes a 6-step plan.
- Step 1: Pull daily sales data.
- Step 2: Compare vs previous week.
... 1.
Agent (Execution Mode): Executes Step 1. 1.
Harness: "Hey Agent, you found a weird anomaly in Step 1. Do you want to update the plan?" 1.
Agent: "Yes. Adding new Step 1.5: Investigate the anomaly."
Why this works: It allows the agent to "change its mind" without losing the overall objective. The Plan acts as a "North Star" that is regurgitated in the system prompt at every turn.
2. The "Scratchpad" File System đź“‚
This is the smartest hack in the entire architecture. When an agent runs a massive SQL query returning 10,000 rows, DO NOT put that in the context window.
Hightouch gave their agents a virtual File System.
- Agent: "I’ll save these results to
churn_users_q2.csv." - Harness: Saves the file. Puts a pointer in the chat context:
[File stored: churn_users_q2.csv - 10k rows].
Later, if the agent needs to analyze that data, it calls a tool read_file('churn_users_q2.csv').
This keeps the context window pristine and "lightweight," effectively giving the LLM Long-Term Memory.
3. Dynamic Sub-Agents (The "Fan-Out") ⚡
Sometimes, a task is too big for one context window. Hightouch uses Recursion.
If the Main Agent sees a complex task (e.g., "Analyze the color palette of these 500 ad creatives"), it doesn’t do it itself. It spawns a Sub-Agent.
- Main Agent: "Spawning Sub-Agent A to handle image analysis."
- Sub-Agent A: Runs in a fresh context window. Does the messy work. Returns only the final summary.
- Main Agent: Receives summary. Continues.
The result: The Main Agent’s memory never gets polluted with the messy "thinking" process of the sub-tasks.
📉 Why "Embeddings" Are Overrated
Here is a hot take from the article: Hightouch stopped using Vector DBs for some tasks.
Instead of embedding 1,000 images and doing similarity search (which is often fuzzy and inaccurate), they use a Brute Force LLM Fan-Out. They spin up 1,000 parallel calls to a cheap, fast model (like Claude 3 Haiku or Gemini Flash).
- Prompt: "Look at this ONE image. Is it dark or bright? Reply JSON."
- Cost: Negligible.
- Accuracy: Way higher than vector math.
Sometimes, throwing 1,000 tiny models at a problem is better than one big RAG pipeline.
🚀 The Verdict: Build a Runtime, Not a Chatbot
If you are building an Agent today, stop focusing on "System Prompts" and start focusing on Architecture.
- Give your Agent a File System.
- Force it to Plan.
- Let it Spawn Threads.
The difference between a demo and a product isn’t the model. It’s the Harness.
Are you building stateful agents? Let me know your architecture in the comments! 👇