---
title: langgraph-support-agent
colorFrom: blue
colorTo: indigo
sdk: docker
---
π€ LangGraph Support Agent Studio
[](https://www.python.org/)
[](https://flask.palletsprojects.com/)
[](https://langchain-ai.github.io/langgraph/)
[](https://www.docker.com/)
[](https://huggingface.co/mnoorchenar/spaces)
[](#)
**π€ LangGraph Support Agent Studio** β A production-grade multi-turn customer support agent built with LangGraph's ReAct architecture, powered entirely by free HuggingFace Inference API models, with live graph tracing, tool call logging, and session analytics streamed in real time via SSE.
---
## β¨ Features
| π§ ReAct Agent Loop | LangGraph StateGraph orchestrates Thought β Action β Observation with up to 4 tool calls per turn, parsed from free-tier HuggingFace model output |
| π§ 5 Live Tools | search_faq, check_order_status, create_ticket, get_product_info, escalate_to_human β each with real logic and mock data |
| πΊοΈ Live Graph Trace | Animated node visualizer showing Router β Agent β Tool Executor β Responder with per-node timing via SSE |
| π‘ Token Streaming | Server-Sent Events stream LLM tokens and graph events simultaneously, updating chat, trace, and tool log in real time |
| π Secure by Design | HF_TOKEN injected via HuggingFace Space secrets, never committed to source. All state is in-memory per session |
| π³ Containerized Deployment | Docker-first with gunicorn gthread workers, HuggingFace Spaces-compatible (uid 1000, port 7860) |
## ποΈ Architecture
```
Browser (SSE) ββββΆ Flask + gunicorn
β
LangGraph StateGraph
ββββββββββββββββββββ
β Router β Agent β
β β β β
β Tool Exec ββ β
β β β
β Responder β END β
ββββββββββββββββββββ
β
HuggingFace Inference API
Mistral 7B Β· Zephyr 7B Β· Phi-3 Β· Llama 3
```
## π Getting Started
```bash
git clone https://github.com/mnoorchenar/langgraph-support-agent.git
cd langgraph-support-agent
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add your HF_TOKEN
python app.py # open http://localhost:7860
```
## π³ Docker
```bash
docker build -t langgraph-support-agent .
docker run -p 7860:7860 -e HF_TOKEN=hf_your_token_here langgraph-support-agent
```
For HuggingFace Spaces: push this repo and add `HF_TOKEN` as a Space secret under **Settings β Variables and Secrets**.
## π Dashboard Modules
| Module | Description | Status |
|--------|-------------|--------|
| π¬ Chat Interface | Multi-turn streaming chat with SSE token delivery | β
Live |
| πΊοΈ Graph Trace | Animated LangGraph node visualizer with per-node timing | β
Live |
| π οΈ Tool Call Log | Expandable log of every tool invocation with input/output | β
Live |
| π Session Analytics | Chart.js charts β tool usage frequency and latency history | β
Live |
| π Conversation History | Full chat history with timestamps and estimated token counts | β
Live |
| π€ Model Selector | Switch between 4 HuggingFace-hosted LLMs mid-session | β
Live |
## π§ ML Models
```python
models = {
"mistral": "mistralai/Mistral-7B-Instruct-v0.3",
"zephyr": "HuggingFaceH4/zephyr-7b-beta",
"phi3": "microsoft/Phi-3-mini-4k-instruct",
"llama3": "meta-llama/Meta-Llama-3-8B-Instruct",
}
agent_type = "ReAct (Reason + Act)"
tool_count = 5
max_iters = 4
streaming = True # token-level SSE via InferenceClient
```
## π Project Structure
```
langgraph-support-agent/
βββ app.py # Flask app, SSE endpoints, session management
βββ events.py # Thread-safe per-session SSE event queue
βββ agent/
β βββ state.py # AgentState TypedDict for LangGraph
β βββ tools.py # 5 tool functions + execute_tool dispatcher
β βββ llm.py # HF InferenceClient wrapper, ReAct prompt, parsers
β βββ nodes.py # Router, Agent, ToolExecutor, Responder node functions
β βββ graph.py # StateGraph builder with conditional routing
βββ data/
β βββ faq.json # 15-entry FAQ knowledge base
βββ templates/
β βββ index.html # Single-page UI, 4-panel layout, SSE client
βββ static/
β βββ app.js # SSE client, Chart.js, node trace UI, analytics
βββ requirements.txt
βββ Dockerfile
βββ .env.example
βββ docs/
βββ project-template.html # Portfolio page
```
## π¨βπ» Author

**Mohammad Noorchenarboo** β Data Scientist | AI Researcher | Biostatistician
π Ontario, Canada Β· [LinkedIn](https://www.linkedin.com/in/mnoorchenar) Β· [Website](https://mnoorchenar.github.io/) Β· [HuggingFace](https://huggingface.co/mnoorchenar/spaces) Β· [GitHub](https://github.com/mnoorchenar)
## Disclaimer
This project is developed strictly for educational and research purposes. All datasets are synthetically generated β no real user data is stored. Provided "as is" without warranty of any kind.
## π License
MIT License. See `LICENSE` for details.