My Account Log in

1 option

Building AI Agents with LLMs, RAG, and Knowledge Graphs : A Practical Guide to Autonomous and Modern AI Agents.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Raieli, Salvatore.
Contributor:
Iuculano, Gabriele.
Language:
English
Subjects (All):
Artificial intelligence--Computer programs.
Artificial intelligence.
Natural language processing (Computer science).
Physical Description:
1 online resource (560 pages)
Edition:
1st ed.
Place of Publication:
Birmingham : Packt Publishing, Limited, 2025.
Summary:
Master LLM fundamentals to advanced techniques like RAG, reinforcement learning, and knowledge graphs to build, deploy, and scale intelligent AI agents that reason, retrieve, and act autonomously Key Features Implement RAG and knowledge graphs for advanced problem-solving Leverage innovative approaches like LangChain to create real-world intelligent systems Integrate large language models, graph databases, and tool use for next-gen AI solutions Purchase of the print or Kindle book includes a free PDF eBook Book Description This AI agents book addresses the challenge of building AI that not only generates text but also grounds its responses in real data and takes action. Authored by AI specialists with deep expertise in drug discovery and systems optimization, this guide empowers you to leverage retrieval-augmented generation (RAG), knowledge graphs, and agent-based architectures to engineer truly intelligent behavior. By combining large language models (LLMs) with up-to-date information retrieval and structured knowledge, you'll create AI agents capable of deeper reasoning and more reliable problem-solving. Inside, you'll find a practical roadmap from concept to implementation. You'll discover how to connect language models with external data via RAG pipelines for increasing factual accuracy and incorporate knowledge graphs for context-rich reasoning. The chapters will help you build and orchestrate autonomous agents that combine planning, tool use, and knowledge retrieval to achieve complex goals. Concrete Python examples built on popular libraries, along with real-world case studies, reinforce each concept and show you how these techniques come together. By the end of this book, you'll be well-equipped to build intelligent AI agents that reason, retrieve, and interact dynamically, empowering you to deploy powerful AI solutions across industries. What you will learn Learn how LLMs work, their structure, uses, and limits, and design RAG pipelines to link them to external data Build and query knowledge graphs for structured context and factual grounding Develop AI agents that plan, reason, and use tools to complete tasks Integrate LLMs with external APIs and databases to incorporate live data Apply techniques to minimize hallucinations and ensure accurate outputs Orchestrate multiple agents to solve complex, multi-step problems Optimize prompts, memory, and context handling for long-running tasks Deploy and monitor AI agents in production environments Who this book is for If you are a data scientist or researcher who wants to learn how to create and deploy an AI agent to solve limitless tasks, this book is for you. To get the most out of this book, you should have basic knowledge of Python and Gen AI. This book is also excellent for experienced data scientists who want to explore state-of-the-art developments in LLM and LLM-based applications.
Contents:
Cover
Title Page
Copyright and Credits
Dedication
Disclaimer
Contributors
Table of Contents
Preface
Free Benefits with Your Book
Part 1: The AI Agent Engine: From Text to Large Language Models
Chapter 1: Analyzing Text Data with Deep Learning
Technical requirements
Representing text for AI
One-hot encoding
Bag-of-words
TF-IDF
Embedding, application, and representation
Word2vec
A notion of similarity for text
Properties of embeddings
RNNs, LSTMs, GRUs, and CNNs for text
RNNs
LSTMs
GRUs
CNNs for text
Performing sentiment analysis with embedding and deep learning
Summary
Chapter 2: The Transformer: The Model Behind the Modern AI Revolution
Exploring attention and self-attention
Introducing the transformer model
Training a transformer
Exploring masked language modeling
Visualizing internal mechanisms
Applying a transformer
Subscribe for a free eBook
Chapter 3: Exploring LLMs as a Powerful AI Engine
Discovering the evolution of LLMs
The scaling law
Emergent properties
Context length
Mixture of experts
Instruction tuning, fine-tuning, and alignment
Exploring smaller and more efficient LLMs
Exploring multimodal models
Understanding hallucinations and ethical and legal issues
Prompt engineering
Further reading
Part 2: AI Agents and Retrieval of Knowledge
Chapter 4: Building a Web Scraping Agent with an LLM
Understanding the brain, perception, and action paradigm
The brain
The perception
Action
Classifying AI agents
Understanding the abilities of single-agent and multiple-agent systems
Exploring the principal libraries
LangChain
Haystack
LlamaIndex
Semantic Kernel
AutoGen.
Choosing an LLM agent framework
Creating an agent to search the web
Chapter 5: Extending Your Agent with RAG to Prevent Hallucinations
Exploring naïve RAG
Retrieval, optimization, and augmentation
Chunking strategies
Embedding strategies
Embedding databases
Evaluating the output
Comparison between RAG and fine-tuning
Using RAG to build a movie recommendation agent
Chapter 6: Advanced RAG Techniques for Information Retrieval and Augmentation
Discussing naïve RAG issues
Exploring the advanced RAG pipeline
Hierarchical indexing
Hypothetical questions and HyDE
Context enrichment
Query transformation
Keyword-based search and hybrid search
Query routing
Reranking
Response optimization
Modular RAG and its integration with other systems
Training and training-free approaches
Implementing an advanced RAG pipeline
Understanding the scalability and performance of RAG
Data scalability, storage, and preprocessing
Parallel processing
Security and privacy
Open questions and future perspectives
Chapter 7: Creating and Connecting a Knowledge Graph to an AI Agent
Introduction to knowledge graphs
A formal definition of graphs and knowledge graphs
Taxonomies and ontologies
Creating a knowledge graph with your LLM
Knowledge creation
Creating a knowledge graph with an LLM
Knowledge assessment
Knowledge cleaning
Knowledge enrichment
Knowledge hosting and deployment
Retrieving information with a knowledge graph and an LLM
Graph-based indexing
Graph-guided retrieval
GraphRAG applications
Understanding graph reasoning.
Knowledge graph embeddings
Graph neural networks
LLMs reasoning on knowledge graphs
Ongoing challenges in knowledge graphs and GraphRAG
Chapter 8: Reinforcement Learning and AI Agents
Introduction to reinforcement learning
The multi-armed bandit problem
Markov decision processes
Deep reinforcement learning
Model-free versus model-based approaches
On-policy versus off-policy methods
Exploring deep RL in detail
Challenges and future direction for deep RL
Learning how to play a video game with reinforcement learning
LLM interactions with RL models
RL-enhanced LLMs
LLM-enhanced RL
Key takeaways
Part 3: Creating Sophisticated AI to Solve Complex Scenarios
Chapter 9: Creating Single- and Multi-Agent Systems
Introduction to autonomous agents
Toolformer
HuggingGPT
ChemCrow
SwiftDossier
ChemAgent
Multi-agent for law
Multi-agent for healthcare applications
Working with HuggingGPT
Using HuggingGPT locally
Using HuggingGPT on the web
Multi-agent system
SaaS, MaaS, DaaS, and RaaS
Software as a Service (SaaS)
Model as a Service (MaaS)
Data as a Service (DaaS)
Results as a Service (RaaS)
A comparison of the different paradigms
Chapter 10: Building an AI Agent Application
Introduction to Streamlit
Starting with Streamlit
Caching the results
Developing our frontend with Streamlit
Adding the text elements
Inserting images in a Streamlit app
Creating a dynamic app
Creating an application with Streamlit and AI agents
Machine learning operations and LLM operations
Model development
Model training
Model testing.
Inference optimization
Handling errors in production
Security considerations for production
Asynchronous programming
asyncio
Asynchronous programming and ML
Docker
Kubernetes
Docker with ML
Chapter 11: The Future Ahead
AI agents in healthcare
Biomedical AI agents
AI agents in other sectors
Physical agents
LLM agents for gaming
Web agents
Challenges and open questions
Challenges in human-agent communication
No clear superiority of multi-agents
Limits of reasoning
Creativity in LLM
Mechanistic interpretability
The road to artificial general intelligence
Ethical questions
Chapter 12: Unlock Your Exclusive Benefits
Index
About Packt
Other Books You May Enjoy.
Notes:
Description based on publisher supplied metadata and other sources.
ISBN:
1-83508-038-3
OCLC:
1527710967
Publisher Number:
CIPO000229933

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account