A powerful AI-driven multi-agent system that intelligently routes user requests to specialized agents for WhatsApp management, calendar scheduling, and personalized learning path generation.
This project implements an intelligent chatbot system that uses intent detection to automatically route user requests to the appropriate specialized agent. Built with LangChain, LangGraph, and Gradio, it provides a seamless conversational interface for managing multiple aspects of your digital life.
- π― Intelligent Intent Detection: Automatically classifies user requests and routes them to the appropriate agent
- π¬ Conversational Memory: Maintains context across conversations with automatic message summarization
- π Multi-Agent Architecture: Specialized agents work together to handle diverse tasks
- π¨ User-Friendly Interface: Clean Gradio web interface for easy interaction
- π LangSmith Integration: Built-in tracing for monitoring and debugging
Purpose: Manage WhatsApp communications and contacts through natural language commands.
Capabilities:
- List all WhatsApp chats with details (chat ID, last message, sender info)
- Send messages to specific contacts or groups
- Retrieve chat and contact details
- Create and manage WhatsApp groups
- Add, update, and remove contacts
- Check contact online status and last seen time
Use Cases:
β
"Send a message to John saying I'll be late"
β
"List all my recent WhatsApp chats"
β
"Create a group called 'Project Team' with Alice and Bob"
β
"What was the last message in my chat with Sarah?"
β
"Check if Mike is online"
Technology: Built with Model Context Protocol (MCP) for WhatsApp integration, using LangGraph's ReAct agent pattern.
Purpose: Manage Google Calendar events and schedules through conversational commands.
Capabilities:
- Create calendar events with automatic meeting links
- List upcoming events and schedules
- Update and delete calendar events
- Manage multiple calendars
- Check free/busy time slots
- Search for specific events
- Automatic 1-hour duration for unspecified meetings
- Smart time handling (assumes 1 hour from now if not specified)
Use Cases:
β
"Schedule a meeting with the marketing team tomorrow at 2 PM"
β
"What are my meetings for this week?"
β
"Create a reminder for my dentist appointment next Monday"
β
"Am I free on Friday afternoon?"
β
"Cancel my 3 PM meeting today"
β
"What's the meeting link for tomorrow's standup?"
Technology: Integrates with Google Calendar API via MCP, provides automatic meeting link generation.
Purpose: Generate personalized, structured learning roadmaps for any topic.
Capabilities:
- Create detailed learning plans from beginner to advanced level
- Provide weekly structured progression
- Recommend curated resources (courses, books, tutorials)
- Suggest practice projects and exercises
- Estimate time requirements for each learning stage
- Search for educational resources using Tavily API
Use Cases:
β
"I want to learn Python programming"
β
"Create a learning path for machine learning"
β
"Help me learn web development from scratch"
β
"I need a roadmap to become a data scientist"
β
"What should I learn to get started with AI?"
Output Format:
- Topic overview and prerequisites
- Week-by-week structured plan
- Curated learning resources
- Practice projects
- Realistic time estimates
- Clear progression path
Technology: Uses LangGraph ReAct agent with Tavily search integration for finding up-to-date learning resources.
Purpose: Handle casual conversations and provide friendly assistance.
Capabilities:
- Engage in friendly conversation
- Answer general questions
- Guide users on available features
- Provide system information
Use Cases:
β
"Hello! What can you help me with?"
β
"What features do you have?"
β
"How do I use this system?"
β
General chitchat and assistance requests
User Input
β
Intent Detection (LLM-powered)
β
βββ WhatsApp Agent (Async)
βββ Calendar Agent (Async)
βββ Learning Planner Agent (Sync)
βββ General Inquiry Agent
β
Response to User
- User Input: User submits a message through the Gradio interface
- Intent Classification: LLM analyzes the message and conversation history to determine intent
- Agent Routing: Request is routed to the appropriate specialized agent
- Agent Processing: The agent uses its tools and capabilities to fulfill the request
- Response Generation: Agent returns a comprehensive response to the user
- Memory Management: Conversation history is maintained and summarized when needed
- LangChain: Framework for building LLM applications
- LangGraph: For creating multi-agent workflows
- Gradio: Web interface for user interaction
- ChatTogether (Llama 3.3): Primary LLM for general tasks
- ChatGroq: LLM for agent-specific tasks
- Model Context Protocol (MCP): For WhatsApp and Calendar integrations
- Tavily API: For searching educational resources
- LangSmith: For tracing and monitoring
- Python asyncio: For handling concurrent operations
- Python 3.8+
- Node.js (for Google Calendar MCP server)
- Google Calendar API credentials
- WhatsApp MCP server setup
- API keys for: Together AI, Groq, Tavily
- Clone the repository:
git clone https://github.com/karim1007/Multi-Agent-Learning-Assistant-.git
cd Multi-Agent-Learning-Assistant-- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
Create a
.envfile in the root directory:
TOGETHER_API_KEY=your_together_api_key
GROQ=your_groq_api_key
TAVILY_API_KEY=your_tavily_api_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=your_redirect_uri
GOOGLE_REFRESH_TOKEN=your_refresh_token- Set up MCP servers:
- Configure WhatsApp MCP server path in
whatsapp.py - Configure Google Calendar MCP server path in
calendar_1.py
- Configure WhatsApp MCP server path in
python gradio_app.pyThis launches a web interface at http://localhost:7860 where you can:
- Chat with the assistant
- Add contacts information (appended to first message)
- Start new conversations
python app.pyThis starts an interactive command-line chat session.
WhatsApp Management:
User: Send a message to my team saying "Meeting at 3 PM"
Assistant: I've sent the message to your team group successfully!
Calendar Scheduling:
User: Schedule a meeting with John tomorrow at 10 AM
Assistant: I've created a 1-hour meeting with John for tomorrow at 10:00 AM.
Here's the meeting link: [Google Meet link]
Learning Path Generation:
User: I want to learn machine learning
Assistant: I've created a comprehensive 12-week learning plan for machine learning...
[Detailed roadmap with resources and time estimates]
Multi-Agent-Learning-Assistant-/
βββ app.py # Main application with intent detection
βββ gradio_app.py # Gradio web interface
βββ whatsapp.py # WhatsApp agent implementation
βββ calendar_1.py # Calendar agent implementation
βββ learning_planner.py # Learning planner agent
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ rag for interview/ # RAG system for interviews
βββ src/
βββ rag_manager.py
βββ pdf_example.py
The system automatically manages conversation memory:
- Maintains last 10 messages for active context
- Summarizes older messages when history exceeds 25 messages
- Ensures efficient token usage while preserving context
Each agent can be customized by modifying their respective files:
whatsapp.py: WhatsApp agent prompts and toolscalendar_1.py: Calendar agent time handling and promptslearning_planner.py: Learning plan structure and search queries
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-source and available under the MIT License.
- Built with LangChain and LangGraph frameworks
- Powered by Llama 3.3 (Together AI and Groq)
- Uses Model Context Protocol for seamless integrations
- Educational resources powered by Tavily search
For issues, questions, or suggestions, please open an issue on GitHub or contact the maintainer.
Made with β€οΈ by karim1007