Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Building Natural Language and LLM Pipelines
Building Natural Language and LLM Pipelines

Building Natural Language and LLM Pipelines: Build production-grade RAG, tool contracts, and context engineering with Haystack and LangGraph

Arrow left icon
Profile Icon Laura Funderburk
Arrow right icon
€20.99 €29.99
eBook Dec 2025 338 pages 1st Edition
eBook
€20.99 €29.99
Paperback
€30.39 €37.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Laura Funderburk
Arrow right icon
€20.99 €29.99
eBook Dec 2025 338 pages 1st Edition
eBook
€20.99 €29.99
Paperback
€30.39 €37.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.99 €29.99
Paperback
€30.39 €37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Building Natural Language and LLM Pipelines

1

Introduction to Natural Language Processing Pipelines

In classic data science, designing and implementing data pipelines is crucial for ensuring that businesses and the public can obtain reliable insights into data. Data pipelines allow us to extract information systematically and then process it for further consumption. With the advent of natural language processing (NLP) and the emergence of large language models (LLMs), we can now process heaps of unstructured data, such as text, audio, and images.

This paradigm shift has unlocked remarkable capabilities, but as we enter 2026, the industry is at a critical inflection point. The era of pure experimentation with LLMs and agents is over. Enterprises and users are no longer asking, “Can AI do this?” but rather, “Can this AI be trusted?” As organizations move to scale AI agents from siloed pilots to enterprise-wide workflows, the focus has drastically shifted from raw performance to decision reliability...

What are data pipelines and what is their role in agentic applications?

Broadly speaking, data pipelines are a set of processes that extract and move data from one system to another, usually transforming it in the process. The key stages in data pipelines include data collection, data processing, data storage, data analysis, data modeling, and serving the results. They enable a systematic way to automate the flow of data, with the end goal of transforming raw information into a format suitable for extracting insights. Processed data may be served in various formats, such as a dashboard, a report, forecasting analysis, or even applications.

To place data pipelines in a broader architectural context, we can reference the principles of a data mesh. A data mesh addresses the complexities of managing data at scale by focusing on four key principles:

  • Domain-oriented decentralized data ownership: Data is managed by those closest to it, ensuring that the specialized pipelines...

Text as data - an overview of text-processing techniques

Text is one of the most abundant and rich sources of data. We can obtain data in the form of text from a variety of sources, such as social media posts, online reviews, research papers, corporate documentation, news articles, and web-browsing results. However, unlike structured data, which can fit into tables and schemas, text data is inherently unstructured. To get insights from text, we must transform it into a format that an LLM can process, for example, by chunking it (also known as tokenization) and using an embedding model to vectorize it. Once the text has been transformed, we can use it for applications such as translation, sentiment analysis, topic modeling, information retrieval (Q&A systems, for example), and text classification.

Overview of text-processing techniques

Before text can be stored in a database or used in conjunction with a machine learning algorithm or LLM, we must first preprocess it. Preprocessing...

Key components in data, NLP, and LLM pipelines

Data pipelines serve as structured pathways that guide raw data through various stages of transformation, with the end goal of leading to actionable insights. A data pipeline can be tailored to meet specific goals while ensuring that the data is processed, analyzed, and formatted for presentation efficiently. This section will show the evolutionary path of these pipelines, from classic data processing to the modern agentic systems that are the focus of this book.

Classic data and NLP pipelines (the foundation)

As a broad overview, a general data pipeline involves ingesting data from sources such as APIs, IoT devices, or files, processing it, and storing it in databases or data warehouses. This data is then used for analysis, reporting, and visualization. This flow is visualized in Figure 1.1.

Image 1

Figure 1.1 – Stages in a general data pipeline

Tools and algorithms are then applied to the processed data to derive...

The 2025 agentic pipeline – the MLOps/AgentOps life cycle

The generative AI project life cycle of the past was often a linear process: from problem scoping to final deployment. In 2025 and beyond, this has been replaced by a continuous MLOps/LLMOps/AgentOps loop, where production systems are constantly evaluated, improved, and redeployed.

This book is structured to show you how to move beyond the it works on my machine stage of development by teaching you to solve for reliability, scalability, and security at the enterprise level:

  • Reliability and feedback: In Chapter 5 and Chapter 6, we will introduce a systematic approach to evaluate and measure RAG pipelines. In Chapter 9, we will explore how to improve agentic systems through context engineering and how to enable observability of agents through LangGraph and LangSmith.
  • Scalability and deployment: In Chapter 7, we will learn how to serialize our pipelines into a fully containerized (Docker) microservice...

