Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/NirDiamant/agents-towards-production/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through cloning the repository and running the LangGraph stateful workflow tutorial — a three-step text analysis pipeline that classifies, extracts entities from, and summarizes any text you give it. The same steps apply to every other tutorial in the repo.

Prerequisites

Before you start, make sure you have the following installed:
  • Python 3.9 or higher — run python --version to check
  • pip — comes with Python; run pip --version to confirm
  • Jupyterpip install notebook if you do not have it
  • git — run git --version to check
  • An OpenAI API key — get one at platform.openai.com

Run the LangGraph tutorial

1

Clone the repository

Open a terminal and run:
git clone https://github.com/NirDiamant/agents-towards-production.git
cd agents-towards-production
2

Navigate to the tutorial directory

Each tutorial lives in its own folder under tutorials/. For this example, navigate to the LangGraph tutorial:
cd tutorials/LangGraph-agent
You will find the following files:
tutorials/LangGraph-agent/
├── README.md
├── langgraph_tutorial.ipynb
└── requirements.txt
3

Create a virtual environment (recommended)

python -m venv .venv
source .venv/bin/activate   # On Windows: .venv\Scripts\activate
4

Install dependencies

pip install -r requirements.txt
If there is no requirements.txt in this tutorial, install the packages directly:
pip install langgraph langchain langchain-openai python-dotenv
5

Set your API key

Create a .env file in the tutorial directory with your OpenAI API key:
echo "OPENAI_API_KEY=your-key-here" > .env
Never commit your .env file to version control. The repository’s .gitignore already excludes it.
6

Launch the notebook

jupyter notebook langgraph_tutorial.ipynb
Your browser will open. Click Run All from the Cell menu, or run each cell individually with Shift+Enter.

What the LangGraph tutorial does

The notebook builds a three-node stateful pipeline that processes text through sequential stages. Each stage operates as an independent node in a directed graph.
from typing import TypedDict, List
from langgraph.graph import StateGraph, END
from langchain_openai import ChatOpenAI

class State(TypedDict):
    text: str
    classification: str
    entities: List[str]
    summary: str

# Use temperature=0 for deterministic outputs
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)

Running a different tutorial

The same steps apply to every tutorial in the repository. Navigate to the tutorial directory, install its requirements.txt, and run its notebook or app.py.
cd tutorials/agent-memory-with-redis
pip install -r requirements.txt
jupyter notebook *.ipynb
Read the README.md inside each tutorial folder first. It explains what the tutorial covers, what credentials you need, and any service-specific setup steps.

Next steps

Architecture overview

Understand how the tutorials fit together into a complete production agent stack.

All tutorials

Browse all 22 tutorials and choose the component you want to tackle next.

Build docs developers (and LLMs) love