AI Agents and Applications
Andrea De Mauro
MEAP Edition Version 7
About this book
Welcome to the MEAP (Manning Early Access Program) for AI Applications Made Easy! I’m genuinely excited to have you on board as one of the first readers, your journey into creating with Generative AI starts now.
Many of us already use GenAI daily, from chatbots like ChatGPT to AI-driven content tools. But using a GenAI app is one thing, building one is another. This book is designed to help you become a maker of GenAI applications. Right from the first few chapters, you’ll start building real, functional GenAI applications, not just experimenting with existing tools. I wrote this book to unleash your creativity and help you build something unique and tailored to your own needs. I can’t wait to see what you create!
GenAI tools and LLM models will come and go, but creating GenAI applications requires mastering fundamental techniques that will remain relevant for years. Concepts like prompt engineering, Retrieval-Augmented Generation (RAG), agentic structures, and tool design are essential skills that will give you a competitive advantage in the long run, no matter how technology evolves.
Unlike many AI books that take deep programming knowledge for granted, AI Applications Made Easy leverages low-code, open-source platforms like Langflow and KNIME, making AI development quick and accessible to everyone. These low-code tools are not just simplified solutions for beginners, they are comprehensive platforms that offer full customization and scalability. Even seasoned data scientists and GenAI developers who are comfortable writing code are turning to these tools because they make prototyping faster, more efficient, and highly scalable.
The book includes full, step-by-step tutorials starting from Chapter 2. Each tutorial guides you in building a GenAI app from scratch, such as a virtual customer service assistant, a marketing advisor, or a financial analyst. My goal is for you to learn by doing, experiencing firsthand what it means to develop end-to-end AI solutions that go beyond experimentation into real-world deployment.
As a MEAP reader, you get early access to the content while I continue writing. Your feedback is invaluable to me, it will directly shape the final book. I encourage you to share your thoughts on clarity, examples, and illustrations, and most importantly, to fully run all the exercises on your laptop so you can experience firsthand what this book enables. You can share your feedback on the LiveBook Discussion forum, I will read all of it, and I truly appreciate your contributions.
Thank you for joining me on this exciting journey. Happy building!
Your loving author,, Andrea De Mauro
Questions & Answers from this book
Questions and answers are connected to the referenced book and its available source material.
Chapter 1: Peeking inside the black box
In the PizzaMate™ RAG system, what are the two subflows and what is the purpose of each?
The two subflows are document ingestion and retrieve and answer. Document ingestion takes the PDF as input and produces a vector database with embedded chunks; it runs only when the database is created or the PDF information changes. Retrieve and answer takes a user query, performs a vector similarity search to find the most relevant chunks, and uses an LLM to answer the query; it runs whenever a user asks a question.
Why does RAG use embeddings instead of storing raw text for keyword search?
RAG uses embeddings because keyword search over raw text can only match exact or similar words, not meaning. Embeddings convert text into numbers that capture semantic content, so retrieval becomes a search for meaning instead of literal word matches. This makes RAG far more powerful and flexible at finding relevant context for a question.
In the RAG example from the chapter, how is the Euclidean distance between the user's question and each chunk embedding used to select the top chunks for answer generation?
The question is embedded into the same vector space as the chunks. The Euclidean distance from that question embedding to each chunk embedding is calculated, and the chunks are sorted by increasing distance. The closest chunks, or top k, are selected and inserted into the prompt as context so the LLM can generate the answer.
Chapter 2: Building your first GenAI app
What is the purpose of the 'Data to Message' component in the RAG workflow, and what configuration does it require?
The Data to Message component converts the table output of the vector database search into plain text, which the LLM can use in the prompt. It requires a Template parameter that describes the output format by referencing column names in curly brackets, such as setting it to {text} to extract the chunk text column.
In the Langflow flow described in the chapter, what is the exact prompt template used to combine the user query with the retrieved context, and what are the two input ports that appear on the Prompt component after entering this template?
The exact prompt template is: "Answer the user query by using the context. Context: {chunks} User: {message}". After entering this template, two input ports appear on the Prompt component: chunk and message.
What is the purpose of the Chunk Overlap parameter in the Split Text component, and what value is set in the example?
The Chunk Overlap parameter sets how many characters are shared between consecutive chunks so that important context at chunk boundaries is not lost. In the example, it is set to 150.
Chapter 3: Writing the right prompt
In the PizzaMate example, why did the LLM correctly identify the Morellino as the Tuscan wine even though the retrieved chunks did not explicitly state it?
The LLM identified the Morellino as the Tuscan wine because of its pre-trained general knowledge about Italian wines. The retrieved chunks mentioned several wines but did not explicitly state that Morellino was from Tuscany; the model used its existing knowledge to bridge that gap.
What is the effect of chunk size on RAG performance, and why does it matter?
Chunk size is a key tuning factor in RAG because it directly affects whether retrieved chunks contain enough relevant information. Too-small chunks can miss necessary details, while too-large chunks create oversized context that degrades LLM performance and produce embeddings that no longer represent the chunk's content effectively. For this reason, chunk size must be balanced, often by experimenting with the Split Text component's chunk size and overlap parameters.
What does the URL component do and what additional feature does it support for crawling webpages?
The URL component lets you enter one or more webpage addresses, and Langflow fetches their content and outputs it as a data table with text and metadata such as page title and language. It additionally supports recursive link traversal, meaning you can configure how many links away from the starting URL the crawler should follow, making it useful for indexing entire website sections.
Chapter 4: Augmenting LLMs with your own documents
What is query transformation in RAG and how does HyDE implement it?
Query transformation, or query rewriting, is a RAG optimization where an LLM rephrases the user's original query so it more closely matches the wording used in documents for vector similarity search. HyDE, short for Hypothetical Document Embeddings, implements this by generating a hypothetical answer to the query and then running the vector DB search using that synthetic text instead of the raw question.
How can you use metadata in RAG to improve answers, and what is an advanced technique mentioned?
You can include each chunk's metadata in the template sent to the model, such as source={file_path};text={text}, so the answer can use facts like the document's year. An advanced technique for leveraging metadata is Self-query, which lets the retriever filter chunks at search time using metadata fields.
Chapter 5: Expanding GenAI capabilities with tools and agents
How do you connect the three tools to the agent in Langflow, and what is the purpose of the Toolset port?
In Langflow, you connect tools to the agent by first turning each component into a tool using its Tool Mode selector, then dragging the component near the agent and linking its tool output to the agent's dark cyan Toolset input port. The Toolset port is how the agent receives the descriptions and capabilities of all available tools, forming the toolset it can call during its reasoning loop.
In the example from the chapter, what is the sequence of tool calls the agent makes to make the room comfortable for sleeping, and what information does it gather before making those calls?
The agent first gathers information by calling check_temperature() and check_light(). After learning the room is 24°C and the light is ON, it makes two further tool calls: set_thermostat(temp=20) and dim_lights(). Once both succeed, it tells the user that the thermostat is set to 20°C and the lights are dimmed for sleeping.
What three tools are needed for the HistoryTravelBuddy™ agent, and what is the purpose of each?
The three tools are a web search tool, a URL fetching tool, and a Wikipedia search tool. The web search tool finds webpages about sights in the city; the URL tool retrieves the full content of a chosen webpage; the Wikipedia tool searches for historical articles and returns their titles, summaries, URLs, and full text.
Chapter 6: Implementing agentic structures
In the HealthyChef reimagined example, what tools are given to the ChefAgent and DietitianAgent, and why are these tools chosen?
ChefAgent is given a RAG tool that retrieves recipes from a vector database built from The Italian Cook Book, chosen so the recipes are grounded in that specific 1919 source. DietitianAgent is given a URL-reading tool for fetching the EatWell Guide, chosen so it can consult official nutritional guidelines when reviewing and revising the recipe.
How does the Chef agent use the FAISS tool to respond to a user query like 'I want to use eggplants and tomatoes'?
For a query like "I want to use eggplants and tomatoes", the Chef agent recognizes that the user is offering ingredients and autonomously decides to invoke its toolified FAISS retriever. The FAISS tool searches the cookbook vector database for relevant recipe chunks mentioning those ingredients. After reading the retrieved chunks, the agent responds with the matching Italian Cook Book recipe, staying faithful to the source and not inventing content.
What are the roles of the three specialized agents in the CopyGenie™ hierarchical agentic structure, and what inputs and tools does each require?
The Planner Agent creates a detailed content plan by consulting the social media calendar and scheduling posts across the requested period. The Copywriter Agent drafts social media posts based on that plan while following the winery's brand guidelines. The Delivery Agent sends the finalized posts by email when the user requests it. Each is activated by the Supervisor Agent, which supplies the needed inputs and tools.
Chapter 7: Integrating GenAI in your data ecosystem
How can you configure the CSV Reader node in KNIME to load a CSV file and optionally modify the table structure during loading?
Configure the CSV Reader node by double-clicking it or clicking the cog icon to open its configuration window, then click Browse to choose the CSV file. The node previews the table, and you can adjust reading settings such as column delimiters. For optional table changes during loading, open the Transformation tab to rename columns, remove some, or reorder them.
How do you configure the Joiner node in KNIME to perform a left outer join that retains all customers even if they have no transactions?
Configure the Joiner node by connecting the Customer Master Data to the upper input (left table) and the Transaction History to the lower input (right table). In the Matching Criteria section, select CustomerID as the key for both tables. Under Include in Output, tick only Matching rows and Left unmatched rows, and leave Right unmatched rows unchecked. This retains all customers, including those with no transactions.
In KNIME, what are two different ways to load an Excel file into the workflow, as described in the chapter?
One way is to drag and drop the Excel file directly from your file explorer onto the KNIME canvas. KNIME then creates an Excel Reader node with the file location already filled in. Another way is to drag an Excel Reader node from the Node Repository onto the canvas and configure its File location manually.
Chapter 8: Deploying and orchestrating GenAI apps
What are the steps to reuse the Gmail component as a tool for sending emails in a Langflow agent?
Add the Gmail component to your Langflow flow, add the Composio API key, enable Tool Mode, and select Send Email as the only action permitted by the tool. This makes the Gmail component act directly as a tool that the agent can call for sending emails.
What is the role of the MCP server in the HungryTraveler agent architecture?
In HungryTraveler, the MCP server exposes previously built Langflow flows, such as HealthyChef and HistoryTravelBuddy, as discoverable tools that the parent agent can invoke as needed. This allows the HungryTraveler supervisor agent to reuse existing child-agent abilities and combine them for a new, more complex task without hand-built point-to-point integrations.
You may also be interested in
FastAPI: Modern Python Web Development
Bill Lubanovic;
37 questions
Generative Deep Learning: Teaching Machines to Paint, Write, Compose, and Play
David Foster;
33 questions
AI for the Ordinary_ A Non-technical Playbook for Citizens, Students, and Manage
Unknown
30 questions
AI for Qualitative Research: A Hands-On Guide for Management Scholars
Diana Garcia Quevedo
29 questions