Research Agents That Stay on Task
Outcome: a research column whose answers stay on the question you asked, with entity, scope and format all pinned, and drift monitored per run.
- Surface
- App and MCP server
- Level
- Intermediate
- Uses
- AI research agent
- Credits
- ~15 across test iterations
- Prerequisite
- Lesson 03; [Research course](/courses/research) lessons 05–07 help
The three drifts
An agent goes off task in exactly three ways. Each has its own fix.
| Drift | Looks like | Fix |
|---|---|---|
| Entity drift | Answers about a different company with a similar name | Pass the domain, always |
| Scope drift | Answers from a source you did not intend — a news article, a review site, its own memory | Name the source explicitly |
| Format drift | A paragraph where you asked for one of five values | State allowed values; forbid explanation |
Nothing else goes wrong often enough to design around.
Pin the entity
Every research prompt gets an identity block. Not optional.
Company: {{company_name}}
Website: {{domain}}
Location: {{country}}
All answers must be about this company only. If the source you find does
not clearly belong to this company, answer Unknown.That last sentence is what turns entity drift from a silent error into a visible Unknown. Without it, the agent finds a company and answers about it.
Entity drift is the drift that produces the worst outcomes, because the answer is completely wrong rather than partly wrong — and it is invisible unless you check sources. It is also the easiest to prevent. Never run a research column without the domain in the prompt.
Scope the sources
Say where to look, and by implication where not to.
| Question | Scope instruction |
|---|---|
| What do they sell? | ”Using their website homepage and product pages only” |
| Who do they sell to? | ”Using their customers or case studies page” |
| What are they building? | ”Using their careers page and their changelog or blog” |
| Recent news | ”Using sources published in the last 90 days” |
Unscoped, an agent will happily answer a “what do they sell” question from a three-year-old press release or an aggregator page that garbles the description.
One question, one column
The rule from the research course, and it matters more here because these columns run at volume.
A compound question — “what do they sell and who do they sell to?” — gets answered inconsistently: sometimes both parts, sometimes one, sometimes a blend. Every downstream filter then behaves unpredictably for reasons nobody can see.
Split it. Two columns, two constrained value sets, two credit charges you can reason about.
Monitoring drift at volume
At 20 rows you read everything. At 2,000 you monitor four numbers per run:
Distinct value count
Should equal your allowed value set. A new value means format drift.
Unknown rate
Compare to the previous run. A jump means the source changed or the input degraded.
Empty rate
Blank output is a failure, not an answer. It should be near zero.
Sampled accuracy
20 random rows checked by hand, every fifth run and after any prompt change.
All four are formula columns except the last, so they cost nothing and compute automatically.
Do this now
Add the identity block
Company, domain, country, and the “this company only” instruction.
Add the scope instruction
Name the pages or the time window.
Split any compound question
One question per column.
Run 20 rows and check sources
Confirm the agent read the right company on every one.
Build the four monitoring columns
Distinct values, unknown rate, empty rate, plus a flag column for your manual sample.
Widen
Then read the four numbers immediately after the run, not a week later.
Check your work
- Every research prompt contains the domain
- Sources are scoped, not left open
- No column asks two questions
- The four monitoring numbers compute automatically
- You verified entity correctness on 20 rows by hand
Where this breaks
Common company names are where entity drift concentrates, and they are exactly the accounts you are least likely to check. “Apex”, “Nova”, “Vertex” and every two-syllable tech name has a dozen namesakes, and an agent given a name and no domain will pick one — plausibly, silently, and often wrongly. If your list contains generic names, sample those rows specifically rather than sampling at random.
Further automation
Cache research at company level and join it to your person table. Company-level research re-run per contact is the most common waste in AI-heavy workflows — three contacts per account means paying three times for one answer, and the outputs are identical, so nothing looks wrong.
Next lesson
09 — Reading unstructured sources, extracting facts from prose, filings and posts.
Reference for this lesson: AI agents, Research, Research & Web Scraping, MCP prompting guide.