Tooling

From chatbot to AI agent: RAG, tools and MCP explained

A chatbot answers. An agent acts. The jump between them comes down to three ideas, giving the model knowledge it can look up, tools it can use, and a standard way to plug those tools in.

Choose your level

A chatbot gives you an answer. An AI agent actually does the task, it searches, checks, clicks, writes, and keeps going until the job is done. Three simple ideas make that possible.

1. Let it look things up. On its own, an AI only "knows" what it learned in training, which can be out of date or miss your private files. Connect it to your documents and it can look up the right information before answering. That is what "RAG" means, basically an open-book exam instead of memory alone.

2. Give it tools. Instead of only writing text, let the AI use tools: a calculator, a web search, your calendar, sending an email. Now it can do things, not just describe them.

3. Use a standard plug. Connecting an AI to every tool used to need custom wiring each time. A new standard called MCP is like a USB-C port for AI: one type of plug, many tools. That is a big reason agents are suddenly everywhere.

Put together: knowledge it can look up + tools it can use + an easy way to connect them = an assistant that gets real work done.

The step from chatbot to agent is about adding knowledge, actions and a loop around a language model.

Building block 1: retrieval (RAG)

A model's built-in knowledge is frozen at training time and excludes your private data. Retrieval-augmented generation fixes this: before answering, the system searches a collection of documents for the most relevant passages and hands them to the model. Benefits: current and private knowledge, fewer hallucinations, and citable sources. Under the hood, documents become embeddings in a vector database, and the question is matched by meaning.

Building block 2: tool use

Tool use (or "function calling") lets the model trigger external actions, search, run code, query a database, send a message, instead of only generating words. The model outputs a structured request, the application runs it, and the result is fed back. This is what lets AI act.

Building block 3: a standard connector (MCP)

Connecting M apps to N tools used to mean M×N custom integrations. The Model Context Protocol is an open standard (like a USB-C port for AI) so a tool exposes itself once and any compatible app can use it, turning M×N into M+N.

Putting it in a loop: the agent

An agent runs these in a loop: decide → use a tool or retrieve → observe the result → decide the next step, repeating until the goal is met. That loop is an agentic workflow. The coordination around it, which step runs when, is orchestration.

The honest caveat

More autonomy means more can go wrong: errors compound across steps, and actions that send or delete things need care. Good practice: start simple, keep a human in the loop for anything irreversible.

The chatbot→agent transition augments a stateless LLM with grounded knowledge, an action space, and a control loop.

Grounding via retrieval

RAG conditions generation on retrieved passages rather than parametric memory alone (Lewis et al. 2020), addressing knowledge staleness, private data and hallucination while enabling attribution. The pipeline, chunk → embed → index in a vector store → retrieve top-k (often hybridised with lexical search and re-ranking) → inject into the context window, makes retrieval quality, not the model, the usual determinant of answer quality.

Actions via tools

Tool use exposes typed function signatures; the model emits structured calls the runtime executes, returning observations into context. This is the primitive underneath agents: retrieval, code execution and browsing are all tools. Reliability hinges on well-scoped, validated, ideally idempotent tools.

Interoperability via MCP

MCP standardises tool/resource/prompt exposure over JSON-RPC, decoupling capability providers from model vendors and collapsing M×N integration to M+N, the plumbing that makes agent ecosystems composable.

The loop, and its hard parts

An agent interleaves reasoning and acting (ReAct-style) in a perceive-reason-act loop, with short-term (context) and long-term (memory/retrieval) state, coordinated by orchestration that ranges from fixed workflows to model-driven agentic control. The dominant challenges are reliability, not capability: compounding error, cost/latency of long loops, and safe handling of side-effecting actions. Practitioner guidance favours the minimum autonomy a task needs, composable tools, bounded loops, verification steps, and human-in-the-loop checkpoints for irreversible operations (Anthropic 2024). Scale to multi-agent topologies only when tasks are genuinely decomposable or benefit from independent verification.

Get in touch

← Back to the academy  ·  AI Glossary

What are you looking for?