An AI-powered personal productivity planner with semantic memory, built using LangGraph and Groq LLM
This project implements a single-agent agentic AI system that manages your calendar intelligently through natural language interactions. It features semantic memory via Weaviate, Google Calendar integration, and human-in-the-loop decision-making for safe and transparent scheduling.
- Features
- Architecture
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Usage
- Project Structure
- How It Works
- Agent Flow
- API Integration
- Memory System
- Prompt Engineering
- Examples
- Troubleshooting
- Contributing
- License
-
🗓️ Multi-Mode Scheduling
- Planner Mode: Multi-day/week time-blocked schedules (e.g., "Plan my 6-month exam preparation")
- Reminder Mode: Single-event scheduling (e.g., "Meeting tomorrow at 10 AM")
- Delete Mode: Smart event removal with confirmation (e.g., "Delete my study sessions")
- Retrieval Mode: Natural language calendar queries (e.g., "What's on my schedule next month?")
-
🧠 Semantic Memory
- Learns your scheduling preferences over time
- Retrieves relevant past conversations for context
- Identifies scheduling patterns and suggests proactive improvements
- Three Weaviate collections: UserPreference, ConversationMemory, SchedulingPattern
-
✋ Human-in-the-Loop
- Requires explicit confirmation before calendar modifications
- Proposes schedules with tradeoff analysis
- Iterative refinement based on user feedback
- Transparent reasoning at every step
-
🔗 Google Calendar Integration
- Real-time calendar synchronization
- Conflict detection and resolution
- Event creation, retrieval, and deletion
- OAuth2 secure authentication
-
💬 Natural Language Interface
- Conversational interaction via Gradio web UI
- Understands vague requests and asks clarifying questions
- Supports date/time parsing ("next Tuesday", "in 2 weeks")
- Session persistence across conversations
The system uses LangGraph to implement a state machine with specialized nodes:
Entry Point: retrieve_memory
|
current_time (inject IST timestamp)
|
get_event (fetch Google Calendar events)
|
classify_model (route: planner | reminder | delete | get_event)
|
+-> scheduler (planner path) -> human_feedback_planner (loop)
+-> model (reminder/get_event path) -> human_feedback_reminder (loop)
+-> model_delete (delete path) -> human_feedback_delete (loop)
|
tool (execute calendar operations)
|
refine_model (post-execution feedback)
|
store_memory (save to Weaviate)
|
END
Key Architectural Decisions:
- Single-Agent (Not Multi-Agent): All specialization via prompt engineering, not separate agents
- Explicit Control Flow: LangGraph's conditional edges enable deterministic routing
- Interruption Points:
interrupt_beforenodes pause execution for user approval - State Management: Immutable TypedDict state passed between nodes
| Component | Technology | Purpose |
|---|---|---|
| Agent Framework | LangGraph | State machine orchestration, human-in-the-loop |
| LLM | Groq - openai/gpt-oss-20b | 20B-parameter open-source model via Groq LPU |
| Vector Database | Weaviate Cloud | Semantic memory storage with Cohere embeddings |
| Embeddings | Cohere embed-english-v3.0 | Free-tier text vectorization for Weaviate |
| Calendar API | Google Calendar API | Event CRUD operations |
| UI Framework | Gradio | Web-based chat interface |
| Authentication | OAuth2 (Google) | Secure calendar access |
| Language | Python 3.10+ | Core implementation |
Why These Choices?
- LangGraph: Best for explicit control flow and human-in-the-loop (vs. CrewAI's autonomy or AutoGen's conversational overhead)
- Groq gpt-oss-20b: Open-source, cost-effective, sufficient reasoning for scheduling, ultra-low latency
- Weaviate Cloud: Free managed vector DB with Cohere embeddings, no self-hosting required
- Gradio: Rapid UI prototyping with minimal frontend code
- Python 3.10 or higher
- Google Cloud Project with Calendar API enabled
- Weaviate Cloud account (free tier)
- Cohere API key (free tier for embeddings)
- Groq API key (for LLM access)
git clone https://github.com/yourusername/intelligent-schedule-organizer.git
cd intelligent-schedule-organizerpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtRequired packages:
langchain>=0.1.0
langgraph>=0.0.40
langchain-groq>=0.0.1
weaviate-client>=4.0.0
gradio>=4.0.0
google-api-python-client>=2.0.0
google-auth-httplib2>=0.1.0
google-auth-oauthlib>=1.0.0
python-dotenv>=1.0.0
python-dateutil>=2.8.0- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable Google Calendar API
- Create OAuth 2.0 credentials (Desktop App)
- Download credentials as
credentials.json - Place
credentials.jsonin the project root directory
- Sign up at Weaviate Cloud
- Create a free cluster
- Copy your Cluster URL and API Key
- Get Cohere API key from Cohere Dashboard
- Get Groq API key from Groq Console
Create a .env file in the project root:
# Weaviate Configuration
WEAVIATE_URL=https://your-cluster-url.weaviate.network
WEAVIATE_API_KEY=your_weaviate_api_key
# Cohere Embeddings (Free Tier)
COHERE_API_KEY=your_cohere_api_key
# Groq LLM
GROQ_API_KEY=your_groq_api_keySecurity Note: Never commit .env or credentials.json to version control!
python main.pyThe Gradio interface will launch at http://localhost:7860
- Click the link that appears in your terminal
- Sign in with your Google account
- Grant calendar access permissions
- A
token.jsonfile will be created (cached credentials)
Example Conversations:
1. Schedule a Single Event (Reminder Mode)
You: Schedule a team meeting tomorrow at 10 AM
Agent: I found a free slot on November 8, 2025 at 10:00 AM. Should I create this event?
You: Yes
Agent: ✅ Event created: Team Meeting (Nov 8, 10:00-11:00 AM)
2. Multi-Day Planning (Planner Mode)
You: Create a study schedule for my exams over the next 3 weeks
Agent: To help you plan effectively, I need:
- Which subjects/topics to cover?
- How many hours per day can you dedicate?
- Any fixed commitments I should avoid?
You: Math, Physics, Chemistry. 3 hours per day. I have meetings Wed/Fri afternoons.
Agent: Here's a proposed schedule:
Week 1: Math (Mon 9-12, Tue 9-12, Thu 9-12)
Week 2: Physics (Mon 9-12, Tue 9-12, Thu 9-12)
Week 3: Chemistry (Mon 9-12, Tue 9-12, Thu 9-12)
Should I add these to your calendar?
You: Go ahead
Agent: ✅ Created 9 study sessions successfully!
3. Calendar Retrieval (Get Event Mode)
You: What events do I have next month?
Agent: You have 12 events scheduled for December 2025:
- Team Standup (every Mon/Wed/Fri at 9 AM)
- Project Deadline (Dec 15, 2025)
- ...
4. Event Deletion (Delete Mode)
You: Delete my study sessions this week
Agent: I found 3 study sessions:
- Math Study (Nov 8, 9-12 AM)
- Physics Study (Nov 9, 9-12 AM)
- Chemistry Study (Nov 10, 9-12 AM)
Are you sure you want to delete these?
You: Yes, delete them
Agent: ✅ Deleted 3 events successfully.
intelligent-schedule-organizer/
├── main.py # Gradio UI entry point
├── agent.py # LangGraph state machine compilation
├── utils/
│ ├── nodes.py # LLM nodes (model, classify, scheduler, etc.)
│ ├── state.py # AgentState TypedDict definition
│ ├── tools.py # Tool decorators (@tool for calendar ops)
│ ├── google_calendar.py # Google Calendar API wrapper
│ ├── weaviate_memory.py # Weaviate vector DB wrapper
│ └── memory_node.py # Memory retrieval/storage nodes
├── credentials.json # Google OAuth2 credentials (NOT in repo)
├── token.json # Cached Google auth token (auto-generated)
├── .env # Environment variables (NOT in repo)
├── requirements.txt # Python dependencies
├── README.md # This file
└── graph.jpg # Agent flow diagram
Before Processing Each Request:
-
Semantic Search: Query Weaviate for:
- Top 3 relevant user preferences (e.g., "User prefers evening workouts")
- Top 2 similar past conversations
- Top 3 scheduling patterns (e.g., "User codes Tuesday 9 AM")
-
Context Injection: Retrieved memories are injected into the system prompt
-
Personalized Response: The LLM responds with awareness of past patterns without user restatement.
The agent uses a dedicated classifier node to route requests with >95% accuracy on diverse inputs.
Execution pauses before critical nodes, allowing:
- User to review proposed schedules
- Explicit confirmation ("yes", "go ahead")
- Iterative refinement ("spread over 2 weeks instead")
When the LLM decides to call a tool, the ToolNode automatically:
- Extracts function parameters from LLM output
- Invokes the tool
- Wraps result in a ToolMessage
- Appends to message history
After Successful Interaction, the system stores:
- Conversation turns (user message + assistant response)
- Scheduling patterns for future proactive suggestions
The agent follows this flow:
- Retrieve Memory - Fetch context from Weaviate
- Get Current Time - Inject timestamp
- Fetch Calendar Events - Get existing schedule
- Classify Request - Route to appropriate handler
- Process & Propose - Generate schedule/action
- Human Feedback - Wait for approval
- Execute Tools - Perform calendar operations
- Store Memory - Save patterns for future use
Operations Supported:
# Fetch events for a period
events = google_cal.get_events("30d") # Next 30 days
events = google_cal.get_events("6m") # Next 6 months
events = google_cal.get_events("2025-12-31") # Until specific date
# Create event
google_cal.create_event({
"summary": "Team Meeting",
"start": {"dateTime": "2025-11-08T10:00:00+05:30"},
"end": {"dateTime": "2025-11-08T11:00:00+05:30"}
})
# Delete event
google_cal.delete_event(event_id="abc123xyz")Three Collections:
- UserPreference - Stores user scheduling preferences
- ConversationMemory - Similar past conversations for context
- SchedulingPattern - Learned scheduling habits
- Token Restriction - Deterministic output
- Constraint Enforcement - Prevent premature actions
- Schema Specification - Well-formed tool calls
- In-Context Examples - Reduce ambiguity
- Sentinel Values - State machine triggers
| Prompt | Purpose | Effectiveness |
|---|---|---|
| MAIN_SYSTEM_PROMPT | Core directive | High |
| CLASSIFY_PROMPT | Task classification | Very High (>95%) |
| GET_EVENTS_EXTRACTOR_PROMPT | Parse time periods | High (85%+) |
| PLANNER_PROMPT | Schedule proposal | Medium-High (80%) |
| EVENT_CREATION_PROMPT | Generate tool calls | High (95%+) |
| DELETE_PROMPT | Confirm deletions | High (90%+) |
First Interaction:
You: Schedule a workout
Agent: What time works best for you?
You: 6 PM
Second Interaction (With Memory):
You: Schedule my workout
Agent: I see you usually work out at 6 PM. Should I block tomorrow 6-7 PM?
You: Schedule coding session tomorrow 10-12 PM
Agent: ⚠️ You have "Team Meeting" at 10-11 AM tomorrow.
I can suggest:
Option A: 12-2 PM (after meeting)
Option B: 2-4 PM (afternoon slot)
Which works better?
Fix:
- Verify credentials in Weaviate Console
- Resume cluster if paused (free tier auto-pauses)
- Check network connectivity
Fix:
- Delete
token.json - Re-run
python main.py - Complete OAuth flow again
Fix:
- Use explicit confirmation: "yes", "okay", "go ahead", "confirm"
- Avoid vague responses
Fix:
- Modify
get_current_time()innodes.pyto use your timezone offset
Contributions are welcome!
- Unit Tests (pytest)
- Logging system upgrade
- Timezone configuration
- Multi-user support
- Analytics dashboard
- Recurring events
- Integration tests
- Follow PEP 8
- Use type hints
- Add docstrings
- Keep prompts in constants
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- LangChain & LangGraph - Agent orchestration
- Groq - LLM inference
- Weaviate - Vector database
- Cohere - Embeddings
- Google - Calendar API
- Gradio - UI framework
- Seamus F. Rodrigues
- Rohit M Ghosarwadkar
- Lines of Code: ~5,000
- Nodes: 14
- Prompts: 6
- API Integrations: 3
- Memory Collections: 3
- Task Types: 4
- Unit tests with pytest
- Proper logging system
- Configurable timezone
- Recurring events
- Multi-user authentication
- Analytics dashboard
- Email/SMS reminders
- Conflict visualization
- Multi-calendar support
- Voice interface
- Mobile app
- Advanced AI planning algorithms
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ using LangGraph, Groq, and Weaviate
Last Updated: November 7, 2025