toolloopagent
architecture judged 85% likely a named technique or architecture
See how it has spread across media tiers
Mentions over time
Table view
| Week | Articles | Sources |
|---|---|---|
| 2025-W43 | 1 | 1 |
| 2025-W51 | 1 | 1 |
| 2026-W03 | 1 | 1 |
| 2026-W20 | 1 | 1 |
| 2026-W25 | 2 | 1 |
| 2026-W36 | 1 | 1 |
In their words
A standard Next.js chat route, before: import { openai } from '@ai-sdk/openai'; import { ToolLoopAgent, stepCountIs } from 'ai'; const agent = new ToolLoopAgent({ model: openai('gpt-5.4-mini'), instructions: 'You are a helpful assistant.', stopWhen: stepCountIs(10), }); And After: import { createNamsProvider } from '@neo4j-labs/nams-ai-provider'; import { openai } from '@ai-sdk/openai'; import { T
This enables you to encapsulate more logic in ToolLoopAgent and share those agents with that internal logic.
Typed runtime context : Shared orchestration state lives in runtimeContext and flows through prepareStep , approval functions, lifecycle callbacks, telemetry, ToolLoopAgent , and WorkflowAgent .
import { Chat } from "chat";import { createChatTools } from "chat/ai";import { ToolLoopAgent } from "ai";const chat = new Chat({ userName: "mybot" /* ...
import { experimental_createSkillTool as createSkillTool, createBashTool,} from "bash-tool";import { ToolLoopAgent } from "ai";// Discover skills and get files to uploadconst { skill, files, instructions } = await createSkillTool({ skillsDirectory: "./skills",});// Create bash tool with skill filesconst { tools } = await createBashTool({ files, extraInstructions: instructions,});// Use both tools
import { ToolLoopAgent } from 'ai';import { GetEntityJoins, LoadCatalog, /*...*/ } from '@/lib/tools'const agent = new ToolLoopAgent({ model: "anthropic/claude-opus-4.5", instructions: "", tools: { GetEntityJoins, LoadCatalog, RecallContext, LoadEntityDetails, SearchCatalog, ClarifyIntent, SearchSchema, GenerateAnalysisPlan, FinalizeQueryPlan, FinalizeNoData, JoinPathFinder, SyntaxValidator, Final
Define a tool with needsApproval: true and the agent will pause until someone confirms: const weather = tool({ description: 'Get the weather in a city', inputSchema: z.object({ city: z.string() }), needsApproval: true, // approval gate execute: async ({ city }) => { const weather = await fetchWeather(city); return weather; },});// Agent that can call the approved tool in a loopexport const agent =