How do AI agents work, anyway?

In this post, I’ll provide a brief conceptual introduction to AI agents and analyze the implementation of the smolagents library by examining its OpenAI API calls using mitmproxy and DuckDB. What are agents? An AI agent is a program that performs actions through a set of tools. For example, ChatGPT is an agent that can search the web via a tool. Agents use Large Language Models (LLMs) to break…