Skip to content

feat: add Slack and Discord Moss Q&A demo#397

Open
hasnainkhatri87 wants to merge 2 commits into
usemoss:mainfrom
hasnainkhatri87:fix/384-slack-discord-qa-demo
Open

feat: add Slack and Discord Moss Q&A demo#397
hasnainkhatri87 wants to merge 2 commits into
usemoss:mainfrom
hasnainkhatri87:fix/384-slack-discord-qa-demo

Conversation

@hasnainkhatri87

@hasnainkhatri87 hasnainkhatri87 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read the CONTRIBUTING guide.
  • I have updated the documentation.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have added tests that prove the feature works.
  • New tests pass locally with my changes.

Description

Summary

Adds a community demo that answers workspace questions in Slack and Discord using a shared Moss retrieval pipeline.

Implementation

  • Adds a Slack Socket Mode adapter that responds to app mentions in threads.
  • Adds a Discord adapter that responds to !ask messages and direct bot mentions.
  • Shares a bounded Moss context builder and OpenAI-compatible answer generator between both adapters.
  • Documents setup, environment variables, and platform configuration.
  • Adds credential-free unit tests for message extraction and answer-engine behavior.

Testing

  • uv run pytest — 8 passed
  • uv run ruff check . — passed
  • uv run ruff format --check . — passed
  • Python compilation — passed

Compatibility and risk

This is an additive experimental demo under moss-live-labs/community-demos. Live Slack/Discord behavior requires platform credentials and a configured Moss index; those external integrations were not exercised locally.

Fixes #384

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • This change includes a documentation update

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an experimental community demo under moss-live-labs/community-demos/slack-discord-qa that answers workspace questions in Slack (Socket Mode app_mention) and Discord (!ask / bot mentions) using a shared Moss retrieval + OpenAI-compatible answering pipeline.

Changes:

  • Introduces Slack and Discord adapters that extract questions and post threaded replies.
  • Adds a shared AnswerEngine with bounded context construction and pluggable retriever/responder protocols.
  • Adds demo documentation, environment templates, packaging (pyproject.toml), and credential-free unit tests.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
moss-live-labs/community-demos/slack-discord-qa/moss_slack_discord/adapters.py Slack/Discord event adapters + question extraction logic
moss-live-labs/community-demos/slack-discord-qa/moss_slack_discord/qa_engine.py Shared retrieval/response engine and bounded context builder
moss-live-labs/community-demos/slack-discord-qa/moss_slack_discord/app.py App wiring: env loading, Moss index load, OpenAI responder, adapter startup
moss-live-labs/community-demos/slack-discord-qa/tests/test_adapters.py Unit tests for Slack/Discord message extraction
moss-live-labs/community-demos/slack-discord-qa/tests/test_qa_engine.py Unit tests for context building + answer engine behavior
moss-live-labs/community-demos/slack-discord-qa/README.md Setup/configuration documentation for Slack + Discord
moss-live-labs/community-demos/slack-discord-qa/pyproject.toml Demo package metadata, dependencies, script entrypoint, pytest config
moss-live-labs/community-demos/slack-discord-qa/moss_slack_discord/init.py Package marker / module docstring
moss-live-labs/community-demos/slack-discord-qa/.env.example Example environment variables for Moss/OpenAI/Slack/Discord
moss-live-labs/community-demos/slack-discord-qa/.gitignore Ignores local env/venv/test caches

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread moss-live-labs/community-demos/slack-discord-qa/moss_slack_discord/adapters.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demo: Slack / Discord Q&A bot

2 participants