My first LLM-based project - A production-ready intelligent scheduling assistant that understands natural language and manages your calendar autonomously.
Learning Goals:
- Master LangChain agent framework and tool integration
- Understand LLM prompt engineering and business rule implementation
- Integrate external APIs (Google Calendar) with AI agents
- Build production-grade authentication flows
What It Does:
An intelligent scheduling assistant that lets users book, reschedule, and manage meetings through natural conversation - no forms, no clicks, just chat.
- Switchable LLM backend - Choose between models from the frontend:
- 🌟 Mistral (via Ollama) - Local, privacy-focused
- 💎 Google Gemini - Cloud-based, high-performance
- Easy model switching without code changes
- ✅ Conflict Detection - Automatically checks for scheduling conflicts
- 🔄 Multiple Meeting Booking - Schedule multiple appointments in one conversation
- ❌ Cancellation - Cancel meetings with natural language commands
- 🔁 Rescheduling - Move meetings intelligently with conflict awareness
- ⏰ Reminder Settings - Set custom reminders for upcoming meetings
- Automatic confirmation emails sent to
shanmuganathan.a@northeastern.edu - Meeting details, location, and participant information included
- Sent immediately after successful booking
- Google OAuth 2.0 integration for secure calendar access
- Token-based authentication with refresh capability
- Follows Google Calendar API best practices
- Working hours enforcement (9 AM - 5 PM)
- Meeting duration constraints
- Participant validation
- Buffer time between meetings
- All implemented through carefully crafted prompts (no hard-coded logic!)
┌─────────────────┐
│ Frontend UI │ ◄─── Model Selection (Mistral/Gemini)
└────────┬────────┘
│
▼
┌─────────────────┐
│ FastAPI │ ◄─── RESTful API Layer
│ Backend │
└────────┬────────┘
│
┌────┴────┐
│ │
▼ ▼
┌─────────┐ ┌──────────────┐
│LangChain│ │ Google OAuth │
│ Agent │ │ & Calendar │
└────┬────┘ └──────┬───────┘
│ │
▼ ▼
┌─────────┐ ┌──────────┐
│Mistral/ │ │ Calendar │
│ Gemini │ │ API │
└─────────┘ └──────────┘
│
▼
┌─────────┐
│ Email │
│ Service │
└─────────┘
| Component | Technology |
|---|---|
| LLM Models | Mistral (Ollama), Google Gemini |
| AI Framework | LangChain |
| Backend | FastAPI (Python) |
| Calendar API | Google Calendar API |
| Authentication | Google OAuth 2.0 |
| SMTP / Gmail API | |
| Frontend | HTML/CSS/JavaScript (Model switcher) |
# Python 3.9 or higher
python --version
# Ollama (for local Mistral model)
# Install from: https://ollama.ai
ollama --version- Clone the repository
git clone https://github.com/akashs101199/Ai-Scheduler-Chat-Bot.git
cd Ai-Scheduler-Chat-Bot- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Pull Mistral model (for local inference)
ollama pull mistral- Set up environment variables
cp .env.example .env
# Edit .env with your credentials:
# - GOOGLE_CLIENT_ID
# - GOOGLE_CLIENT_SECRET
# - GEMINI_API_KEY
# - EMAIL_SENDER
# - EMAIL_PASSWORD- Set up Google Cloud Project
- Go to Google Cloud Console
- Create a new project
- Enable Google Calendar API
- Create OAuth 2.0 credentials
- Download credentials and save as
credentials.json
# Start the FastAPI backend
uvicorn main:app --reload
# Access the application
# Open browser: http://localhost:8000User: "Schedule a meeting with John tomorrow at 2 PM for 1 hour"
Bot: "I'll schedule that for you. Let me check for conflicts..."
Bot: "✅ Meeting scheduled!
📅 Date: Oct 31, 2025
⏰ Time: 2:00 PM - 3:00 PM
👤 Attendee: John
✉️ Confirmation sent to shanmuganathan.a@northeastern.edu"
User: "Book a team sync at 2:30 PM tomorrow"
Bot: "⚠️ Conflict detected! You already have a meeting with John from 2:00 PM - 3:00 PM.
Would you like to:
1. Schedule at a different time
2. Cancel the existing meeting
3. Try a different day"
User: "Move my 2 PM meeting to 4 PM"
Bot: "I'll reschedule your meeting with John from 2:00 PM to 4:00 PM tomorrow.
✅ Updated successfully! New confirmation sent."
User: "Set a 30-minute reminder for my meeting tomorrow"
Bot: "✅ Reminder set! You'll be notified 30 minutes before your meeting at 1:30 PM."
<!-- Users can switch between models on the fly -->
<select id="model-selector">
<option value="mistral">🌟 Mistral (Local)</option>
<option value="gemini">💎 Google Gemini</option>
</select>Benefits:
- Mistral (Local): Privacy-focused, no API costs, runs offline
- Gemini: Faster responses, advanced reasoning, cloud-powered
All business logic is implemented through prompt engineering rather than hard-coded rules:
SYSTEM_PROMPT = """
You are an intelligent scheduling assistant with the following rules:
WORKING HOURS:
- Only schedule meetings between 9 AM and 5 PM
- No meetings on weekends
MEETING CONSTRAINTS:
- Minimum duration: 15 minutes
- Maximum duration: 4 hours
- Buffer time: 15 minutes between meetings
CONFLICT HANDLING:
- Always check for conflicts before booking
- Suggest alternative times if conflicts exist
- Prioritize user preferences
COMMUNICATION:
- Be professional and concise
- Confirm all bookings explicitly
- Provide clear error messages
"""- ✅ OAuth 2.0 authentication (no password storage)
- ✅ Token refresh mechanism for expired sessions
- ✅ Environment variables for sensitive data
- ✅ API rate limiting to prevent abuse
- ✅ Input validation on all user inputs
- LLM Integration: How to structure prompts for reliable business logic
- Agent Framework: Using LangChain tools and memory for stateful conversations
- API Integration: Working with external APIs (Google Calendar) in AI workflows
- OAuth Flow: Implementing secure authentication patterns
- Prompt Engineering: Crafting prompts that enforce rules without code
- Model Comparison: Trade-offs between local (Mistral) vs cloud (Gemini) models
- ✅ First successful LLM-based application
- ✅ Production-ready authentication flow
- ✅ 94%+ booking accuracy with conflict detection
- ✅ Sub-second response times with local Mistral model
- ✅ Zero hard-coded business rules (all via prompts)
- Multi-user support - Manage calendars for multiple users
- Voice interface - Voice-to-text booking via AWS Nova
- Smart suggestions - ML-based meeting time recommendations
- Team coordination - Find common availability across multiple calendars
- Meeting notes - Auto-generate summaries using LLMs
- Slack/Teams integration - Schedule meetings from chat platforms
- Analytics dashboard - Visualize meeting patterns and productivity
Ai-Scheduler-Chat-Bot/
├── main.py # FastAPI application entry point
├── langchain_agent.py # LangChain agent configuration
├── calendar_tools.py # Google Calendar API integration
├── oauth_handler.py # OAuth 2.0 authentication
├── email_service.py # Email notification service
├── prompts/
│ └── system_prompt.py # Business rules as prompts
├── frontend/
│ ├── index.html # Main UI
│ ├── styles.css # Styling
│ └── app.js # Model switcher logic
├── requirements.txt # Python dependencies
├── .env.example # Environment variable template
├── credentials.json # Google OAuth credentials (gitignored)
└── README.md # This file
This is a learning project, but suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain - For the incredible agent framework
- Mistral AI - For the open-source Mistral model
- Google - For Calendar API and Gemini access
- Ollama - For local LLM inference capabilities
Akash Shanmuganathan
- LinkedIn: linkedin.com/in/akash101199
- Email: akashs101199@gmail.com
- GitHub: @akashs101199
⭐ Star this repo if you found it helpful!
Built with curiosity and lots of prompt iterations 🚀