chapter five

5 Expanding GenAI capabilities with tools and agents

 

In this chapter

  • understanding agents, how they reason, and how they behave
  • equipping agents with the right set of tools for expanding their capabilities
  • designing and building an app using agents and tools in Langflow

The seemingly magical text generation capacity of LLMs is impressive. But if you think about it, that’s all they do. They take in text. They apply some reasoning to that text. They output text. That’s it.

Their action is confined to strings of text, and in many cases, that’s enough. For example, this would work if we wanted to build an app to summarize a document, translate a message, or answer questions based on a given knowledge base. For many applications, the text-in, text-out behavior of large language models (LLMs) is sufficient, but in real-world applications, it’s often inadequate.

A fully loaded GenAI application is usually supposed to do stuff, not just generate text. Put another way, we need actions, not just words.

Beyond words: When GenAI needs to act

Let’s explore three sample cases.

Fetching live data

Sometimes, we need a GenAI app to fetch live data to respond to a user query. When we prompt an LLM with a question like, “What’s the weather like in Rome right now?”, we’re asking about something that requires a live connection to reality. There’s no point in retrieving this from a static vector database full of preloaded facts. No PDF will contain this live information, which is inherently ephemeral.

Agents and tools

Building an agent in Langflow

Building a travel agent

Taking agents to the next level

What if we coded it?

Summary