TailorTalk is an intelligent, LLM-powered calendar booking assistant that understands natural language and automates meeting scheduling with seamless Google Calendar integration. It revolutionizes how you manage your schedule by providing a conversational interface for all your meeting needs.
- ๐ฏ Project Overview
- ๐๏ธ Architecture
- โจ Key Features
- ๐ง Technical Stack
- ๐ Project Structure
- ๐ Installation & Setup
- ๐ฎ Usage Guide
- ๐งช Testing
- ๐ก๏ธ Edge Cases Handled
- ๐ฎ Future Scope
โ ๏ธ Security Notice- ๐ค Contributing
- ๐ Support
TailorTalk streamlines meeting scheduling by offering:
- Natural Language Understanding: Processes complex scheduling requests in a conversational format.
- Smart Calendar Integration: Seamlessly connects with the Google Calendar API.
- Multi-Timezone Support: Handles GMT, IST, AST, EST, PST with automatic conversions.
- Intelligent Slot Finding: Automatically detects available time slots.
- Real-time Booking: Creates calendar events instantly with proper notifications.
TailorTalk employs a modular and scalable architecture:
Component Breakdown:
- Frontend (Streamlit): Provides an interactive web interface with real-time chat capabilities.
- Backend (FastAPI): Serves as the REST API, handling requests and managing session states.
- Smart Agent: A GPT-4 powered conversational AI that leverages function calling to understand and execute user commands.
- Calendar Service: Manages Google Calendar API integration, including secure OAuth2 authentication.
- Tools System: A collection of modular functions for specific tasks like scheduling, viewing, and modifying calendar events.
- โ Natural Language Scheduling: Easily schedule meetings with phrases like "Book a meeting tomorrow at 3 PM."
- โ Multi-Timezone Support: Automatic timezone detection and conversion for seamless global coordination.
- โ Smart Date Parsing: Understands various date formats such as "29th June," "next Friday," or "tomorrow."
- โ Real-time Availability: Checks your actual Google Calendar for free slots before booking.
- โ Instant Booking: Creates calendar events with descriptions and notifications instantly.
- โ Calendar Viewing: Displays existing events with proper timezone formatting for clarity.
- โ Conversational Flow: Maintains context throughout the conversation for a natural user experience.
- โ Error Handling: Provides graceful fallbacks for API failures or invalid inputs.
- โ Session Management: Ensures persistent conversations across multiple interactions.
- โ Timezone Intelligence: Shows times clearly, e.g., "4:00 PM (IST)."
- โ Calendar Links: Provides direct links to Google Calendar for easy verification of booked events.
- โ LangChain Integration: Utilizes LangChain for robust function calling with structured tools.
- โ OAuth2 Authentication: Ensures secure access to Google Calendar.
- โ REST API Design: Features clean, well-documented endpoints for easy integration.
- โ Real-time Updates: Provides live conversation updates in the UI.
- โ Cross-platform Compatibility: Works seamlessly on Windows, macOS, and Linux.
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Streamlit | Interactive web interface |
| Backend | FastAPI | REST API & session management |
| AI Engine | OpenAI GPT-4 | Natural language processing |
| LLM Framework | LangChain | Tool calling & agent orchestration |
| Calendar API | Google Calendar | Event management |
| Authentication | OAuth2 | Secure calendar access |
| Timezone | pytz |
Multi-timezone support |
| HTTP Client | requests |
API communication |
โโโ backend/
โ โโโ api/
โ โ โโโ app.py # FastAPI application entry point
โ โ โโโ auth.py # OAuth2 authentication logic
โ โ โโโ calendar_service.py # Google Calendar API interactions
โ โ โโโ config.py # Application configuration
โ โ โโโ models.py # Pydantic models for request/response
โ โ โโโ utils.py # Utility functions
โ โโโ agent/
โ โ โโโ agent.py # LangChain agent definition
โ โ โโโ tools.py # Custom tools for the agent
โ โ โโโ prompts.py # LLM prompts
โ โโโ main.py # Backend server runner
โโโ frontend/
โ โโโ streamlit_app.py # Streamlit frontend application
โ โโโ utils.py # Frontend utility functions
โโโ .env.example # Example environment variables file
โโโ requirements.txt # Python dependencies
โโโ README.md # Project README
โโโ run.sh # (Optional) Script to run both backend and frontend
- Python 3.8 or higher
- Google Cloud Console account
- OpenAI API account
git clone <repository_url>
cd TailorTalkpip install -r requirements.txt- Go to Google Cloud Console.
- Create a new project or select an existing one.
- Enable Google Calendar API:
- Navigate to "APIs & Services" โ "Library."
- Search for "Google Calendar API."
- Click "Enable."
- Create OAuth 2.0 Credentials:
- Go to "APIs & Services" โ "Credentials."
- Click "Create Credentials" โ "OAuth 2.0 Client IDs."
- Set the application type to "Desktop Application."
- Download the JSON file.
- Rename the downloaded file to
credentials.json. - Place
credentials.jsonin the/backend/apidirectory.
Create a .env file in the root directory of the project and populate it as follows:
# Google Calendar API
GOOGLE_CREDENTIALS_FILE=backend/api/credentials.json
# API Configuration
DEBUG=true
API_HOST=0.0.0.0
API_PORT=8000
# Calendar Settings
DEFAULT_MEETING_DURATION=60
BUSINESS_START_HOUR=9
BUSINESS_END_HOUR=17
DEFAULT_TIMEZONE=GMT
# OpenAI API Key (REQUIRED)
OPENAI_API_KEY="your-openai-api-key-here"
# ANTHROPIC_API_KEY=your_anthropic_key_here # Optional, if using Anthropic modelsStart Backend Server:
uvicorn app:app --reloadThe server will start on http://localhost:8000.
Start Frontend (New Terminal):
streamlit run frontend/streamlit_app.pyThe UI will open in your browser at http://localhost:8501.
Test Calendar Integration:
python backend/api/calendar_service.pyThis validates Google Calendar connectivity and authentication.
Check API Health:
curl http://localhost:8000/healthTest Chat Endpoint:
curl -X POST "http://localhost:8000/chat" \
-H "Content-Type: application/json" \
-d '{"message": "Schedule a meeting tomorrow at 3 PM", "timezone": "IST"}'Basic Scheduling:
- Open the Streamlit app at
http://localhost:8501. - Select your timezone from the sidebar (GMT, IST, AST, etc.).
- Type natural language requests in the chat interface:
- "Schedule a meeting tomorrow at 3 PM"
- "Book a 1-hour call on 29th June"
- "Find available slots next Friday"
Quick Actions Available:
You can also use the predefined quick action buttons:
- ๐๏ธ "I want to schedule a meeting"
- โฐ "Show me available times tomorrow"
- ๐ "Can you open my calendar?"
- ๐ฏ "I need to schedule an interview"
- ๐ "What time is it now?"
Advanced Features:
- View Calendar: "Show me my schedule for today."
- Timezone Changes: "Change timezone to IST."
- Specific Dates: "29th June 3-4 PM IST 1 hour meeting."
- Calendar Links: Get direct Google Calendar URLs for booked events.
โ Calendar Integration
- Start backend:
python backend/api/app.py - Check health:
http://localhost:8000/health - Test chat: Use
curlor Postman to send requests to/chatendpoint.
โ Frontend UI
- Start Streamlit:
streamlit run frontend/streamlit_app.py - Test timezone selection in the sidebar.
- Test quick action buttons.
- Test natural language input in the chat.
โ End-to-End Workflow
- In the Streamlit app, say: "Schedule a meeting tomorrow at 3 PM."
- Select a time slot from the results provided by TailorTalk.
- Confirm the booking.
- Verify the newly created event directly in your Google Calendar.
- โ Ambiguous Dates: "29th June" โ Automatically detects current/next year based on context.
- โ Invalid Dates: "February 30th" โ Provides graceful fallbacks and helpful error messages.
- โ Past Dates: Automatically suggests future alternatives when a past date is provided.
- โ Timezone Conflicts: Correctly converts and manages times between GMT, IST, AST, etc.
- โ Business Hours: Only suggests and books slots within defined business hours (9 AM - 5 PM by default).
- โ API Failures: Implements graceful error handling with informative user feedback.
- โ Authentication Expiry: Automatic token refresh ensures continuous access.
- โ Rate Limiting: Implements proper retry mechanisms to handle API rate limits.
- โ Empty Calendar: Handles scenarios where no events exist in the user's calendar gracefully.
- โ Conflicting Events: Detects overlaps with existing events and suggests alternative available times.
- โ Session Management: Maintains conversational context across multiple interactions.
- โ Connection Errors: Displays clear error messages with suggested solutions for network issues.
- โ Invalid Input: Provides helpful suggestions for correcting misinterpreted or invalid inputs.
- โ Multiple Requests: Efficiently handles rapid-fire questions and commands.
- โ Browser Refresh: Preserves the session state even if the browser is refreshed.
- โ API Timeouts: Configured with a 30-second timeout and retry logic for API calls.
- โ Memory Management: Employs efficient session storage to optimize resource usage.
- โ Cross-platform: Verified to work on Windows, macOS, and Linux operating systems.
- โ Environment Variables: Securely manages sensitive credentials through environment variables.
- โ Error Logging: Provides comprehensive debugging information for troubleshooting.
- Multi-Calendar Support: Handle personal, work, and shared calendars.
- Recurring Meetings: "Schedule weekly standup every Monday."
- Meeting Templates: Pre-defined meeting types with customizable durations.
- Conflict Resolution: Smart suggestions and automatic adjustments when time slots overlap.
- Calendar Sync: Two-way synchronization with Outlook and Apple Calendar.
- Meeting Preferences: Learn and adapt to a user's preferred meeting times and days.
- Buffer Time: Automatically add 15-minute buffers between meetings.
- Meeting Duration Detection: Intelligently infer duration from phrases like "quick chat" (15 mins) or "deep dive" (2 hours).
- Location Integration: Suggest meeting rooms or integrate with video conferencing links.
- Attendee Management: Add multiple participants and send email invitations directly.
- Intent Recognition: Detect cancellations, rescheduling requests, and meeting updates.
- Context Awareness: Understand commands like "Move our 3 PM meeting to tomorrow."
- Email Integration: Process meeting requests and confirmations from emails.
- Voice Commands: Enable hands-free scheduling: "Hey TailorTalk, schedule my doctor appointment."
- Multi-language Support: Expand language support to Spanish, French, German, Hindi, etc.
- Meeting Analytics: Track meeting frequency, duration, and patterns over time.
- Productivity Insights: Suggest optimal meeting-free focus times.
- Calendar Health Score: Analyze meeting density and suggest improvements for a balanced schedule.
- Team Coordination: Find common free time slots for team meetings more efficiently.
- Meeting Cost Calculator: Show the time investment for recurring meetings and team time.
- CRM Integration: Sync meeting details with Salesforce, HubSpot for client interactions.
- Project Management: Connect with Jira, Trello for project-related meeting scheduling.
- HR Systems: Streamline interview scheduling with Applicant Tracking Systems (ATS).
- Conference Room Booking: Automatically reserve physical meeting spaces.
- Travel Integration: Account for travel time between different locations for in-person meetings.
- SSO Integration: Support for Single Sign-On with Active Directory, OKTA authentication.
- Role-based Access: Implement administrative controls for organization-wide settings.
- Audit Logs: Maintain a complete trail of all scheduling activities for compliance.
- Data Encryption: Ensure end-to-end encryption for sensitive meeting information.
- Compliance: Adhere to regulatory standards like GDPR and HIPAA for regulated industries.
- "Book a 30-minute call next week": Enables duration-specific scheduling.
- "Show me my calendar for today": Provides an enhanced daily agenda view.
- "Check if my meeting was booked": Offers real-time booking verification.
- "What's on my schedule tomorrow?": Provides proactive schedule briefings.
- Slack Integration: Schedule meetings directly from Slack channels.
- Microsoft Teams: Native integration for creating Teams meetings.
- WhatsApp Bot: Schedule meetings via WhatsApp messages.
- Email Assistant: Parse and respond to meeting invitations received via email.
- Mobile App: Develop native iOS/Android applications for on-the-go scheduling.
- Auto-scheduling: AI suggests and books optimal meeting times based on availability and preferences.
- Smart Rescheduling: Automatically handles cancellations and conflicts, suggesting new times.
- Meeting Preparation: Auto-generate agendas based on meeting context and participants.
- Follow-up Automation: Automatically schedule follow-up meetings or tasks.
- Travel Optimization: Minimize travel time by suggesting meeting locations or times.
- Meeting Success Prediction: Analyze factors to predict the likelihood of productive meetings.
- Optimal Time Suggestions: Use machine learning to suggest the best times for specific meeting types.
- Burnout Prevention: Detect over-scheduling and suggest breaks or rescheduling.
- Seasonal Patterns: Adapt scheduling suggestions to holiday seasons and vacation patterns.
- Performance Correlation: Link meeting patterns to individual or team productivity metrics.
- AR/VR Integration: Schedule and participate in meetings in virtual reality spaces.
- AI Meeting Notes: Auto-transcription and extraction of action items from meetings.
- Emotion Detection: Gauge meeting satisfaction and engagement levels during calls.
- Carbon Footprint: Track and help reduce travel-related emissions from business meetings.
- Wellness Integration: Consider circadian rhythms and personal wellness for meeting scheduling.
- API Marketplace: Allow third-party integrations and plugins to extend functionality.
- White-label Solution: Offer a customizable version for enterprise clients.
- Industry-specific Modules: Develop variants tailored for Healthcare, Legal, and Education sectors.
- Global Expansion: Further optimize multi-timezone support for international teams.
- Accessibility Features: Ensure support for users with disabilities, adhering to accessibility standards.
Important: For security and privacy reasons, the following sensitive files are NOT included in this repository:
credentials.json- Your Google OAuth2 credentials.token.pickle- Stored authentication tokens generated during the OAuth flow..envfile with real API keys (only.env.exampleis provided).
โ Required Setup:
-
Create your own
credentials.json:- Follow the Google Cloud Console setup steps above.
- Download your own OAuth2 credentials.
- Place it in the
backend/api/directory.
-
Configure your
.envfile:- Copy the example
.env.examplestructure. - Insert your own OpenAI API key.
- Ensure all paths and settings match your environment.
- Copy the example
Authentication Flow:
The first time you run the application, it will trigger the OAuth2 flow. You will be prompted to authenticate via your browser. Upon successful authentication, a token.pickle file will be created automatically to store your credentials securely for future use.
This project demonstrates advanced AI integration with calendar systems. Its modular architecture is designed for easy extension and customization to meet specific business needs.
Key Technical Achievements:
- โ Natural language to structured API calls conversion.
- โ Robust handling of multi-timezone complexity.
- โ Real-time integration with Google Calendar.
- โ Conversational AI with memory and context retention.
- โ Production-ready error handling and graceful fallbacks.
For implementation support, feature requests, or enterprise integration opportunities, the codebase is thoroughly documented and designed for production deployment.
Architecture Benefits:
- ๐ง Modular Design: Easy to extend and customize for diverse requirements.
- ๐ Scalable Backend: Built with FastAPI, leveraging its async capabilities for high performance.
- ๐ง AI-First Approach: Utilizes LangChain tools for enhanced extensibility and AI capabilities.
- ๐ Security Ready: Implements OAuth2 and environment-based configuration for secure operations.
- ๐ Production Ready: Features comprehensive error handling and logging for reliable deployment.
Built with โค๏ธ using Python, FastAPI, Streamlit, LangChain & GPT-4.