Colloquially, AI agents are just while loops with LLM calls and tool calls. More specifically, what distinguishes an agent from LLM pipelines is that its next step is determined dynamically (based on the output of the previous one) so the execution path isn’t fixed. The boundary between complex LLM chaining and agents is pretty fuzzy, but we support both.
Haha also our whole backend is in Django :)
Gotcha, you're using the "LLM calling tools in a loop" definition. I think that's a decent one, but I worry that many people out there are carrying around completely different ideas as to what the term means.
Do you have a writeup on the different interpretations of "AI Agent"?
I need to put one together. The big ones are:
- "LLM running tools in a loop" - often used by Anthropic, generally the most popular among software engineers who build things
- "An AI system that performs tasks on your behalf" - used by OpenAI, I dislike how vague this one is
- "an entity that perceives its environment through sensors and acts upon that environment through actuators to achieve specific goals" - the classic academic one, Russell and Norvig. I sometimes call this the "thermostat definition".
- "kinda like a travel agent I guess?" - quite common among less technical people I've talked to
I gathered over a hundred on Twitter last year, summarized by Gemini here: https://gist.github.com/simonw/beaa5f90133b30724c5cc1c4008d0...
I also have a tag about this on my blog: https://simonwillison.net/tags/agent-definitions/
The way I draw the line is to focus on the "agency" aspect.
In workflows/pipelines the "agency" belongs to the coder/creator of the workflow. It usually resembles something like a "list of steps" or "ittt". Examples include traditional "research" flows like 1. create search terms for query; 2. search; 3. fetch_urls; 4. summarise; 5. answer
In agents the "agency" belongs, at one point or another, to the LLM. It gets to decide what to do at some steps, based on context, tools available, and actions taken. It usually resembles a loop, without predefined steps (or with vague steps like "if this looks like a bad answer, retry" - where bad answer can be another LLM invocation w/ a specific prompt). Example: Fix this ticket in this codebase -> ok, first I need to read_files -> read_files tool call ... and so on.
In the research workflow example, what if the first set of search queries don’t return good results. If the LLM tool loop decides to refine the queries, would this be “agency”?
I'd say so, yeah. If the LLM "decides" what steps to take, that's an agent. If the flow is "hardcoded" then it's a workflow/pipeline. It often gets confused because early frameworks called these workflows/pipelines "agents".
I see, that's a good way to think about it