An AI-powered Slack chatbot providing support for Master of Data Science students at UBC.
MDS Compass is a chatbot solution that helps MDS students navigate their academic journey through intelligent assistance. Built on the UBC GenAI Toolkit and integrated with Slack, this tool provides contextual support for common student needs.
This MVP (Phase 1) focuses on:
- Student onboarding assistance
- Technical tooling/installation guidance
- Program policy clarification
MDS Compass uses a Retrieval-Augmented Generation (RAG) approach to provide accurate, context-aware responses:
- Knowledge Base: Curated repository of MDS-specific documentation
- Retrieval System: Semantic search to find relevant information
- Generation Layer: GPT-based response synthesis with retrieved context
- Slack Integration: User-friendly interface within student communication channels
- Human Oversight: Faculty monitoring system for quality control
- Node.js (v16+)
- TypeScript
- Docker & Docker Compose
- Slack API credentials
- OpenAI API key
# Clone the repository
git clone https://github.com/ubc/mds-compass.git
cd mds-compass
# Install dependencies
npm install
# Copy and configure environment variables
cp .env.example .env
# Edit .env with your API keys and configuration
# Build the Docker containers
docker-compose build
# Start the application
docker-compose up -dThe RAG implementation requires a properly structured knowledge base:
-
Organize documents in the
data/docsdirectory by category:onboarding/: Program introduction materialstechnical/: Setup guides and tool documentationpolicies/: Program policies and procedures
-
Run the indexing script to process documents:
npm run index-knowledge-base
-
Verify index creation in the
data/indicesdirectory
Key configuration options in .env:
# API Keys
OPENAI_API_KEY=sk-your-key-here
SLACK_BOT_TOKEN=xoxb-your-token-here
SLACK_SIGNING_SECRET=your-signing-secret
# RAG Configuration
VECTOR_DB_PATH=./data/indices
EMBEDDING_MODEL=text-embedding-ada-002
COMPLETION_MODEL=gpt-4
SIMILARITY_THRESHOLD=0.75
MAX_SOURCES=3
# Application Settings
NODE_ENV=development
LOG_LEVEL=info
HUMAN_OVERSIGHT_CHANNEL=mds-compass-oversight
Once deployed, students can interact with MDS Compass in the dedicated public Slack channel:
- In the public channel:
@MDS Compass What software do I need to install? - All interactions are visible to other students and instructors
- Instructors provide oversight and feedback directly in the same channel
# Run in development mode with hot reloading
npm run dev
# Test the Slack integration locally
npx slack-mock-tester- Add new Markdown/PDF documents to the appropriate category in
data/docs/ - Run
npm run index-knowledge-baseto update indices - Test queries related to new content
Faculty oversight is built into the system:
- Real-time monitoring in the same public channel where students interact
- Instructors can provide corrections or additional information directly in the channel
- Logging dashboard available at
/admin(requires admin credentials) - Weekly digest reports of common questions and issues
- No student identifiable data is sent to external LLM services
- All interactions are logged with appropriate privacy controls
- System complies with UBC data governance policies
- See
PRIVACY.mdfor complete privacy documentation
- Phase 1 (Current): Onboarding & Technical Setup
- Phase 2 (Future): Academic Support
- Phase 3 (Future): Career Development
See CONTRIBUTING.md for guidelines on contributing to the project.
This project is licensed under the MIT License - see the LICENSE file for details.
- UBC Learning Technology Hub
- UBC GenAI Toolkit Team
- Master of Data Science Program
flowchart TD;
subgraph "User Interface"
A[Students] -->|Questions| B[Public MDS Slack Channel]
I1[Instructors] -->|Oversight & Feedback| B
end
subgraph "MDS Compass Core"
B -->|API Request| C[Request Handler]
C -->|Query| D[Query Processor]
subgraph "RAG Pipeline"
D -->|Processed Query| E[Embedding Generator]
E -->|Vector Embedding| F[Vector Database]
F -->|Retrieved Documents| G[Context Assembler]
subgraph "Knowledge Base"
KB1[Onboarding Documents]
KB2[Technical Setup Guides]
KB3[Program Policies]
end
KB1 -.->|Indexed Content| F
KB2 -.->|Indexed Content| F
KB3 -.->|Indexed Content| F
G -->|Assembled Context| H[LLM Prompt Constructor]
H -->|Prompt with Context| I[GPT API]
I -->|Generated Response| J[Response Filter]
end
J -->|Filtered Response| K[Response Handler]
end
K -->|Final Response| B
B -.->|Visible to All| A
B -.->|Visible to All| I1
classDef primary fill:#d1e7dd,stroke:#198754,stroke-width:2px
classDef secondary fill:#cff4fc,stroke:#0dcaf0,stroke-width:2px
classDef tertiary fill:#f8d7da,stroke:#dc3545,stroke-width:2px
classDef knowledge fill:#e2e3e5,stroke:#212529,stroke-width:1px
class A,B,I1 primary
class C,D,E,F,G,H,I,J,K secondary
class KB1,KB2,KB3 knowledge