In partnership with

Every agent tutorial builds the same 3 agents that chain together with a working demo, and everyone claps. Nobody shows you the second run, so that’s what we're building today.

The pipeline without a framework so every failure stays visible instead of getting swallowed by someone else's retry logic. Just Node, the Anthropic SDK, and an Express server you can deploy at the end.

This one’s gonna be a bit long, so no roundup or catchup today, let’s get straight into it.

What we're building

We're writing 3 small functions and wiring them together by hand.

  • A researcher searches the web and hands back raw notes. 

  • The summarizer turns those notes into structured JSON.

  • And the coordinator is the piece that runs everything in sequence, checks the output, and loops back when it comes out weak.

Then the whole thing goes behind a single API endpoint.

The stack is Node.js, @anthropic-ai/sdk, and Express, with nothing layered on top.

Skipping LangChain, CrewAI, and ADK is deliberate: raw API calls mean every failure shows up in the open instead of hidden inside a framework's retry logic.

Step 1: project setup

Create the file structure:

You should have:

.gitignore:

.env:

Get your key from console.anthropic.com if you don't have one. Never commit this file, that's what the .gitignore line is for.

Open package.json and add a scripts block:

Step 2: a logger before anything else

This is the part every tutorial skips, and it's the reason the second run breaks silently. Set up logging before you write a single agent.

logger.js:

Every agent call writes to this, and not only the final output. Every handoff between agents gets logged too. You'll want that the first time something breaks.

Add "type": "module" to package.json so the import syntax works:

Step 3: the researcher

Its only job is to search and hand back raw findings, with no structure or summarising on top.

agents/researcher.js:

web_search_20250305 is a server-side tool, so Claude runs the search itself and returns findings as text blocks mixed in with tool-use blocks.

We filter for type === "text”, join them, and that's our raw research notes.

Step 4: the summarizer

This one takes the raw notes and returns structured JSON.

agents/summarizer.js:

Notice the instruction demands 3 key points, whatever the notes contain.

Step 5: the evaluator

Checks whether the summary is grounded in the research notes, and sends it back for another pass if it isn't.

agents/evaluator.js:

This instruction reads as reasonable, and that's the problem.

Step 6: the coordinator

This wires the 3 agents together and owns the retry loop.

agents/coordinator.js:

index.js is a plain CLI entry point so you can run the whole thing locally before wrapping it in a server:

Run it:

Step 7: wrap it in an API

server.js:

Run it:

Test it:

Step 8: deploy it

You can deploy anywhere, my suggestion would be to use Railway.

My take

The wiring took 20 minutes and was never the hard part. These pipelines don't crash when they fail; they hand back an answer that's wrong and looks just as polished as a correct one.

That's why the logger came before any of the agents.

A bad summary reads fine on its own and only gives itself away next to the notes it came from, so the failure almost always sits in the handoff between 2 agents, which a final-output log never shows you.

Build the happy path fast, then go break it. Throw vague topics and concurrent requests at it until it cracks, because in production it won't warn you first.

Until next time,
Vaibhav 🤝🏻

If you read till here, you might find this interesting

#AD 1

Nobody actually knows how AI gets used.

AI tool sprawl happened fast, and visibility never caught up. Employees paste contracts into ChatGPT, run code through Copilot, and build workflows in apps security never approved.

Harmonic Security classifies every AI interaction by task, tool, and team, so you can see which use cases drive real productivity, which tools are shelfware, and where sensitive data is headed. Across approved and unapproved apps alike.

No need to guess what 'AI adoption' means inside your company.

#AD 2

Your traffic is fine. Your signups aren't.

Visitors land and leave, and "looks fine to me" isn't a diagnosis. SureThing audits SEO, speed, mobile, and messaging against the page, then ranks the fixes by impact.

Reply

Avatar

or to participate