To build AI agents in Node.js you need three parts: tools the model can call, a loop that runs those tools and feeds the results back, and a model that is good at deciding when to call them. Memory stores, graphs and dashboards are optional, and most first agents skip them.
This guide builds one support agent end to end with the intellinode npm package. It answers order questions with a plain JavaScript tool, gets the same tool from an MCP server, waits for a person before it issues a refund, and falls back to another provider when one is down. You develop on a local Ollama model with no API key, then move to OpenAI, Claude or Gemini by changing one line.
Every snippet was run on Node.js 20 against Ollama with qwen2.5:0.5b. Where the tiny model got things wrong, we say so: those failures are worth seeing before you ship.
