Skip to content

Instantly share code, notes, and snippets.

@valarpirai
Last active April 8, 2026 05:43
Show Gist options
  • Select an option

  • Save valarpirai/8e43e6a3acc5794115cd28d52ee99f3e to your computer and use it in GitHub Desktop.

Select an option

Save valarpirai/8e43e6a3acc5794115cd28d52ee99f3e to your computer and use it in GitHub Desktop.
AI Agent integration with Slack bot

Product Requirements Document (PRD)

Product Name: Multi-Agent Slack Bot (OpsBot / AgentHub)
Version: 1.1
Date: April 08, 2026
Author: Grok – AI Agentic Engineer
Status: Revised & Consolidated

1. Executive Summary

The Multi-Agent Slack Bot is an intelligent, extensible automation platform built inside Slack.

It features:

  • A robust Dashboard Agent that automatically scrapes key metrics from a web-based dashboard and delivers formatted reports.
  • An LLM-powered intent router that intelligently routes user requests to the appropriate specialized AI Agent.
  • Support for N number of independent agents (easily extensible).
  • Daily autonomous reporting every day at 6:00 PM IST.
  • Thread-based conversations with short-term memory for natural follow-ups.

The goal is to eliminate manual dashboard checking, reduce operational toil, and turn Slack into a self-serve AI operations hub for the team.

2. Business Objectives

  • Deliver accurate dashboard metrics automatically every evening at 6 PM IST.
  • Enable team members to request metrics and trigger agent actions using natural language.
  • Create a modular platform where new specialized agents can be added quickly.
  • Support contextual follow-up conversations within the same Slack thread.
  • Significantly reduce time spent manually checking dashboards and compiling reports.

3. Key Features

3.1 Core Slack Bot Capabilities

  • Responds to @bot mentions and direct messages.
  • Maintains conversation context within Slack threads.
  • Supports rich formatting using Slack Blocks and emojis.
  • Ready for slash commands (/dashboard, /run-agent, etc.).

3.2 Intelligent Intent Routing

  • Uses LLM (OpenAI GPT-4o-mini or xAI Grok) to classify user intent.
  • Dynamically routes requests to the correct agent based on agent name + description.
  • Graceful fallback with helpful suggestions when intent is unclear.
  • Low-temperature deterministic routing.

3.3 Dashboard Agent (Primary Agent)

  • On-demand mode: Triggered by user messages (e.g., "show dashboard metrics", "run daily report").
  • Scheduled mode: Automatically runs every day at 6:00 PM IST and posts to a configured channel.
  • Uses Playwright to navigate, login (if needed), and scrape metrics.
  • Extracts configurable KPIs using CSS selectors.
  • Formats and sends clean, readable reports to Slack.
  • Includes optional screenshot capture for debugging.

3.4 Multi-Agent Framework

  • All agents inherit from a BaseAgent abstract class.
  • Each agent implements a standard run() method.
  • New agents can be added by creating a new class and registering it (no router changes needed).
  • Agents operate independently with optional thread context.

3.5 Memory & Follow-ups

  • Short-term conversation memory per Slack thread.
  • Supports follow-up questions (e.g., "compare with yesterday", "explain the drop").
  • Designed for easy upgrade to persistent storage (Redis).

3.6 Scheduling

  • Daily cron job at 18:00 IST (Asia/Kolkata timezone).
  • Configurable target channel for autonomous reports.
  • Background scheduler using APScheduler.

4. Discovery & Clarification Questions (Must be Answered Before Implementation)

4.1 Dashboard Scraping

  • What is the exact dashboard URL?
  • Can screenshots or temporary access be provided to inspect page structure and define stable selectors?
  • Does the dashboard offer a REST/GraphQL API (preferred over scraping)?
  • List of exact metrics/KPIs to extract.
  • Authentication method (username/password, SSO, MFA, VPN)?
  • How frequently does the UI change? History of selector breakage?
  • Should screenshots be attached with every report?

4.2 LLM & Routing

  • Preferred LLM provider and model?
  • Any cost, latency, or data privacy constraints?
  • Should rule-based keyword fallback be added?

4.3 Agents & Extensibility

  • What are the next 1–2 agents planned after Dashboard Agent?
  • Is simple intent routing sufficient, or do we need full agentic reasoning (planning, ReAct, tool use)?

4.4 Slack & User Experience

  • Which channels should the bot operate in?
  • Preferred interaction style (mentions only, DMs, slash commands)?
  • Default channel for the daily 6 PM autonomous report?

4.5 Deployment & Operations

  • Preferred deployment target (Docker + VPS, Render, Railway, AWS Lambda, etc.)?
  • Do we need failure alerts via Slack when scraping fails?
  • Any specific security or secret management requirements?

5. Non-Functional Requirements

  • Performance: Bot response < 3s for routing, full scrape < 45s.
  • Reliability: Robust error handling, timeouts, and retry logic.
  • Security: Secrets managed via environment variables; no hard-coded credentials.
  • Scalability: Support multiple agents; horizontal scaling possible.
  • Observability: Detailed logging; optional monitoring and alerts.
  • Maintainability: Clean, modular code structure.

6. Technical Stack (Recommended)

  • Language: Python 3.10+
  • Slack Framework: slack-bolt
  • Scraping: Playwright (Chromium)
  • LLM: OpenAI or xAI Grok API
  • Scheduling: APScheduler
  • Others: python-dotenv, pydantic
  • Optional: Redis (for persistent memory), Docker

7. User Stories

  • As a team member, I can ask "@Bot show me dashboard metrics" and receive the latest report quickly.
  • As an operations lead, I automatically receive the daily 6 PM report in the designated channel.
  • As a developer, I can add a new agent in under 10 minutes.
  • As a user, I can ask follow-up questions in the same thread and get contextual responses.

8. Success Metrics

  • Daily report delivery success rate ≥ 99%
  • Intent routing accuracy ≥ 95%
  • Average response time < 5 seconds
  • New agent addition time ≤ 10 minutes
  • Significant reduction in manual dashboard checking time

9. Assumptions & Risks

Assumptions:

  • Dashboard UI is reasonably stable.
  • Necessary credentials and access can be provided securely.
  • LLM routing will perform reliably with the defined agents.

Risks & Mitigations:

  • Dashboard UI changes breaking selectors → Mitigated by screenshots and early alerts.
  • Authentication failures → Robust login handling and failure notifications.
  • LLM misrouting → Low temperature + fallback messages.
  • High maintenance cost → Preference for API over scraping where possible.

10. Next Steps

  1. Gather answers to all questions in Section 4.
  2. Finalize dashboard selectors and authentication approach.
  3. Implement and test the Dashboard Agent first (highest value + highest risk).
  4. Build the routing layer and base framework.
  5. Add scheduling, memory, and deployment packaging.
  6. Conduct end-to-end testing and go-live.

Approval:

  • Approved for Implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment