AI Agent Concepts: From Basic Agents to Planning with Memory
TL;DR
- An agent uses a trained LLM to translate a prompt into an output; useful mainly for basic, direct questions.
- Planning has an agent feed its own output back in as input repeatedly until a reasonable response is found, though quality degrades fast.
- Planning with feedback adds action-observation loops governed by specialized prompts, but each step has no memory of the last.
- Planning with feedback and memory adds short-term and long-term memory to consolidate steps, improving output quality; different memory formats (key/value, embedded, DBs) are worth considering.
- Tools are external APIs (GitLab, Google Search API, code interpreters, formatters, parsers, image analysis, chart generators, static analysis) that agents can call as part of their steps.
Notes on Agent Architectures
An agent uses a trained large language model to translate a given input (prompt) into an output based on the data it was trained on. It’s not particularly useful in isolation, except for basic and direct questions like ‘How many records are in this database?’
Planning means having an agent take that initial input and produce an output that’s then consumed again as input, repeating until a reasonable response is found. Quality drops off quickly, but it points toward something useful.
Planning with feedback has an agent take the initial input, determine an action, perform it, and observe the result. These steps are governed by specialized prompts and repeat until a suitable response emerges. It’s useful, but there’s no real memory or build-up of knowledge across the process — each step has forgotten the last.
Planning with feedback and memory (short and long) works the same way as planning with feedback, except each step is consolidated into short-term memory and/or compared against long-term memory. Long-term memory gets updated for greater accuracy, while short-term memory is optimized for the next prompt. This enhances the quality of each iteration and leads to higher-quality output overall. It’s also worth considering different memory formats, such as key/value, embedded, or DBs.
Tools are essentially external APIs that agents can communicate with — think GitLab, the Google Search API, or a code interpreter — as well as local deterministic tools like formatters and parsers. These can be anything that takes an input and produces an output compatible with the steps agents take, whether that’s an image analysis tool, a chart generator, or a code static analysis tool.
ryer.io