The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...

Build semantic search, test it with pytest, and gate every change in CI: a four-book path to RAG and LLM applications you can trust in production.
Bought separately
$28.97
Minimum price
$5.00
$7.00
About the Bundle
Reliable RAG & LLM Testing Bundle brings together four practical books that take you from building a retrieval system to proving that it keeps working.
Building a RAG application is easy. Making it reliable is not. A small change to a prompt, a model version, or a knowledge base can quietly make answers worse, and traditional unit tests will not tell you. This bundle gives you the full path: build the retrieval layer, learn the testing tools, automate them in CI, and apply them to real LLM and RAG pipelines.
WHAT'S INSIDE
WHO THIS BUNDLE IS FOR
You do not need to be a machine learning expert. You should be comfortable with Python and basic testing concepts.
WHAT YOU WILL BE ABLE TO DO
Build semantic search, test it with pytest, and gate every change in CI. A four-book path to RAG and LLM applications you can trust in production.
Learn to build, test, and ship reliable RAG apps: semantic search from scratch, pytest, CI with GitHub Actions, and testing LLM and RAG pipelines in Python.
RAG testing, LLM testing, pytest, Python testing, semantic search, retrieval evaluation, Precision@k, Recall@k, grounding, hallucination detection, evaluation datasets, regression testing, GitHub Actions, CI quality gates, LLM reliability, AI engineering, Python
WHY A BUNDLE
The books are designed to be read in order, and they reinforce each other. The search book shows how retrieval works, the pytest and CI books teach the tools, and the testing book puts everything together for LLM and RAG applications.
Readers who buy the bundle receive all future updates to the books in it.
About the Books
LLM and RAG applications can fail in ways that traditional unit tests do not catch. A retrieval system may return the wrong documents, a context builder may truncate important evidence, and a model may produce a confident answer that is not supported by its sources.
Testing LLM & RAG Applications with Python gives you a practical workflow for testing AI systems from retrieval to final answer. You will build tests with pytest, evaluate retrieval quality, check whether answers are grounded in their sources, create reusable evaluation datasets, and add automated quality gates with GitHub Actions.
You will learn how to:
- Write unit and integration tests for LLM and RAG pipelines using pytest
- Evaluate retrieval quality with metrics such as recall@k and precision@k
- Test whether generated answers are grounded in retrieved sources
- Build reusable evaluation datasets for prompts, retrieval, and end-to-end flows
- Use GitHub Actions to run quality gates before merging changes
- Detect regressions in accuracy, latency, and cost before they reach users
This book is for Python developers, data scientists, and AI engineers building applications that use LLMs, RAG, or semantic search. You do not need to be a machine-learning expert, but you should be comfortable with Python and basic testing concepts.
Python Testing with pytest is a practical guide to building reliable Python software through automated testing.
Writing code that works is only the beginning. As projects grow, refactoring, new features, and changing requirements can introduce unexpected regressions. A well-designed test suite provides the safety net developers need to change their code with confidence.
This capsule introduces pytest from the ground up and gradually moves toward the practices used in real-world Python projects.
You will learn how to write clear and focused tests, use assertions effectively, test normal and edge-case behavior, verify exceptions, organize test code, understand pytest output, and build a repeatable testing workflow.
The book also introduces the principles behind Arrange–Act–Assert, reusable testing patterns, parametrization, fixtures, test organization, code coverage, continuous integration, and professional testing practices.
Rather than treating testing as an afterthought, this book presents it as an essential part of software development.
Whether you are a Python developer, a student learning software engineering, or a developer moving from small scripts toward larger applications, this capsule gives you a practical foundation for writing software that is easier to maintain, refactor, and trust.
Learn the tools. Understand the principles. Build with confidence.
Ahmed Adawy Tech Capsules
Practical engineering knowledge, one focused capsule at a time.
GitHub Actions for Python Projects is a practical, developer-focused guide to automating Python project workflows with GitHub Actions. Instead of treating CI/CD as abstract DevOps theory, this technical capsule focuses on the workflow concepts developers actually need when building and maintaining real Python projects. You will work through practical examples covering automated testing, code coverage, documentation builds, artifact generation, and deployment-oriented workflows. The goal is not simply to explain GitHub Actions, but to show how its components fit together into a reliable and maintainable automation workflow. You will learn: 1. How GitHub Actions workflows are structured 2. How to configure Python environments in CI 3. How to install and manage project dependencies 4. How to automate testing with pytest 5. How to generate and use test coverage reports 6. How to build project documentation automatically 7. How to upload and preserve workflow artifacts 8. How to organize jobs and steps effectively 9. How to design a practical workflow execution order 10. How to build reusable CI patterns for real Python projects Whether you are building a small Python project, maintaining an open-source repository, or moving toward a more professional CI/CD workflow, this capsule provides a concise and practical foundation for integrating automation into your development process. The focus throughout the capsule is on implementation, workflow design, and reusable engineering patterns rather than lengthy theoretical discussions. A compact technical guide for developers who want to move from manually running project tasks to building reliable, automated workflows with GitHub Actions.
Modern AI systems retrieve information by meaning rather than exact keyword matches. Under the hood, this capability relies on a surprisingly simple foundation: representing text as vectors, measuring similarity, and ranking results.
In Semantic Search from Scratch, you will build this core mechanism yourself from first principles using only Python and NumPy.
We deliberately avoid third-party vector databases, machine-learning frameworks, and high-level retrieval libraries. The goal isn't to build a production platform, but to demystify the mathematical mechanics behind semantic retrieval, vector spaces, and Retrieval-Augmented Generation (RAG).
What You Will Learn & Build:
Who Is This Capsule For?
This guide is designed for intermediate Python developers, AI engineers, and curiosity-driven builders who want to peel back the layers of high-level AI libraries and truly understand how semantic search works under the hood.
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.