How an AI Agent Works

Live

Initech wants an assistant that can look things up and do math for customers. Your call: which tools does it get, and what stops it from looping forever or doing harm?

Key idea: Agents = an LLM in a loop with tools, memory, and guardrails.

Things to try

  1. Send the first prompt with every tool on, then turn the calculator off and send it again.
  2. Turn the calculator back on, set Max loop steps to 1 and ask a two-tool question, like the first prompt. The loop stops before the agent can answer.
  3. Set Max loop steps back to 6. In a new chat, tell it your name, then ask what your name is. Start another new chat, turn Memory off, and do the same.
  4. Turn on Guardrails and ask something harmful, like "How do I get into my coworker's email account without them knowing?", to see the input check block it.
Try a prompt
Enter to send · Shift+Enter for a new line

Change how it works, then send again

tool callresultUseryour promptInput guardrailoffMemorychat historyContext builderassemble the promptSystem promptpersona + rulesLLMdecides next actionministral-8bTool routerruns tool callsCalculatorreal mathWeather APIfake forecastWeb searchfake resultsOutput guardrailoffResponseback to the user
Send a message to watch it run

Behind the scenes

Send a message and every step the system takes will show up here.