Follow our Telegram channel to get notified instantly whenever new books are published.
AI Agents And Applications Final – Roberto Infante (1)

True proficiency comes from mas- tering these refinements. We’ll begin with advanced indexing strategies, such as creating multiple embed- dings for larger text chunks in the vector database. This approach improves retrieval precision and ensures richer, more accurate context for response generation. 8.1 Improving RAG accuracy To boost the accuracy of RAG, it’s important to examine each step in both the content ingestion and the question-answering (Q&A) workflows. Every stage can introduce challenges—but each also presents opportunities for improvement. Let’s begin with the content ingestion stage. 8.1.1 Content ingestion stage Retrieval accuracy can be improved through an optimized content ingestion process that aligns with the specific features of each content store.
Relying only on basic index- ing can reduce indexing depth and weaken retrieval performance. Figure 8.1 shows two key areas for improvement in the ingestion stage: refining embedding calculations and optimizing how embeddings are linked to related text chunks in the vector store. Figure 8.1 Common accuracy issues in the ingestion stage of a simple RAG architecture are often due to inadequate indexing that only uses basic embeddings for each text chunk.
Advanced indexing techniques involve generating multiple embeddings for each chunk, enhancing searchability. Vector DB Text ingestion script 1. Ask the embedding service to calculate the embeddings of the document chunks. 2. Return embeddings. 3. Store document chunks and related embeddings in the vector store. Embeddings service RAG ingestion phase Typically, we only calculate the embedding of the content of the text chunk. However, we can calculate multiple embeddings to make the chunk more searchable. Advanced indexing 8.1 Improving RAG accuracy Even if a question is clear, retrieval can fail with overly simple indexing strategies.
In vector indexing, chunk size and overlap length are crucial: smaller chunks may work well for precise questions but fail with broader queries, while larger chunks may lack detail for specific questions. To address this, you can add additional embeddings based on distinct chunk features, as illustrated in figure 8.1.
to the user question. 4. The chatbot creates a prompt with the user question and the retrieved chunks (the context). 5. The LLM accepts the prompt and synthesizes a corresponding completion (the response). Similar chunks Question embeddings Retrieval-Augmented Generation (RAG) Q&A stage: retrieval and generation RAG Q&A Stage AI Agents and Applications ii AI Agents and Applications WITH LANGCHAIN, LANGGRAPH AND MCP ROBERTO INFANTE M A N N I N G SHELTER ISLAND For online information and ordering of this and other Manning books, please visit www.manning.com.
The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Email: [email protected] ©2026 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. The author and publisher have made every effort to ensure that the information in this book was correct at press time. The author and publisher do not assume and hereby disclaim any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from negligence, accident, or any other cause, or from any usage of the information herein.
Manning Publications Co. Development editor: Dustin Archibald 20 Baldwin Road Technical editors: Keerthivasan Santhanakrishnan PO Box 761 and Antowan Malik Batts Shelter Island, NY 11964 Review editor: Kishor Rit Production editor: Kathy Rossland Copy editor: Julie McNamee Proofreader: Melody Dolab Technical proofreader: Andrew R. Freed Typesetter and cover designer: Marija Tudor ISBN 9781633436541 Printed in the United States of America To my mother and father vi brief contents PART 1 GETTING STARTED WITH LLMS …………………………………
1 1 ■ Introduction to AI agents and applications 3 2 ■ Executing prompts programmatically 27 PART 2 SUMMARIZATION ………………………………………………….. 53 3 ■ Summarizing text using LangChain 55 4 ■ Building a research summarization engine 69 5 ■ Agentic workflows with LangGraph 103 PART 3 Q&A CHATBOTS …………………………………………………
This is a short excerpt from the opening of “” by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.
Book Information
- Unique ID: ce174fa7dfcb52e0
- File Extension: .pdf
- File Size: 12,479,987 bytes (11.902 MB)
- Title: –
- Author: Unknown
- ISBN: 9781633436541
- Pages: 451
- Language: English (en)
Reading & Word Statistics
- Estimated Reading Time: 626.68 minutes
- Total Words: 125,337
- Total Characters: 903,983
- Average Words per Page: 277.91
- Average Characters per Page: 2004.4
Most Frequent Words
question (820), llm (818), prompt (631), search (615), text (587), chain (526), agent (502), query (469), chunks (462), content (455), user (453), model (451), langchain (422), vector (417), use (389), tool (386), document (361), using (349), context (320), assistant (320), store (318), rag (315), openai (305), api (302), tools (298), answer (298), chapter (290), travel (286), import (285), following (283), key (276), web (275), results (270), summary (263), mcp (262), agents (261), data (258), models (252), documents (250), chunk (243), queries (243), information (236), code (231), llms (225), source (225), figure (224), graph (223), state (222), response (221), research (212), cornwall (211), result (210), retrieval (209), you’ll (208), now (206), weather (205), embeddings (201), summarization (195), retriever (194), output (193), listing (186), questions (184), see (181), generate (180), https (177), prompts (177), node (175), create (175), list (173), input (173), gpt (169), name (169), building (168), open (167), engine (165), python (165), chatbot (164), metadata (163), next (163), get (161), langgraph (161), local (159), system (157), tokens (155), also (154), one (154), applications (153), template (151), return (150), server (150), sql (148), chat (147), based (147), coarse (145), messages (143), first (140), set (139), collection (138), history (138), embedding (138).
