From First Query to Multi-Agent Systems: A Practical Guide for Python Developers
Introduction: Why Agents, Why LlamaIndex, Why Now
- The Agent Moment
- What Production-Ready Really Means
- Why LlamaIndex Over Alternatives
- How to Read This Book
Chapter 1: LLM Fundamentals for Agent Builders
- How Large Language Models Generate Text
- Tokens, Context Windows and the Cost Equation
- Prompting Patterns That Matter for Agents
- Model Selection: Open Source vs Proprietary Trade-offs
- Setting Up Your First LLM Connection with LlamaIndex
Chapter 2: Inside LlamaIndex – Architecture and Core Concepts
- The LlamaIndex Abstraction Stack
- Documents, Nodes and the Ingestion Pipeline
- Settings and Global Configuration
- The Callback System and Extensibility Points
- Project Setup: Installation, Virtual Environments and Dependencies
Chapter 3: Data Ingestion and Indexing
- Loading Data from Multiple Sources
- Node Parsers and Chunking Strategies
- Metadata Extraction and Enrichment
- The Ingestion Pipeline API
- Building Your First Index
Chapter 4: Embeddings and Vector Stores
- How Embeddings Represent Meaning
- Choosing an Embedding Model
- Vector Store Landscape and Selection Criteria
- Implementing Your First Vector Store
- Index Persistence and Versioning
Chapter 5: Retrieval Strategies for Production RAG
- Top-K Retrieval and Its Limitations
- Hybrid Search: Combining Semantic and Keyword
- Reranking and Relevance Filtering
- Metadata Filtering and Auto-Retrieval
- Node Post-Processors for Fine-Tuning Results
Chapter 6: Building Your First RAG Application
- Project Architecture and Design Decisions
- Data Pipeline Implementation
- Retrieval and Query Engine Setup
- Adding Conversational Memory
- Testing the Complete System
Chapter 7: Tools, Function Calling and Structured Outputs
- The Tool Abstraction in LlamaIndex
- Defining Custom Tools with Type Signatures
- Function Calling and Model Support
- Structured Outputs with Pydantic Programs
- Error Handling and Retry Logic for Tool Calls
Chapter 8: Agent Workflows and Orchestration
- Event-Driven Architecture Fundamentals
- Defining Steps and Events
- State Management with Context Objects
- Parallel Execution and Conditional Routing
- Streaming Progress Events to Users
Chapter 9: Memory, Planning and Reasoning
- Short-Term vs Long-Term Memory Architectures
- ChatMemoryBuffer and VectorMemoryBlock
- Fact Extraction and Knowledge Accumulation
- ReAct: Reasoning and Acting in Loops
- Self-Reflection and Iterative Improvement
Chapter 10: Multi-Agent Systems
- Why Multi-Agent Architectures
- AgentWorkflow: Linear Swarm Pattern
- Orchestrator Agent: Sub-Agents as Tools
- Custom Planner: Maximum Flexibility
- Building a Multi-Agent Research Assistant (Project #2)
Chapter 11: Evaluation, Testing and Debugging
- Defining What Good Looks Like
- Retrieval Evaluation Metrics
- Generation Quality Assessment
- Automated Testing Strategies
- Debugging Common Failure Modes
Chapter 12: Observability and Monitoring
- The Three Pillars of Observability
- OpenTelemetry Integration with LlamaIndex
- Tracing Agent Execution Paths
- Metrics, Dashboards and Alerting
- Cost Tracking and Token Accounting
Chapter 13: Performance Optimization and Scalability
- Caching Strategies for Embeddings and LLM Calls
- Async Programming Patterns in Production
- Query Optimization Techniques
- Scaling Infrastructure: From Single Server to Distributed
- Cost Optimization Without Sacrificing Quality
Chapter 14: Security, Deployment and Production Patterns
- Security Considerations for AI Agent Systems
- Building Production APIs with FastAPI
- Containerization with Docker
- Cloud Deployment Strategies
- Real-World Production Patterns and Anti-Patterns
Conclusion: The Road Ahead
- What We Built
- The Evolving Agent Landscape
- Principles That Will Endure
- Your Next Steps

