{"id":251506,"date":"2026-07-13T01:18:33","date_gmt":"2026-07-12T22:18:33","guid":{"rendered":"https:\/\/1kitap1.com\/en\/ai-agents-and-applications-final-roberto-infante-1\/"},"modified":"2026-07-13T01:18:33","modified_gmt":"2026-07-12T22:18:33","slug":"ai-agents-and-applications-final-roberto-infante-1","status":"publish","type":"post","link":"https:\/\/1kitap1.com\/en\/ai-agents-and-applications-final-roberto-infante-1\/","title":{"rendered":"AI Agents And Applications Final &#8211; Roberto Infante (1)"},"content":{"rendered":"<figure style=\"text-align:center;margin:0 auto 1.5em;\"><img decoding=\"async\" src=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/ce174fa7dfcb52e0.jpg\" alt=\" - Unknown book cover\" style=\"max-width:300px;width:100%;height:auto;box-shadow:0 4px 12px rgba(0,0,0,.25);border-radius:4px;\"\/><\/figure>\n<p>True proficiency comes from mas- tering these refinements. We\u2019ll 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\u2019s important to examine each step in both the content ingestion and the question-answering (Q&#038;A) workflows. Every stage can introduce challenges\u2014but each also presents opportunities for improvement. Let\u2019s 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.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<blockquote>\n<p>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&#038;A stage: retrieval and generation RAG Q&#038;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.<\/p>\n<p>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: orders@manning.com \u00a92026 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.<\/p>\n<p>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\u2019s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end.<\/p>\n<p>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.<\/p>\n<p>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 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n<p>1 1 \u25a0 Introduction to AI agents and applications 3 2 \u25a0 Executing prompts programmatically 27 PART 2 SUMMARIZATION &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 53 3 \u25a0 Summarizing text using LangChain 55 4 \u25a0 Building a research summarization engine 69 5 \u25a0 Agentic workflows with LangGraph 103 PART 3 Q&#038;A CHATBOTS &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n<\/blockquote>\n<p><em>This is a short excerpt from the opening of &ldquo;&rdquo; by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.<\/em><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/1kitap1.com\/en\/ai-agents-and-applications-final-roberto-infante-1\/#Book_Information\" >Book Information<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/1kitap1.com\/en\/ai-agents-and-applications-final-roberto-infante-1\/#Reading_Word_Statistics\" >Reading &amp; Word Statistics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/1kitap1.com\/en\/ai-agents-and-applications-final-roberto-infante-1\/#Most_Frequent_Words\" >Most Frequent Words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/1kitap1.com\/en\/ai-agents-and-applications-final-roberto-infante-1\/#PDF_Download\" >PDF Download<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Book_Information\"><\/span>Book Information<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Unique ID:<\/strong> ce174fa7dfcb52e0<\/li>\n<li><strong>File Extension:<\/strong> .pdf<\/li>\n<li><strong>File Size:<\/strong> 12,479,987 bytes (11.902 MB)<\/li>\n<li><strong>Title:<\/strong> &#8211;<\/li>\n<li><strong>Author:<\/strong> Unknown<\/li>\n<li><strong>ISBN:<\/strong> 9781633436541<\/li>\n<li><strong>Pages:<\/strong> 451<\/li>\n<li><strong>Language:<\/strong> English (en)<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Reading_Word_Statistics\"><\/span>Reading &amp; Word Statistics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Estimated Reading Time:<\/strong> 626.68 minutes<\/li>\n<li><strong>Total Words:<\/strong> 125,337<\/li>\n<li><strong>Total Characters:<\/strong> 903,983<\/li>\n<li><strong>Average Words per Page:<\/strong> 277.91<\/li>\n<li><strong>Average Characters per Page:<\/strong> 2004.4<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Most_Frequent_Words\"><\/span>Most Frequent Words<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>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\u2019ll (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).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"PDF_Download\"><\/span>PDF Download<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align:center;\"><a href=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/ai-agents-and-applications-final-roberto-infante-1.pdf\" download rel=\"nofollow\" style=\"display:inline-block;background:#2271b1;color:#ffffff;padding:14px 36px;border-radius:6px;text-decoration:none;font-weight:bold;font-size:1.05em;\">&#11015;&#65039; PDF Download<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>True proficiency comes from mas- tering these refinements. We\u2019ll 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\u2019s important to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":251504,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-251506","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-english"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/251506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/comments?post=251506"}],"version-history":[{"count":0,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/251506\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media\/251504"}],"wp:attachment":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media?parent=251506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/categories?post=251506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/tags?post=251506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}