liveBook · Manning

AI agent

As explained in Domain-Specific Small Language Models

An autonomous software entity that can invoke models or tools as part of a larger system.

An AI agent is a software system that autonomously performs tasks and makes decisions for a user while pursuing specific goals. It uses a language model to reason about context, act through external tools or APIs, and interact with users or other agents. A simple prompt-in, output-out application is not necessarily agentic; many systems labeled agentic are closer to robotic process automation. section 13.4

Agents address limitations of standalone language-model interactions by combining:

  • Reasoning: analyzing a prompt and context, determining next steps, and breaking complex problems into smaller tasks. section 13.4
  • Action: selecting and calling external tools, APIs, search systems, databases, or code interpreters. section 13.4 section 13.5
  • Interaction: communicating with users or other agents while pursuing a shared task. section 13.4
  • Memory and refinement: managing short- and long-term context, obtaining current information, and revising initial answers. section 13.4
  • Execution control: iterating through reasoning and acting, chaining tool outputs, and limiting workflows with a step budget. section 13.5

Flight search, seat selection, and booking

A CodeAgent receives “Find a flight from Dublin to New York and then select a seat.” It searches for flights, passes a selected flight code to a seat-finding tool, and can then call a booking tool. The workflow demonstrates planning, tool selection, and multistep chaining; custom tools expose domain-specific operations through typed functions and docstrings. section 13.5

Agents can also extend retrieval-augmented generation. In agentic RAG, an agent performs multistep retrieval, updates queries when results are inadequate, and chooses among local vector search, keyword search, and web search before generating an answer. This pattern supports customer support, research assistance, knowledge management, and domain-specific problem solving. section 14.2

How Domain-Specific Small Language Models covers it

How deep it goes
Explains reasoning, acting, interaction, memory, planning, and tool chaining, while deferring advanced agent concepts.
Examples
Demonstrates flight booking, custom Python tools, CodeAgent workflows, and adaptive hybrid retrieval over local documents.
What it assumes
Assumes language-model basics and introduces agent construction, tool interfaces, planning, and multistep execution operationally.
What you can do after
Build it from scratch with smolagents, Python-based tools, small language models, and chained local or web retrieval.
How it connects
Connects AI agents with language models, external tools, APIs, memory management, RAG, vector databases, and web search.

Also explained in

Compare how 33 books explain AI agent →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.