15 Building a QA agent with LangGraph
This chapter covers
- Implementing the expert-emulated approach
- Practical example of investigation through question answering
- How to adapt and improve the system
In this chapter, we'll create a practical application for querying knowledge graphs using large language models. Drawing together the concepts and techniques explored in chapter 14 - visualized in the mental model in figure 15.1 - we'll demonstrate how to build an integrated solution. Using LangGraph as our orchestration framework, we'll show how each stage can be combined into a seamless pipeline. To make this accessible and user-friendly, we will use Streamlit as a front-end interface.
Figure 15.1 Overview of the system architecture introduced in the previous chapter. We'll implement this using Streamlit to handle user input (questions and user selection) and output (visualization and summaries), while LangGraph will orchestrate the core pipeline.

For hands-on learning, this chapter is accompanied by a code repository containing the complete implementation and configuration files, allowing you to easily follow along and reference the code as we progress through the concepts.