Tutorial: how to build autonomous AI agents with Node.js and Claude
Step by step to create a pipeline of AI agents that automatically search, analyze and generate content.
AI agents are programs that perform complex tasks autonomously, dividing the work into smaller stages. In this tutorial, we will build a complete pipeline using Node.js and Claude's API.
What we're going to build
A system with three agents:
Prerequisites
1. Project setup
mkdir meu-pipeline && cd meu-pipeline
npm init -y
npm install @anthropic-ai/sdk tsx
2. Creating the Research Agent
import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic()
async function pesquisar(tema: string): Promise<string[]> {
const response = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 2048,
messages: [{
role: 'user',
content: `Liste 5 notícias recentes sobre: ${tema}. Retorne apenas os títulos, um por linha.`
}]
})
const text = response.content[0].type === 'text' ? response.content[0].text : ''
return text.split('\n').filter(Boolean)
}
3. Engaging agents
The secret is to pass one agent's output as the next's input. Each agent has a specialized system prompt that defines its role and output format.
Next steps
The full code is available in the sample repository.

Written by
Lucas MontarroiosSou Lucas Montarroios e dediquei os últimos 15 anos à linha de frente de operações de telecom e data centers. Minha carreira sempre foi pautada por um foco implacável: transformar tecnologia e cenários críticos em oportunidades reais de negócio. No novidades.ia.br, trago essa visão executiva para o universo da IA. Especialista em produtos, mercado e ferramentas práticas de IA. Minha missão aqui é filtrar o ruído do mercado, analisando benchmarks, estratégias de grandes empresas e ferramentas práticas.