Summary

Data pipelines consist of a series of systematic steps that process data from a raw format into a format that can be used and consumed by a variety of users. In the modern era, these pipelines are evolving from simple, linear flows for human-readable analytics into the foundational reliability layer for sophisticated AI agents.

We explored the evolutionary path of these systems: from general data pipelines and classic NLP pipelines to modern LLM-augmented pipelines. A common denominator in all these cases is the presence of rigorous data source identification, cleaning, and preprocessing. For NLP and LLM pipelines, crucial steps include tokenization (breaking down words) and embeddings (constructing numerical representations).

As we move into 2026, the design of these pipelines is shifting to solve new, complex challenges. We must now account for reliability, scalability, cost-effectiveness, and security in a world of interoperable, autonomous agents.

This book...

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Design reproducible LLM pipelines using typed components and strict tool contracts
  • Build resilient multi-agent systems with LangGraph and modular microservices
  • Evaluate and monitor pipeline performance with Ragas and Weights & Biases

Description

Modern LLM applications often break in production due to brittle pipelines, loose tool definitions, and noisy context. This book shows you how to build production-ready, context-aware systems using Haystack and LangGraph. You’ll learn to design deterministic pipelines with strict tool contracts and deploy them as microservices. Through structured context engineering, you’ll orchestrate reliable agent workflows and move beyond simple prompt-based interactions. You'll start by understanding LLM behavior—tokens, embeddings, and transformer models—and see how prompt engineering has evolved into a full context engineering discipline. Then, you'll build retrieval-augmented generation (RAG) pipelines with retrievers, rankers, and custom components using Haystack’s graph-based architecture. You’ll also create knowledge graphs, synthesize unstructured data, and evaluate system behavior using Ragas and Weights & Biases. In LangGraph, you’ll orchestrate agents with supervisor-worker patterns, typed state machines, retries, fallbacks, and safety guardrails. By the end of the book, you’ll have the skills to design scalable, testable LLM pipelines and multi-agent systems that remain robust as the AI ecosystem evolves. *Email sign-up and proof of purchase required

Who is this book for?

LLM engineers, NLP developers, and data scientists looking to build production-grade pipelines, agentic workflows, or RAG systems. Ideal for tech leads looking to move beyond prototypes to scalable, testable solutions, as well as teams modernizing legacy NLP pipelines into orchestration-ready microservices. Proficiency in Python and familiarity with core NLP concepts are recommended.

What you will learn

  • Build structured retrieval pipelines with Haystack
  • Apply context engineering to improve agent performance
  • Serve pipelines as LangGraph-compatible microservices
  • Use LangGraph to orchestrate multi-agent workflows
  • Deploy REST APIs using FastAPI and Hayhooks
  • Track cost and quality with Ragas and Weights & Biases
  • Implement retries, circuit breakers, and observability
  • Design sovereign agents for high-volume local execution

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 30, 2025
Length: 338 pages
Edition : 1st
Language : English
ISBN-13 : 9781835467008
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 30, 2025
Length: 338 pages
Edition : 1st
Language : English
ISBN-13 : 9781835467008
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Table of Contents

16 Chapters
Part 1: The Foundation of Reliable AI Chevron down icon Chevron up icon
Chapter 1: Introduction to Natural Language Processing Pipelines Chevron down icon Chevron up icon
Chapter 2: Diving Deep into Large Language Models Chevron down icon Chevron up icon
Part 2: Building The Tool Layer with Haystack Chevron down icon Chevron up icon
Chapter 3: Introduction to Haystack by deepset Chevron down icon Chevron up icon
Chapter 4: Bringing Components Together – Haystack Pipelines for Different Use Cases Chevron down icon Chevron up icon
Chapter 5: Haystack Pipeline Development with Custom Components Chevron down icon Chevron up icon
Chapter 6: Building Reproducible and Production-Ready RAG Systems Chevron down icon Chevron up icon
Part 3: Deployment and Agentic Orchestration Chevron down icon Chevron up icon
Chapter 7: Deploying Haystack-Based Applications Chevron down icon Chevron up icon
Chapter 8: Hands-On Projects Chevron down icon Chevron up icon
Part 4: The Future of Agentic AI Chevron down icon Chevron up icon
Chapter 9: Future Trends and Beyond Chevron down icon Chevron up icon
Chapter 10: Epilogue: The Architecture of Agentic AI Chevron down icon Chevron up icon
Chapter 11: Unlock Your Exclusive Benefits Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon