Understanding why a tool is built is the most fundamental thing a human can do.
Let's dive into the deep oceans of why Gen AI is built the way it's built.
Putting the topics I am gonna cover over the course of time under this bucket. Please add a little patience to the recipe, and I will publish everything that's mentioned below.
============================================================
PART I — FOUNDATIONS: UNDERSTANDING ARTIFICIAL INTELLIGENCE
Introduction to Artificial Intelligence
1.1 What is intelligence?
1.2 What is computation?
1.3 What is Artificial Intelligence (AI)?
1.4 Traditional programming vs AI
1.5 Rule-based systems and expert systems
1.6 Automation vs Machine Learning vs AI
1.7 Narrow AI, Artificial General Intelligence, and Superintelligence
1.8 Predictive AI vs Generative AI
1.9 Applications and limitations of AIMachine Learning Fundamentals
2.1 What is Machine Learning (ML)?
2.2 Data, features, labels, and predictions
2.3 Supervised learning
2.4 Unsupervised learning
2.5 Self-supervised learning
2.6 Reinforcement learning
2.7 Training, validation, and test datasets
2.8 Parameters, weights, and biases
2.9 Loss functions and optimization
2.10 Gradient descent and backpropagation
2.11 Overfitting, underfitting, and generalization
2.12 Neural networks and deep learning
2.13 Why deep learning became important for Generative AIGenerative AI Fundamentals
3.1 What is Generative AI?
3.2 What does it mean to generate new content?
3.3 Generative models vs discriminative models
3.4 Text, image, audio, video, and multimodal generation
3.5 What is a foundation model?
3.6 What is a Large Language Model (LLM)?
3.7 Why LLMs are trained on enormous datasets
3.8 What does an LLM actually learn?
3.9 What is next-token prediction?
3.10 Why an LLM can answer questions, write code, and summarize documents
3.11 Capabilities, limitations, and hallucinations
3.12 Generative AI vs traditional ML applications
============================================================
PART II — HOW TEXT BECOMES SOMETHING AN LLM CAN PROCESS
Text Representation and Tokenization
4.1 How computers represent text
4.2 Characters, bytes, Unicode, and UTF-8
4.3 What is a token?
4.4 What is tokenization?
4.5 Why LLMs do not directly process ordinary words
4.6 Word-based vs character-based vs subword tokenization
4.7 Byte Pair Encoding (BPE)
4.8 WordPiece and Unigram tokenization
4.9 Special tokens: BOS, EOS, PAD, and UNK
4.10 Chat markers and end-of-turn tokens
4.11 Why one word does not always equal one token
4.12 How punctuation, code, numbers, and Indian languages are tokenized
4.13 Token IDs and vocabulary
4.14 Input tokens vs output tokens
4.15 Token limits, token pricing, and context windows
4.16 Tokenization using a tokenizer libraryEmbeddings and Vector Representations
5.1 Why tokens need numerical representations
5.2 What is an embedding?
5.3 Token embeddings
5.4 Embedding dimensions and vectors
5.5 Semantic meaning in vector space
5.6 Why similar concepts can have similar embeddings
5.7 Static embeddings vs contextual embeddings
5.8 Word2Vec and related historical approaches
5.9 How transformer models produce contextual representations
5.10 Cosine similarity, dot products, and vector distance
5.11 What embeddings can and cannot represent
5.12 Why embeddings are important for semantic search and RAGPositional Information and Attention
6.1 Why token order matters
6.2 Positional embeddings and positional encodings
6.3 Relative position and Rotary Positional Embeddings (RoPE)
6.4 What is attention?
6.5 Why an LLM needs to relate one token to other tokens
6.6 Query, Key, and Value vectors
6.7 Scaled dot-product attention
6.8 Attention scores and softmax
6.9 Self-attention with a sentence-level example
6.10 Causal masking and why future tokens are hidden during generation
6.11 Multi-head attention
6.12 Multi-query attention and grouped-query attention
6.13 Computational cost of attention
6.14 How attention helps models use context
============================================================
PART III — INSIDE A LARGE LANGUAGE MODEL
Transformer Architecture
7.1 Why transformers were introduced
7.2 The transformer architecture
7.3 Encoder-only, decoder-only, and encoder-decoder models
7.4 The role of embeddings and positional information
7.5 The self-attention block
7.6 Feed-forward neural networks
7.7 Residual connections
7.8 Layer normalization and RMSNorm
7.9 Stacking transformer layers
7.10 Vocabulary projection and output logits
7.11 Converting logits into probabilities
7.12 How GPT-style decoder-only models work
7.13 Model parameters vs input tokens vs activations
7.14 Model size, memory, and computational requirements
7.15 Mixture of Experts (MoE)
7.16 What happens inside a transformer when a prompt arrivesLLM Training and Learning
8.1 How training data is collected and prepared
8.2 Data cleaning, deduplication, and filtering
8.3 Pretraining and next-token prediction
8.4 Training examples and target tokens
8.5 Loss calculation and gradient descent
8.6 Backpropagation through transformer layers
8.7 Distributed training across GPUs
8.8 Pretraining vs post-training
8.9 Supervised fine-tuning (SFT)
8.10 Instruction tuning
8.11 Human feedback and Reinforcement Learning from Human Feedback (RLHF)
8.12 Direct Preference Optimization (DPO)
8.13 Reasoning-oriented post-training
8.14 Distillation and smaller models
8.15 Quantization and model compression
8.16 Open-weight vs closed-weight models
8.17 Why training a foundation model is expensiveInference and Text Generation
9.1 What is inference?
9.2 Training vs inference
9.3 Prompt → tokens → model → logits → generated tokens
9.4 Why text is generated one token at a time
9.5 Greedy decoding
9.6 Random sampling
9.7 Temperature
9.8 Top-k and top-p sampling
9.9 Maximum output tokens and stopping conditions
9.10 Streaming responses token by token
9.11 Prefill and decode phases
9.12 Key-Value (KV) caching
9.13 Time to first token and generation speed
9.14 Batch inference and continuous batching
9.15 Why the same prompt may produce different answers
9.16 Why LLMs can sound confident while being incorrectContext Windows and Model Memory
10.1 What is a context window?
10.2 System instructions, user messages, and conversation history
10.3 Input context vs generated output
10.4 Why context windows have limits
10.5 How long conversations consume tokens
10.6 Context truncation and summarization
10.7 Why an LLM does not automatically remember every past conversation
10.8 Conversation history vs persistent application memory
10.9 Short-term memory vs long-term memory in AI applications
10.10 Context engineering
============================================================
PART IV — USING LLMs THROUGH SOFTWARE APPLICATIONS
Model Providers and Model APIs
11.1 What is a model provider?
11.2 What is an inference endpoint?
11.3 Hosted APIs vs self-hosted models
11.4 API requests and responses
11.5 API keys, authentication, and authorization
11.6 HTTP, JSON, and streaming APIs
11.7 Chat completion and response-generation interfaces
11.8 System, developer, user, and assistant messages
11.9 Roles, message ordering, and conversation state
11.10 Structured outputs and JSON generation
11.11 Function calling and tool calling
11.12 Rate limits, quotas, and token limits
11.13 Retries, timeouts, and error handling
11.14 Model selection and model routing
11.15 API cost calculation
11.16 Provider lock-in and model portabilityThe Major LLM Ecosystem
12.1 OpenAI models and APIs
12.2 Anthropic Claude models and APIs
12.3 Google Gemini models and APIs
12.4 Meta Llama and open-weight models
12.5 Mistral and other model families
12.6 AWS Bedrock
12.7 Azure AI Foundry and managed model services
12.8 Hugging Face and the model ecosystem
12.9 Ollama and local model execution
12.10 vLLM and high-throughput model serving
12.11 Comparing hosted APIs, cloud platforms, and local models
12.12 Choosing a model based on quality, latency, privacy, and costPrompt Engineering
13.1 What is a prompt?
13.2 Why instructions influence generated responses
13.3 Zero-shot and few-shot prompting
13.4 System instructions and user prompts
13.5 Providing context and constraints
13.6 Role prompting and task specification
13.7 Delimiters and structured input
13.8 Output schemas and formatting requirements
13.9 Asking for reasoning vs requesting a concise answer
13.10 Prompt templates and reusable prompts
13.11 Prompt injection and malicious instructions
13.12 Why prompt engineering cannot replace reliable software controls
13.13 Prompt evaluation and regression testing
13.14 Prompt versioning and management
============================================================
PART V — WHY RAG EXISTS
The Problem of LLM Knowledge
14.1 What an LLM knows from training
14.2 Training knowledge vs current external information
14.3 Why a model cannot automatically see your company's database
14.4 Why changing a database does not update model weights
14.5 Hallucination and unsupported claims
14.6 Why a larger context window does not automatically solve retrieval
14.7 Fine-tuning vs supplying external information
14.8 Why applications need external knowledge sourcesRetrieval-Augmented Generation (RAG)
15.1 What is RAG?
15.2 Why RAG was developed
15.3 The RAG architecture
15.4 Offline indexing vs online query processing
15.5 Document ingestion
15.6 Parsing PDFs, Word files, HTML, and source code
15.7 Document cleaning and normalization
15.8 Chunking and why documents are split
15.9 Fixed-size, overlapping, semantic, and structure-aware chunking
15.10 Embedding models and document embeddings
15.11 Vector databases and vector indexes
15.12 Query embedding
15.13 Similarity search and top-k retrieval
15.14 Metadata filtering
15.15 Keyword search and BM25
15.16 Hybrid search: lexical + semantic retrieval
15.17 Reranking retrieved documents
15.18 Constructing the LLM context
15.19 Generating answers grounded in retrieved sources
15.20 Citations and source attribution
15.21 Why RAG can still produce incorrect answers
15.22 RAG failure modes: bad parsing, chunking, retrieval, and generation
15.23 Measuring retrieval quality and answer quality
15.24 RAG vs fine-tuning vs long-context prompting
15.25 When RAG is appropriate and when it is unnecessaryVector Databases and Search Infrastructure
16.1 What is a vector database?
16.2 Why a normal relational database is not always sufficient
16.3 Embedding storage and metadata storage
16.4 Exact nearest-neighbor search
16.5 Approximate nearest-neighbor search
16.6 HNSW and other vector indexing techniques
16.7 Cosine similarity, dot product, and Euclidean distance
16.8 PostgreSQL with pgvector
16.9 Dedicated vector databases
16.10 Elasticsearch and OpenSearch vector search
16.11 Vector search vs SQL queries
16.12 Choosing a vector storage system
16.13 Updates, deletions, re-indexing, and stale embeddings
16.14 Access control and tenant isolation in retrieval systemsAdvanced RAG
17.1 Query rewriting and query expansion
17.2 Multi-query retrieval
17.3 HyDE and hypothetical document embeddings
17.4 Parent-child chunk retrieval
17.5 Contextual retrieval
17.6 Recursive and hierarchical retrieval
17.7 Graph RAG and knowledge graphs
17.8 Agentic RAG
17.9 Multi-hop question answering
17.10 Corrective retrieval and fallback strategies
17.11 RAG caching
17.12 Incremental indexing and document synchronization
17.13 RAG evaluation using retrieval and generation metrics
============================================================
PART VI — WHY LANGCHAIN AND SIMILAR FRAMEWORKS EXIST
LLM Application Frameworks
18.1 The difference between an LLM API and an AI framework
18.2 What is LangChain?
18.3 Why LangChain was built
18.4 The problems of manually connecting LLM application components
18.5 Model adapters and provider integrations
18.6 Prompt templates
18.7 Output parsers
18.8 Chains and composing application steps
18.9 Runnable interfaces and composition
18.10 Document loaders and text splitters
18.11 Embeddings and retrievers
18.12 Tool definitions and tool execution
18.13 Memory and conversation history
18.14 Agents and agent execution
18.15 Callbacks, tracing, and observability
18.16 LangChain vs direct SDK calls
18.17 LangChain vs LangGraph
18.18 LangChain vs LlamaIndex
18.19 Framework abstractions, trade-offs, and lock-in
18.20 When not to use an LLM frameworkLangGraph and Stateful AI Workflows
19.1 Why linear chains are insufficient for complex workflows
19.2 Nodes, edges, and graph state
19.3 Conditional routing
19.4 Loops and iterative execution
19.5 Checkpointing and persistence
19.6 Interrupts and human approval
19.7 Resuming failed workflows
19.8 Durable execution vs ordinary prompt chaining
19.9 When to use LangGraph instead of a simple chain
19.10 State management and workflow observabilityOther Useful AI Frameworks and Libraries
20.1 Provider SDKs
20.2 Hugging Face Transformers
20.3 Sentence Transformers
20.4 DSPy and programmatic prompt optimization
20.5 LlamaIndex and knowledge-intensive applications
20.6 Semantic Kernel
20.7 Haystack
20.8 LiteLLM and multi-provider routing
20.9 Instructor and schema-constrained extraction
20.10 Comparing frameworks by abstraction and purpose
============================================================
PART VII — FUNCTION CALLING, TOOLS, AND MCP
Tool Calling
21.1 What is a tool in an AI application?
21.2 Why an LLM needs tools
21.3 The difference between generating text and executing an action
21.4 Function calling vs ordinary text generation
21.5 Tool schemas and parameter definitions
21.6 How the model selects a tool
21.7 The application executes the tool
21.8 Returning tool results to the model
21.9 Multi-step tool calling
21.10 Tool selection, validation, and error handling
21.11 Read-only tools vs state-changing tools
21.12 Idempotency and duplicate tool execution
21.13 Permissions, approvals, and dangerous actions
21.14 Why the model does not execute arbitrary functions by itselfUnderstanding Model Context Protocol (MCP)
22.1 What is MCP?
22.2 Why MCP was created
22.3 The integration problem MCP addresses
22.4 Traditional point-to-point integrations
22.5 Why every AI client otherwise needs custom integrations
22.6 The MCP architecture: host, client, and server
22.7 MCP servers and their responsibilities
22.8 MCP tools: actions an AI application can invoke
22.9 MCP resources: contextual data exposed to clients
22.10 MCP prompts: reusable prompt templates
22.11 How an MCP client discovers available capabilities
22.12 How tool schemas are exchanged
22.13 The lifecycle of an MCP request
22.14 JSON-RPC and message structure
22.15 stdio transport
22.16 Streamable HTTP transport
22.17 Authentication and authorization
22.18 Local MCP servers vs remote MCP servers
22.19 Building an MCP server
22.20 Connecting an MCP server to an AI client
22.21 MCP vs REST APIs
22.22 MCP vs function calling
22.23 MCP vs LangChain tools
22.24 MCP security, untrusted output, and prompt injection
22.25 When MCP is useful and when a direct API is simplerIntegrating Existing Systems Through MCP
23.1 Exposing database queries through controlled tools
23.2 Integrating GitHub, Jira, and Confluence
23.3 Connecting AI clients to internal documentation
23.4 Exposing monitoring and observability operations
23.5 Designing read-only and write-capable tools
23.6 Authentication propagation and user identity
23.7 Tool permissions and least privilege
23.8 Pagination, large responses, and result filtering
23.9 Timeouts, retries, and rate limiting
23.10 MCP server deployment and maintenance
23.11 When to build one shared server vs several specialized servers
============================================================
PART VIII — AI AGENTS AND AGENTIC SYSTEMS
What Is an AI Agent?
24.1 From a language model to an AI-powered application
24.2 What makes a system an agent?
24.3 Model, instructions, tools, state, and control loop
24.4 Observe → reason → act → observe
24.5 Agents vs chatbots
24.6 Agents vs deterministic workflows
24.7 Tool-using assistants vs autonomous agents
24.8 ReAct: reasoning and acting
24.9 Planning and task decomposition
24.10 Reflection and self-correction
24.11 Short-term and persistent agent memory
24.12 Agent stopping conditions and iteration limits
24.13 Why agent autonomy increases risk
24.14 When an agent is unnecessaryAgent Architecture and Execution
25.1 The agent control loop
25.2 Model-driven vs application-driven control flow
25.3 Tool registries and dynamic tool selection
25.4 Single-agent architecture
25.5 Multi-agent systems
25.6 Supervisor and specialist agents
25.7 Agent handoffs
25.8 Shared state and communication between agents
25.9 Task queues and asynchronous execution
25.10 Human-in-the-loop approvals
25.11 Checkpoints and recovery
25.12 Preventing infinite loops and runaway costs
25.13 Agent evaluation and reliability
25.14 Why multiple agents do not automatically produce better resultsAgentic Workflows and Automation
26.1 Deterministic workflow automation
26.2 LLM-powered workflow steps
26.3 Conditional branches and retries
26.4 LLMs as decision-making components
26.5 Temporal workflows and durable execution
26.6 Event-driven AI workflows
26.7 Scheduled agents and background tasks
26.8 Webhooks and external events
26.9 Long-running tasks and resumability
26.10 Human approval before consequential operations
26.11 Agents vs conventional automation platforms
26.12 Combining deterministic code with probabilistic decisions
============================================================
PART IX — AWS BEDROCK AND CLOUD AI INFRASTRUCTURE
Understanding Amazon Bedrock
27.1 What is Amazon Bedrock?
27.2 Why AWS built Bedrock
27.3 The difference between an LLM and Bedrock
27.4 The difference between a model provider and a cloud AI platform
27.5 Accessing multiple foundation models through managed APIs
27.6 Model IDs, inference profiles, and supported models
27.7 Bedrock Runtime and Converse APIs
27.8 Streaming model responses
27.9 IAM authentication and AWS SDK integration
27.10 On-demand inference and provisioned throughput
27.11 Model access, regional availability, and quotas
27.12 Pricing and token accounting
27.13 Data handling, privacy, and governance
27.14 Guardrails for Amazon Bedrock
27.15 Knowledge Bases for Amazon Bedrock
27.16 Agents for Amazon Bedrock
27.17 Model evaluation and customization
27.18 Bedrock vs calling a provider API directly
27.19 Bedrock vs SageMaker AI
27.20 When Bedrock is a sensible architectural choiceBuilding AI Applications on AWS
28.1 Backend service → Bedrock → model response
28.2 Calling Bedrock from Go
28.3 Calling Bedrock from Python
28.4 AWS SDKs and credential chains
28.5 IAM roles vs hard-coded access keys
28.6 API Gateway and Lambda for AI endpoints
28.7 ECS, EKS, and EC2 for AI application hosting
28.8 S3 as a document source
28.9 SQS and EventBridge for asynchronous AI workflows
28.10 DynamoDB, RDS, and OpenSearch integration
28.11 Secrets Manager and configuration
28.12 CloudWatch logs, metrics, and alarms
28.13 Network access, VPC endpoints, and private connectivity
28.14 Production deployment and cost controlManaged RAG and Managed Agents
29.1 Building RAG manually vs using a managed knowledge base
29.2 Document ingestion and synchronization
29.3 Chunking and embedding configuration
29.4 Vector-store integration
29.5 Retrieval configuration and citations
29.6 Managed agent orchestration
29.7 Action groups and API integration
29.8 Lambda-backed actions
29.9 Identity, permissions, and approval controls
29.10 Managed services vs application-owned orchestration
29.11 Cost, flexibility, and operational trade-offs
============================================================
PART X — FINE-TUNING, CUSTOM MODELS, AND LOCAL INFERENCE
Fine-Tuning and Model Adaptation
30.1 Why prompting alone may be insufficient
30.2 Fine-tuning vs pretraining
30.3 Supervised fine-tuning datasets
30.4 Instruction and conversation formatting
30.5 Full fine-tuning
30.6 Parameter-efficient fine-tuning
30.7 LoRA and QLoRA
30.8 Fine-tuning for classification, extraction, and style
30.9 Fine-tuning vs RAG
30.10 Data quality and overfitting
30.11 Evaluating a fine-tuned model
30.12 When fine-tuning is worth its costRunning Models Yourself
31.1 Hosted inference vs self-hosted inference
31.2 Open-weight models and model licenses
31.3 CPU vs GPU inference
31.4 VRAM and model memory requirements
31.5 Quantization: FP16, BF16, INT8, and INT4
31.6 Ollama for local development
31.7 Hugging Face Transformers for model execution
31.8 vLLM for production serving
31.9 Batching and KV-cache memory
31.10 Throughput, latency, and hardware utilization
31.11 Model deployment, upgrades, and monitoring
31.12 When self-hosting is economically justified
============================================================
PART XI — MULTIMODAL GENERATIVE AI
- Beyond Text 32.1 What is multimodal AI? 32.2 Text-only vs multimodal models 32.3 Image understanding and visual tokens 32.4 Vision encoders and image embeddings 32.5 Audio input and speech recognition 32.6 Speech generation and text-to-speech 32.7 Real-time audio conversations 32.8 Video understanding and temporal information 32.9 Document understanding and OCR 32.10 Image generation and diffusion models 32.11 Text-to-video generation 32.12 Cross-modal embeddings and retrieval 32.13 Multimodal RAG 32.14 Applications and limitations of multimodal systems
============================================================
PART XII — KNOWLEDGE GRAPHS, MEMORY, AND ADVANCED REASONING
Knowledge Graphs and Graph RAG
33.1 What is a knowledge graph?
33.2 Entities, relationships, and properties
33.3 Graph databases vs relational databases
33.4 Extracting entities and relationships using LLMs
33.5 Graph traversal and relationship-based retrieval
33.6 Combining graph search with vector search
33.7 Multi-hop questions and connected evidence
33.8 Graph RAG vs conventional RAGAI Memory and Personalization
34.1 Conversation history vs memory
34.2 Working memory and persistent memory
34.3 Summarization-based memory
34.4 Vector-based memory retrieval
34.5 Structured user profiles and relational storage
34.6 Memory extraction and updating
34.7 Forgetting, deletion, and data retention
34.8 Memory relevance and stale information
34.9 Privacy-aware personalization
34.10 Why memory is an application feature, not simply a model propertyReasoning and Planning
35.1 Pattern completion vs explicit problem solving
35.2 Reasoning-oriented models
35.3 Decomposition of complex tasks
35.4 Search, planning, and verification
35.5 External calculators and code execution
35.6 Self-consistency and candidate selection
35.7 Verifiers and independent checks
35.8 Retrieval-supported reasoning
35.9 Limits of model reasoning
35.10 Why important computations should be verified by deterministic code
============================================================
PART XIII — EVALUATION, SECURITY, AND PRODUCTION RELIABILITY
Evaluating Generative AI
36.1 Why ordinary unit tests are insufficient
36.2 Golden datasets and representative test cases
36.3 Exact-match and task-specific metrics
36.4 LLM-as-a-judge and its limitations
36.5 Human evaluation
36.6 Faithfulness, relevance, correctness, and completeness
36.7 RAG retrieval metrics: precision, recall, and ranking
36.8 Agent task-completion metrics
36.9 Tool-selection and tool-execution accuracy
36.10 Regression testing across model and prompt versions
36.11 Offline evaluation vs online evaluation
36.12 A/B testing and production feedback
36.13 Building an evaluation pipelineAI Security and Responsible AI
37.1 Prompt injection
37.2 Direct vs indirect prompt injection
37.3 Data leakage and sensitive information
37.4 Insecure tool execution
37.5 Excessive agent permissions
37.6 Malicious documents and retrieved content
37.7 RAG access-control failures
37.8 Output validation and schema enforcement
37.9 Sandboxed code execution
37.10 Authentication and authorization
37.11 Audit logs and approval workflows
37.12 Model refusal and safety guardrails
37.13 Bias, fairness, and harmful outputs
37.14 Data governance and retention
37.15 Defense in depth for AI systemsObservability and Production Operations
38.1 Why AI systems need observability
38.2 Request IDs and distributed tracing
38.3 Logging prompts, outputs, and tool calls safely
38.4 Token usage and cost tracking
38.5 Latency, throughput, and error rates
38.6 Time to first token and tokens per second
38.7 Model timeouts and retries
38.8 Rate limiting and concurrency control
38.9 Caching model responses
38.10 Semantic caching and its risks
38.11 Circuit breakers and provider fallbacks
38.12 Model routing and degradation strategies
38.13 Queue-based processing and backpressure
38.14 Streaming vs background execution
38.15 Monitoring quality regressions
38.16 Incident handling and operational runbooksAI Cost and Performance Engineering
39.1 Input-token vs output-token cost
39.2 Model selection by task complexity
39.3 Prompt and context minimization
39.4 RAG to reduce irrelevant context
39.5 Small models vs large models
39.6 Caching and request deduplication
39.7 Batch processing
39.8 Parallel tool calls
39.9 Latency budgets and end-to-end response time
39.10 Cost per successful task
39.11 Reliability vs cost trade-offs
39.12 Capacity planning for AI workloads
============================================================
PART XIV — ADVANCED AI APPLICATION ARCHITECTURE
Designing an AI Backend Service
40.1 Requirements and use-case definition
40.2 AI application boundaries
40.3 API gateway and authentication
40.4 Orchestration service
40.5 Model-provider abstraction
40.6 Prompt and configuration management
40.7 Retrieval service and vector storage
40.8 Tool execution service
40.9 Conversation and application-state storage
40.10 Queue-based long-running jobs
40.11 Rate limits, quotas, and tenant isolation
40.12 Data access and authorization
40.13 Failure handling and idempotency
40.14 Model and provider fallback
40.15 Deployment and observability
40.16 Scaling an AI application as a distributed systemAI Design Patterns
41.1 Direct model invocation
41.2 Prompt chaining
41.3 Routing
41.4 Parallelization
41.5 Retrieval-augmented generation
41.6 Tool-using agents
41.7 Evaluator-optimizer loops
41.8 Human-in-the-loop execution
41.9 Model gateway and provider abstraction
41.10 Semantic caching
41.11 Structured extraction pipelines
41.12 Event-driven AI processing
41.13 Choosing the simplest pattern that meets requirementsAI System Design
42.1 Design a company-document chatbot
42.2 Design a customer-support assistant
42.3 Design an AI-powered code assistant
42.4 Design an internal engineering knowledge assistant
42.5 Design a natural-language database interface
42.6 Design an invoice and financial-document extraction system
42.7 Design an AI-powered log-analysis system
42.8 Design a tool-using operations agent
42.9 Design a multi-tenant RAG platform
42.10 Design an MCP server platform
42.11 Design a scalable AI gateway
42.12 Design an asynchronous agent execution platform
42.13 Capacity, cost, consistency, and security trade-offs
============================================================
PART XV — HANDS-ON PROJECTS: LEARN BY BUILDING
Project 1: Direct LLM Integration
Build a Go or Python API that accepts a question, calls an LLM,
streams the answer, and records latency, token usage, and errors.Project 2: Structured Data Extraction
Extract invoice fields into a validated JSON schema.
Handle missing fields, invalid outputs, retries, and test cases.Project 3: Document Chatbot Using RAG
Upload PDFs, parse documents, chunk the text, generate embeddings,
store vectors, retrieve relevant passages, and answer with citations.Project 4: Production-Style RAG
Add hybrid search, reranking, metadata filters, access control,
document updates, evaluation datasets, and observability.Project 5: MCP Server
Build an MCP server exposing a safe read-only tool, such as searching
internal documentation. Connect it to a compatible MCP client and
inspect discovery, tool calls, responses, and error handling.Project 6: Tool-Using AI Assistant
Build an assistant that can call a database query tool and a
documentation search tool. Validate arguments and enforce permissions.Project 7: Workflow-Based AI Application
Build a deterministic workflow with model-based classification,
conditional routing, retries, persistent state, and human approval.Project 8: AI Agent
Build an agent that plans a bounded task, invokes approved tools,
observes results, and stops when the task is complete or its budget
is exhausted.Project 9: AWS Bedrock Application
Deploy an API using Go or Python, call a Bedrock model through the
AWS SDK, configure IAM, store application data, and monitor costs.Project 10: Production AI Platform
Combine model routing, RAG, MCP, background jobs, evaluation,
security controls, tracing, cost budgets, and failure recovery.


