A LangGraph-powered multi-agent AI system that intelligently classifies user intent and dynamically routes conversations to specialized LLM agents (emotional vs logical) using a state-machine-based agentic architecture.
This project demonstrates how to move beyond a single “chatbot” and design clear, explainable, role-based AI agents coordinated through LangGraph.
- 🧩 Multi-Agent Architecture (not a single LLM chatbot)
- 🧠 Intent Classification using Structured LLM Output
- 🔀 Dynamic Routing with LangGraph
- 💬 Specialized Agents
- Therapist Agent → emotional support & empathy
- Logical Agent → factual, analytical responses
- 🔁 Shared Conversational State
- 🧪 Fully local LLM execution via Ollama
- 📦 Clean, extensible, production-style design
This system consists of multiple autonomous agents, each with:
- A clear role
- A specific goal
- Independent reasoning
- Access to a shared state
| Component | Role |
|---|---|
| Classifier Agent | Determines user intent |
| Router Agent | Controls execution flow |
| Therapist Agent | Emotional & empathetic responses |
| Logical Agent | Analytical & factual responses |
Even though agents share the same LLM backend, they are logically independent agents, which qualifies this as a multi-agent system.
- Python 3.9+
- LangGraph – state machine & agent orchestration
- LangChain – LLM abstraction
- Ollama – local LLM inference
- LLaMA 3 – base language model
- Pydantic – structured LLM outputs
- TypedDict & Annotated – typed shared state
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtpython main.pyLangGraph enables:
- Deterministic agent routing
- Explicit state management
- Visualizable execution paths
- Clean separation of concerns
- Easy extension to more agents, loops, or tools
This makes LangGraph ideal for building agentic LLM systems, not just simple chatbots.
- ➕ Critic / Reviewer Agent
- 🧠 Memory Summarization Agent
- 🔁 Self-reflection or retry loops
- 🔧 Tool-using agents (search, calculator, RAG)
- 🤝 Parallel or debating agents
- Data Scientists exploring agentic AI
- Engineers learning LangGraph
- Developers moving beyond basic chatbots
- Anyone building explainable LLM systems
This project is licensed under the MIT License.
Feel free to use, modify, and build on it.
