Skip to content

Part IV — Prompt Engineering & RAG Fundamentals

From writing effective prompts to building a foundational RAG application.

Prompt Engineering & RAG Fundamentals Banner

Overview

Building an LLM application involves more than sending a prompt and displaying the response. Applications need clear instructions, predictable output formats, access to relevant information and a way to connect model capabilities to software.

This part develops those foundations step by step. It begins with prompt engineering and structured outputs, moves through embeddings, document processing and vector search, and brings these components together in a basic Retrieval-Augmented Generation (RAG) application.

The final chapters introduce two ways to expose an AI capability: an interactive interface with Gradio and a programmatic API with Flask.

Frameworks such as LangChain and LlamaIndex may appear in examples, but their architecture and dedicated implementation tracks are covered in Part VIII — AI Engineering Frameworks & Tooling. Advanced retrieval techniques are covered in Part V — Advanced RAG.

What you'll learn

By completing this part, you will be able to:

  • Design prompts using common prompting patterns.
  • Work with structured model outputs and function/tool calling.
  • Generate embeddings and understand semantic similarity.
  • Process documents and choose practical chunking strategies.
  • Understand vector databases and similarity search.
  • Build and evaluate a foundational RAG pipeline.
  • Recognise the main components of an enterprise LLM application.
  • Expose an AI capability through a Gradio interface or Flask API.

Learning path

flowchart LR
    A["Prompt Engineering"] --> B["Structured Outputs & Tool Calling"]
    B --> C["Embeddings"]
    C --> D["Document Processing & Chunking"]
    D --> E["Vector Databases & Search"]
    E --> F["RAG Pipeline"]
    F --> G["Basic Evaluation"]
    G --> H["AI Application Architecture"]
    H --> I["Gradio Interface / Flask API"]

Chapter map

1. Prompt engineering and LLM interaction

Chapter Topic
01 Introduction to Prompt Engineering
02 Prompt Engineering Fundamentals
03 Advanced Prompt Engineering
04 Prompt Design Patterns
05 Zero-shot, One-shot & Few-shot Prompting
06 Chain-of-Thought (CoT) Prompting
07 ReAct Prompting
08 Structured Outputs & Output Parsing
09 Function Calling & Tool Calling
Chapter Topic
10 Embeddings in Practice
11 Document Processing & Vectorization
12 Document Chunking Strategies
13 Vector Database Fundamentals
14 Similarity Search Techniques

3. RAG Fundamentals

Chapter Topic
15 RAG Pipeline Components
16 Retrieval & Generation Pipeline
17 Vector Databases in RAG
18 Building Your First RAG Pipeline
19 RAG Evaluation Fundamentals

4. Enterprise AI Application & deployment

Chapter Topic
20 Enterprise Generative AI Application Architecture
21 Deploying AI Applications with Gradio
22 Deploying AI Applications with Flask

Where this part fits

Part IV establishes the building blocks for LLM applications and basic RAG. The next stages of the handbook build on these foundations:

  • Part V — Advanced RAG: improves retrieval quality, context selection, evaluation and production RAG design.
  • Part VI — AI Agents: explores individual agents, their tools, reasoning, memory and execution.
  • Part VII — Agentic AI & Multi-Agent Systems: covers agent collaboration, orchestration and multi-agent architectures.
  • Part VIII — AI Engineering Frameworks & Tooling: explores practical framework and protocol implementations.

Start here

Begin with 01. Introduction to Prompt Engineering, then follow the chapter sequence. Each topic builds toward creating an LLM application that can retrieve relevant knowledge and expose its capabilities through an interface or API.


Enterprise AI Engineering Handbook

Building Production-Grade Enterprise AI Systems — One Chapter at a Time.