A deployment-ready, Dockerized agentic AI chatbot built with LangGraph, LangChain, Streamlit, and an OpenAI-compatible LLM API.
The application supports multi-turn conversations, external tool usage, PDF-based Retrieval-Augmented Generation (RAG), persistent conversation memory, streaming responses, and human-in-the-loop approval for sensitive actions.
text-embedding-3-large embeddings ┌─────────────────────┐
│ User │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Streamlit Frontend │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ LangGraph Agent │
└──────────┬──────────┘
│
┌─────────────────────┼─────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ LLM │ │ External Tools│ │ PDF RAG │
│ OpenAI-style │ │ │ │ │
└───────────────┘ │ Tavily Search │ │ PDF Loader │
│ Weather API │ │ Chunking │
│ Stock API │ │ Embeddings │
│ Calculator │ │ FAISS │
└───────────────┘ └───────────────┘
│
▼
┌──────────────────┐
│ Human Approval │
│ Interrupt/Resume │
└──────────────────┘
Pull the latest image from Docker Hub:
docker pull meisam19/agentic-chatbot-langgraph:latest
To use a specific version:
docker pull meisam19/agentic-chatbot-langgraph:1.0
The Docker image does not contain API keys or private credentials.
Create a local .env file with your own configuration:
OPENAI_API_KEY=your_openai_api_key
BASE_URL=your_openai_compatible_base_url
TAVILY_API_KEY=your_tavily_api_key
OPENWEATHER_API_KEY=your_openweather_api_key
Depending on your setup, additional environment variables may also be required.
Do not add spaces around = in the .env file.
Correct:
OPENAI_API_KEY=my_key
Incorrect:
OPENAI_API_KEY = "my_key"
Run the application using your .env file:
docker run --rm \
--env-file .env \
-e PORT=8501 \
-p 8501:8501 \
meisam19/agentic-chatbot-langgraph:latest
On Windows PowerShell:
docker run --rm --env-file .env -e PORT=8501 -p 8501:8501 meisam19/agentic-chatbot-langgraph:latest
Then open:
http://localhost:8501
To run the chatbot in the background:
docker run -d \
--name agentic-chatbot \
--env-file .env \
-e PORT=8501 \
-p 8501:8501 \
meisam19/agentic-chatbot-langgraph:latest
View the running container:
docker ps
View application logs:
docker logs -f agentic-chatbot
Stop the application:
docker stop agentic-chatbot
Remove the container:
docker rm agentic-chatbot
The application supports PDF-based question answering.
Users can upload a PDF directly from the Streamlit chat interface.
The RAG pipeline performs the following steps:
text-embedding-3-largeThe simplified RAG architecture is:
PDF
│
▼
PyPDFLoader
│
▼
Text Chunking
│
▼
OpenAI Embeddings
│
▼
FAISS Vector Store
│
▼
Similarity Retrieval
│
▼
LangGraph Agent
│
▼
LLM Response
The LangGraph agent can dynamically decide when external tools are required.
Available tools include:
Uses Tavily Search for recent or external information.
Typical use cases:
Provides controlled mathematical calculation support.
Example:
sqrt(16)
10 * 5
2 + 2
Retrieves current weather information using the OpenWeather API.
Example queries:
What is the weather in Berlin?
What is the current temperature in London?
Retrieves current stock market information.
Example:
What is the current price of AAPL?
Retrieves relevant information from uploaded PDF documents.
Example:
Summarize the main result of the uploaded paper.
The chatbot contains a human-in-the-loop workflow implemented using LangGraph interrupts.
Sensitive actions can pause graph execution and wait for explicit user approval.
For example:
User
│
│ "Buy 10 shares of AAPL"
▼
LangGraph Agent
│
▼
purchase_stock tool
│
▼
LangGraph interrupt()
│
▼
Human Approval Required
│
├── Approve
│
└── Reject
│
▼
Graph resumes execution
This demonstrates how agentic systems can combine autonomous reasoning with explicit human control.
The chatbot uses a LangGraph checkpoint system backed by SQLite.
Each conversation receives a unique thread ID.
This enables:
The frontend streams assistant responses incrementally using Streamlit.
This provides a more responsive user experience compared with waiting for the complete model response.
The interface also displays tool activity during execution.
Example:
Using search_tool...
Using get_current_weather...
Waiting for human approval...
Available image tags include:
latest
1.0
For normal use:
docker pull meisam19/agentic-chatbot-langgraph:latest
For reproducible environments, use a fixed version:
docker pull meisam19/agentic-chatbot-langgraph:1.0
Using a fixed version is recommended for production and reproducible deployments because the latest tag may change over time.
The application is distributed as a Docker image.
Source Code
│
▼
Dockerfile
│
▼
docker build
│
▼
Docker Image
│
▼
Docker Hub
│
▼
docker pull
│
▼
Docker Container
│
▼
Streamlit Application
API keys and credentials are not included in the Docker image.
Users must provide their own secrets at runtime.
Recommended practices:
.env files to GitHub.env files in Docker imagesA recommended .dockerignore configuration includes:
.env
.git/
__pycache__/
*.pyc
.venv/
venv/
Agentic-Chatbot-with-LangGraph/
│
├── app_professional.py
├── backend_professional.py
├── requirements.txt
├── Dockerfile
├── .dockerignore
├── .gitignore
├── README.md
└── LICENSE
This project can be used as a reference implementation for:
The full source code is available on GitHub:
https://github.com/mghasemi19/Agentic-Chatbot-with-LangGraph
Docker image:
https://hub.docker.com/r/meisam19/agentic-chatbot-langgraph
docker pull meisam19/agentic-chatbot-langgraph:latest
.envOPENAI_API_KEY=your_openai_api_key
BASE_URL=your_openai_compatible_base_url
TAVILY_API_KEY=your_tavily_api_key
OPENWEATHER_API_KEY=your_openweather_api_key
docker run --rm \
--env-file .env \
-e PORT=8501 \
-p 8501:8501 \
meisam19/agentic-chatbot-langgraph:latest
http://localhost:8501
This project is distributed under the license provided in the GitHub repository.
See the LICENSE file for details.
Content type
Image
Digest
sha256:561bf7d9b…
Size
3.3 GB
Last updated
about 2 months ago
docker pull meisam19/agentic-chatbot-langgraph