Watch demo - Video
A privacy-focused scheduling agent that runs 100% locally on your machine.
Most AI tools send your chat logs to the cloud (OpenAI, Anthropic, etc.). This bot uses Ollama to run the AI model (Llama 3.2) on your own laptop. It listens to Slack via Socket Mode (no port forwarding needed) and updates your Google Calendar via a simple Apps Script.
The Logic: Slack (Chat) β‘οΈ Python (Local AI Analysis) β‘οΈ Google Apps Script (Calendar API)
Before running the code, you need these installed on your machine:
- Python 3.10+
- Ollama (to run the AI model)
- A Google Account (for Calendar)
- A Slack Workspace (where you have admin rights to add apps)
We use the Llama 3.2 model because it's lightweight (3B parameters) and runs fast even on laptops with 8GB RAM.
- Download Ollama from ollama.com.
- Open your terminal/command prompt.
- Run this command to download and start the model:
(Note: If your laptop is very old, try
ollama run llama3.2
ollama run llama3.2:1bfor a faster, smaller version.) - Type "Hello" to check if it's working. If it replies, close the terminal.
We use Google Apps Script so we don't have to deal with complex Google Cloud OAuth setups.
- Go to script.google.com.
- Click New Project.
- Open the file
apps_script_backend.jsfrom this repo, copy the code, and paste it into the editor (replace the default function). - Deploy it:
- Click the blue Deploy button > New deployment.
- Select type: Web app.
- Description: "Scheduler Backend".
- Execute as: Me (your email).
- Who has access: Anyone (Important: This allows the Python script to talk to it).
- Click Deploy.
- Copy the Web App URL (It ends with
/exec). You will need this later.
We use Socket Mode so you don't need ngrok or public IPs.
- Go to api.slack.com/apps and click Create New App > From Scratch. Name it "SchedulerBot".
- Enable Socket Mode:
- Click Socket Mode in the sidebar.
- Toggle it ON.
- Create an App-Level Token. Name it
sock_token. - Copy the
xapp-...token.
- Add Permissions:
- Click OAuth & Permissions.
- Scroll to Bot Token Scopes and add these three:
app_mentions:readchat:writereactions:write
- Scroll up and click Install to Workspace.
- Copy the
xoxb-...token.
- Enable Events:
- Click Event Subscriptions in the sidebar.
- Toggle it ON.
- Open "Subscribe to bot events" and add
app_mention. - Click Save Changes.
- Clone this repo or download the
agent.pyfile. - Install the required libraries:
pip install slack_sdk ollama requests
- Open
agent.pyin a text editor (VS Code, Notepad, etc.). - Fill in your keys at the top of the file:
SLACK_APP_TOKEN = "xapp-..." # From Step 3 SLACK_BOT_TOKEN = "xoxb-..." # From Step 3 APPS_SCRIPT_URL = "https://..." # From Step 2
- Open your terminal.
- Navigate to the folder containing the script.
- Run the agent:
python agent.py
- You should see:
π΄ Agent is Online...
How to use:
Go to your Slack workspace, invite the bot to a channel (/invite @SchedulerBot), and say:
"@SchedulerBot Schedule a meeting with Dave tomorrow at 10am"
The bot will react with π, think for a few seconds, and then confirm the booking.
- Bot doesn't reply? Check if
ollamais running in the background. - "Error connecting to Calendar"? Check if your Apps Script URL is correct and deployed as "Anyone".
- Hallucinating dates? Small models (3B) sometimes struggle with math. If it gets the date wrong, try being more specific (e.g., "next Friday") or check the prompt logic in
agent.py.
Free to use. Built for learning purposes.