Skip to content

nupurvavhal/LangGraph-Complex-AI-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Dual-Mode AI Agent: Therapist & Logician

This multi-agent system implements a sophisticated LangGraph agent that dynamically routes user queries between two specialized personas: a Compassionate Therapist and a Purely Logical Assistant.

πŸš€ How it Works

The agent doesn't just respond; it thinks before it speaks. It uses a Structured Output Classifier to analyze the "vibe" of your message and directs the conversation accordingly.

πŸ—οΈ The Architecture

Message Classifier: An LLM node using Pydantic to categorize input as emotional or logical.

The Router: A conditional logic gate that reads the state and picks the appropriate specialist.

Specialist Nodes:

Therapist Agent: Focused on empathy, validation, and emotional exploration.

Logical Agent: Focused on facts, brevity, and objective analysis.

πŸ› οΈ Installation

Clone the Repo:

   git clone <your-repo-url>
   cd langgraph-complex-agent
   

Install Dependencies:

   pip install langchain-google-genai langgraph python-dotenv pydantic

Environment Setup: Create a .env file in the root directory: GOOGLE_API_KEY=your_gemini_api_key

πŸ’» Usage

Run the script to start the interactive loop:

   python main.py

Example Interaction: User: "I feel a little low today." Classifier: emotional Therapist: "I hear that you're feeling low. Would you like to talk about what's weighing on your heart?"

πŸ“ Configuration

The agent is powered by Gemini 2.5 Flash. You can customize the "personality" of each agent by modifying the system_instructions within the therapist_agent and logical_agent functions in main.py.

πŸ›‘οΈ Security

This project uses a .gitignore to ensure your .env file and .idea/ (PyCharm) settings are never published to version control.

About

This project implements a sophisticated LangGraph agent that dynamically routes user queries between two specialized personas: a Compassionate Therapist and a Purely Logical Assistant.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages