AI-Powered Smart Scheduling & Productivity Assistant (Local LLM + Google Calendar)
CalSync AI is a local-first AI productivity system that generates structured learning plans, converts them into optimized schedules, and automatically syncs them with Google Calendar.
It uses a local LLM via Ollama combined with a tool-based architecture (MCP) to create a powerful, extensible personal AI assistant.
- AI-Generated Learning Plans
- Smart Schedule Generation (No Conflicts)
- Google Calendar Integration (OAuth2)
- MCP Tooling (AI → Real Actions)
- Fully Dockerized Setup
- Local LLM (No external AI APIs required)
Define your goal, configure study preferences, and manage your entire workflow in one place.
Approved schedules are instantly converted into real Google Calendar events.
View upcoming events, track applied schedules, and manage saved plans and sessions.
Frontend (HTML + JS)
↓
Brain (FastAPI - AI Orchestration)
↓ MCP Calls
Backend (Go API)
↓
Google Calendar API
- User enters goal → Frontend
- Frontend calls Backend APIs
- Backend sends request to Brain (AI)
- Brain uses Ollama (LLM) to generate plan/schedule
- Backend validates + syncs with Google Calendar
| Service | Purpose |
|---|---|
| frontend | UI for user interaction |
| brain | AI logic (plan + schedule generation) |
| backend | OAuth, DB, calendar sync, MCP |
| ollama | Local LLM inference |
| postgres | Persistent storage |
- Frontend: HTML, Vanilla JS
- Backend: Go (net/http)
- AI Layer: FastAPI (Python)
- LLM Runtime: Ollama (
llama3.2:3b) - Integration: Google Calendar API
- Infra: Docker + Docker Compose
CalSync-AI/
├── backend/ # Go API (OAuth + Calendar + MCP)
├── brain/ # FastAPI AI engine
├── frontend/ # UI (HTML + JS)
├── docker-compose.yml
└── README.md
- Docker
- Docker Compose
- Google Account
- Ollama-compatible environment
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Add this redirect URI: http://localhost:8080/auth/google/callback
- Copy your credentials into
backend/.env
git clone https://github.com/your-username/CalSync-AI.git
cd CalSync-AIdocker compose up --builddocker exec -it calsync-ollama ollama pull llama3.2:3b| Service | URL |
|---|---|
| Frontend | http://localhost:8000 |
| Backend | http://localhost:8080 |
| Brain | http://localhost:5005 |
| Ollama | http://localhost:11434 |
Create a .env file inside backend/:
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URL=http://localhost:8080/auth/google/callback
SESSION_SECRET=your_secret
DATABASE_URL=postgres://calsync:calsyncpassword@postgres:5432/calsync?sslmode=disable
FRONTEND_ORIGIN=http://localhost:8000
FRONTEND_REDIRECT_URL=http://localhost:8000/main.html
BRAIN_BASE_URL=http://calsync-brain:5005
POST /api/v1/ai/generate-learning-planPOST /api/v1/ai/generate-learning-planInput:
- Learning goal
- Estimated total hours
Output:
- Structured JSON learning plan
| Field | Value |
|---|---|
| Endpoint | POST /api/v1/ai/generate-schedule |
| Constraints | No past dates, no conflicts, one session/day, respects time window |
Endpoint: POST /api/v1/ai/apply-schedule
Creates real Google Calendar events from the generated schedule.
Current Status: Moving toward app-owned multi-user OAuth
- User clicks Sign in with Google
- Backend redirects to Google OAuth
- Google returns callback to backend
- Backend creates user session
- Calendar actions run on behalf of the user
- Local/dev-oriented setup
- Production deployment in progress
- Depends on local Ollama availability
- Multi-user support still improving
docker logs -f calsync-backend
docker logs -f calsync-brain
docker logs -f calsync-frontend
docker logs -f calsync-ollamacurl http://localhost:8080/api/v1/calendar/events
docker logs -f calsync-ollamacurl http://localhost:5005/health- Full multi-user Google OAuth
- Persistent database-backed user/session storage
- Secure production session handling
- Better JSON parsing reliability
- Multi-week scheduling
- Adaptive scheduling
- Improved fallback logic
- Gmail integration
- Notes & documents
- Task management
- Full productivity assistant
- HTTPS (SSL)
- Reverse proxy
- Production configs
- Background jobs
Current Model:
- llama3.2:3b (Ollama)
Future:
- Stronger local models
- Tool-using agents
- Retrieval over user data
- Fine-tuning / adapters
MIT License
- Ollama
- Google Calendar API
- FastAPI
- Docker
CalSync AI is evolving into a full personal AI system for:
- Planning
- Scheduling
- Calendar automation
- Workflow assistance
- Intelligent task execution


