Urgent.News

What's breaking now, across thousands of outlets.

AI

The Four Components of an AI Agent, in One Small TypeScript File

Most explanations of AI agents stop at “a model with tools”. That is true, but it doesn't help when your agent forgets a preference, calls the wrong function or loops forever. To debug any of those, you need to know which part is misbehaving. This post continues my series on building agents. The previous one covered LLMs versus agents . The four components of an AI agent An AI agent has four…

The four components of an AI agent are the brain, memory, tools, and action loop. The brain is the language model that decides the next step, while memory holds the conversation history and stored facts. Tools allow the agent to interact with the outside world, and the action loop runs the model, executes tools, and returns results.

The brain is the only model in an AI agent. It receives the system prompt, conversation, tool list, and tool results, and returns text or a request to call a tool. Memory consists of two layers: short-term memory, which is the message history sent with every call, and long-term memory, which is anything written to storage and read back in a later run.

Tools are ordinary functions with a description, name, when to use them, and a JSON Schema for inputs. The model never sees the code, only the description, so it should be written like API documentation for a reader who can't ask questions. The action loop sends memory to the brain, and a tool request runs the tool, appends the result to memory, and repeats the loop. Exits include a final answer, a step cap, unrecoverable failures, and human approval.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

How AI Rap Duo Video Generators Work Under the Hood (and How to Pick One)

The "Hotel Lobby AI" trend is everywhere right now: two photos in, a twelve-second rap performance out, with two familiar faces sharing an orange stage and a hanging microphone.

  • AI rap duo video generators create short raps from two photos and optional topic
  • Detect and align faces in uploaded photos for consistent input
  • Generate motion and scene elements via pre-built templates

How AI can investigate a 12 GB export without reading it into a prompt

Imagine asking an AI assistant for the average order value in a 12 GB sales export. It finds an amount column and suggests AVG(line_amount) . The query runs. The number looks reasonable.

  • AI investigates 12 GB export without reading line by line
  • AI model needs to understand data grain or detail level
  • Query calculates average order value for October 2026 orders

Weekend Challenge: Model Substitution Governance & Audit Platform for Dynamic LLM Gateways

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend : https://dev.to/challenges/hacktoberfest-weekend-2026-10-01 What I Built I built the Model Substitution Governance &…

  • Python Interceptor SDK monitors model substitutions without adding latency
  • FastAPI cloud tracker computes capability downgrade percentages
  • Web dashboard provides real-time risk scoring and compliance reports

More from Monday 5 October →