AI doesn't necessarily do work with the model alone
Chapter 4 looked at the flow through which a model generates output from input. But in actual AI services, there is work that model-based Generation alone cannot cover — for example:
- looking up current web information
- searching through a set of documents for needed information
- reading a file
- calling an API
- executing a command
Chapter 6 organized the cases where a piece of work needs current external information or external execution. This chapter looks at the mechanisms an AI system may use to extend that capability. To do so, an AI system may combine functions other than the model.
This chapter distinguishes the following five:
Search
Retrieval
RAG
Tool Use
AI Agent
These are not the same thing.
Search
Search is a process or feature that takes a query against a collection of information or documents and finds information or results relevant to the goal. Web search is one example of Search, but Search = only Web Search does not hold. It also isn't the same as Search = Generation or Search = Retrieval. Where and how the search happens depends on the system.
Retrieval
Retrieval is finding and taking out documents or information relevant to an information need, from a collection or index. Search and Retrieval can be closely related, but they are not synonyms. Retrieval is also not Generation. Conceptually, we can separate them as:
finding / taking out needed information
↓
Retrieval
using that information to compose text
↓
Generation
RAG
RAG is short for Retrieval-Augmented Generation. Conceptually, RAG combines Retrieval and Generation like this:
This diagram is a conceptual diagram for understanding.
Using RAG = it must be correct does not hold. If the retrieved information is insufficient, or the content is handled incorrectly during generation, the result can be an incorrect answer.
Don't mix up Search, Retrieval, and RAG
Lining up the three:
Search
→ finds relevant information
Retrieval
→ takes out relevant information
RAG
→ an approach/configuration that uses retrieved information for Generation
An actual system may combine these, but as terminology, understand them separately.
Tool Use
An AI system can also use external tools — for example:
- Search
- API
- functions
- code execution
- file operations
This is broadly treated as Tool UseTool Use is the mechanism/capability by which an AI model or AI system uses external tools — search, APIs, functions, code execution, and more — to obtain information, process it, or perform operations. A model generating a request to use a tool and an external tool actually being executed are not the same thing, and Tool Use does not mean only Function Calling. → Function Calling, AI Agent. What matters here is:
the model requested tool use
!=
the tool was actually executed
Even if a model generates a structured output like "please call this function," that is an execution request — it is separate from the tool actually being invoked.
Request, Execution, Result, Explanation
To understand Tool Use, it helps to separate the following four:
1. the model generates a tool request
↓
2. the external tool executes
↓
3. the tool result comes back
↓
4. the AI explains the result
These are separate states. In particular, request != execution and result != AI explanation. An AI reporting in text that it "executed" something and there being an artifact of that tool execution are also not the same thing.
Function Calling
Function Calling is a mechanism where the model outputs, in structured form, a function name and arguments in order to use a predefined function or tool. However, Function Calling output = function execution does not hold. What actually executes the function may be software or a system outside the model.
So when confirming Function Calling, separate:
- request
- invocation
- result
AI Agent
The term AI AgentAn AI Agent is an AI system that, for a given goal or task, judges the situation using a model and the like, and — as needed — combines multiple steps and Tool Use to carry out processing. Not every LLM application or chatbot is an AI Agent, and being an AI Agent does not mean full autonomy. → Tool Use, LLM, Agentic AI is also used often. In this book, we understand AI Agent as:
an AI system that, for a given goal or task, uses a model and combines multiple steps and Tool Use as needed to carry out processing
For example, processing like this may be involved:
goal
↓
check the situation
↓
decide the next action
↓
use a Tool
↓
receive the result
↓
decide the next action
This diagram is also just one example for thinking about Agent processing — not the only Agent architecture.
AI Agent is not the same thing as LLM
Non-synonymy matters here too: AI Agent != LLM, AI Agent != Tool Use alone, AI Agent != every chatbot. A model is sometimes used within an AI Agent, but "Agent" is a system-level concept. Also, using a Tool once doesn't necessarily make something an Agent.
Being an Agent doesn't mean fully autonomous
The term AI Agent may bring to mind "a system that can do anything autonomously, without humans." But AI Agent = fully autonomous does not hold. An Agent's autonomy, its permissions, the actions it can perform, and whether Human approval is required all vary by system. The term Agentic AI is also used to emphasize autonomous planning and Tool Use, but the term's scope varies.
Tool access broadens not just capability, but the scope of impact
Once it can use Tools, an AI system can execute things that model output alone could not, such as:
reading
searching
calling APIs
rewriting
executing
But being able to act on the outside world also means the scope of what needs to be confirmed grows too. generating an answer and changing external state are not the same thing. Tool and Agent safety is covered again in Chapter 10.
Don't construct an invisible pipeline
Knowing the terms Search, Retrieval, RAG, Tool, and Agent does not tell you the undisclosed internal structure of a specific AI service. For example, don't turn a generic implementation pattern into fact about a specific system, as in:
must have Searched
↓
must have used a Vector DB
↓
Chunked it
↓
built Embeddings
↓
must have used this reranking algorithm
Where there is no public Evidence, that part remains UNKNOWN / UNDISCLOSED.
Chapter summary
Search != Retrieval != Generation
Retrieval != RAG
RAG != correctness guarantee
Tool request != Tool execution
Tool result != AI explanation
AI Agent != LLM
AI Agent != complete autonomy
- Search is a function that finds relevant information
- Retrieval is a concept for obtaining relevant information
- RAG is an approach that uses retrieved information for Generation
- Tool Use requires separating request, execution, result, and explanation
- Function Calling output and actual function execution are not the same thing
- AI Agent is a system-level concept, not LLM itself
- being an Agent does not mean full autonomy
- Tool access broadens capability and the scope of external impact at the same time
- undisclosed internal pipelines are not filled in with guesses
The next chapter looks at what kind of physical environment these models and AI systems actually run in.