On this page
This post goes with a hands-on video on the LevelUP I.T. YouTube channel. It builds retrieval augmented generation (RAG) from first principles and then runs it for real: a "lab copilot" that answers questions about the F5 series' own lab guides, deployed as three replicas behind a BIG-IP virtual server, with a health monitor, least-connections load balancing, caching and failure handling. Every script below is the exact code typed in the video's labs, and every result quoted is what it printed.
The whole system in one picture
A RAG system has two halves that run at different times. Ingestion runs before anyone asks anything, and again when documents change: load the documents, clean them, split them into chunks, embed every chunk into a vector, store the vectors in an index. The query path runs for every question: embed the question with the same model, find the nearest chunks, put them into a prompt with the question, let the language model generate the answer, return it with its sources.

What you'll find here
- RAG in one picture, and when prompt engineering or fine-tuning is the better tool.
- Keyword search: grep, TF-IDF and BM25, with the arithmetic, and lab 1.
- Embeddings, contrastive training, task prefixes, and the dot product and cosine similarity by hand, with lab 2.
- Vector databases: brute force, HNSW and IVF, memory sizing, and lab 3 with Chroma.
- Chunking: the truncation problem, overlap, recursive splitting, metadata, and lab 4.
- The complete pipeline and the grounded prompt, lab 5.
- Deploying it behind a BIG-IP: monitor, pool, least connections, the request path, lab 6.
- Caching, monitoring and error handling, measured on the lab; and what production adds.