Back

Goosey: AI-Powered Microsoft Teams Bot

29 August 2025

Table of Contents

  1. Introduction
  2. The Problem
  3. Solution Overview
  4. Technical Architecture
  5. Teams Capabilities & Commands
  6. AI Integration
  7. Graph & Proactive Messaging
  8. Core Features Deep Dive
  9. Security & Permissions
  10. Deployment & Operations
  11. Challenges & Optimisations
  12. Ideas From the Original Roadmap
  13. Conclusion

Introduction

Goosey was an AI-powered Microsoft Teams bot built to turn busy channels into concise summaries, send automated morning meeting digests, answer internal questions, and add a playful goose persona.

The Problem

  • Teams channels get busy; catching up is hard.
  • Managers need quick visibility of who’s off and what’s coming up.
  • Repetitive questions (docs, bios, timesheets) slow everyone down.

Solution Overview

  • Chat and thread summarisation on-demand.
  • Proactive morning meeting digests in a chosen channel.
  • Quick answers about people, docs, and timesheets.
  • Friendly command help via Adaptive Cards; playful goose persona.

Technical Architecture

Stack

  • Language/Runtime: Node.js (ESM), Restify server
  • Bot framework: BotBuilder SDK with CloudAdapter
  • OpenAI for LLM calls
  • Microsoft Graph for chat history, users, teams/channels, and opted-in calendars
  • Data: lightweight JSON files for state and caches (no database)
  • Scheduling: node-cron for weekday 09:00 digests
  • Process: PM2-managed service with automated deployment via GitHub Actions

Server & Adapter

Restify exposed the Bot Framework messaging endpoint, while BotBuilder's CloudAdapter authenticated and processed incoming Teams activities.

Teams Capabilities & Commands

Capabilities

  • Personal and team bot
  • Adaptive Cards
  • Proactive messages (DMs and channels)

Representative Commands

  • help, introduction
  • summarise [n] – concise summary of recent messages
  • gif [topic] – a quick celebratory GIF
  • who is off, who is [name], use bio info
  • check timesheet [name|anyone], timesheet stats [query]
  • enable my meetings, show meetings, show opted-in users
  • set notification channel – where to post daily digests

AI Integration

  • Provider: OpenAI (chat completions; JSON responses for intent classification)
  • Persona: Helpful, witty goose; prompted to avoid inventing facts
  • Context: Limited conversation history; Graph-backed content when permitted
  • Vision: An experimental image-analysis path for attachments

Graph & Proactive Messaging

Graph Access

  • App credentials flow; token cached in-memory
  • Used for chat/channel history, user lookups, and calendars shared by opted-in users

Proactive Messaging API

  • Stored conversation references when users interacted with the bot
  • The user-listing and proactive direct-message endpoints used a shared API key

Core Features Deep Dive

1. Chat & Thread Summaries

Goosey fetched recent messages (Graph when permitted; otherwise in-memory history) and produced a concise summary.

2. Daily Meeting Digests

The scheduler was configured to post that day’s meetings into a chosen channel at 09:00 on weekdays. Users could opt their calendars in or out individually.

3. Timesheet & People Intelligence

  • Quick checks like “has Alex completed their timesheet?”
  • who is [name] returns a short profile from cached bios + user directory

4. GIFs, Docs, and Image Analysis

  • gif [topic] pulls a lightweight celebratory GIF via Tenor
  • “show documents” routes to common links
  • The code included an experimental vision flow for describing image attachments

Security & Permissions

  • Bot credentials: MicrosoftAppId, MicrosoftAppPassword, MicrosoftAppTenantId
  • The bot used Microsoft Graph application permissions for chat/channel history, user lookups, and calendars; the exact grants were configured outside the repository
  • The /api/users and /api/send-message routes used a shared GOOSEY_API_KEY; /api/messages used Bot Framework authentication, while /api/health was public
  • OpenAI requests could include the current message, limited conversation context, user metadata, selected recent message text for summaries, or a submitted image for vision analysis
  • JSON files stored user metadata, calendar opt-ins, notification-channel configuration, and conversation references

Deployment & Operations

  • PM2-managed Node process
  • GitHub Actions deploy: pull latest, npm install, PM2 restart
  • Environment-driven configuration for Teams IDs and API keys

Challenges & Optimisations

  • Teams attachment auth: tried several attachment-download strategies
  • Graph pagination and token caching
  • Summaries: the summary prompt asked the model not to invent details and to keep the output concise

Ideas From the Original Roadmap

These were ideas recorded while Goosey was active, not a current roadmap.

  • Retries/backoff and rate-limit handling for Graph
  • Telemetry (App Insights/OpenTelemetry) with PII scrubbing
  • Manifest packaging in-repo and per-environment config templates
  • Optional RAG over internal docs with access control

Conclusion

Goosey combined Microsoft Teams bot capabilities, Microsoft Graph data, AI-assisted summarisation, and scheduled updates in one internal tool.