BiocBot is an AI-powered study assistant platform that enables students to interact with course material in a chat-based format. Instructors can upload documents (PDFs, DOCX, or TXT), which are automatically parsed, chunked, and embedded into a vector database (Qdrant) for semantic search. When a student asks a question, the system retrieves relevant chunks and generates a response grounded in course content.
- Document Management: Upload and organize course materials per lecture/unit
- Vector Search: Semantic search across documents using Qdrant
- AI Chat Interface: RAG-powered student chat with tutor and protege modes
- Per-Course Retrieval Mode: Instructor-controlled additive vs single-unit retrieval for chat
- Quiz Practice System: Self-paced AI-graded quizzes with attempt history
- Assessment Questions: Create and manage multiple-choice, true/false, and short-answer questions
- Flagging System: Students flag issues with questions; instructors review and respond
- Student Struggle Tracking: Activity logging to monitor and surface struggling students
- Course Structure: Organize content by units/lectures with publish controls
- User Management: Separate interfaces for instructors, TAs, and students
- TA Management: Instructors promote students to TAs with scoped permissions
- Onboarding Wizard: Guided AI-assisted course setup for instructors
- SAML / UBC CWL Auth: Shibboleth integration alongside local username/password auth
- User Agreement: Modal-gated terms acceptance before platform access
- Session Idle Timeout: Automatic logout after inactivity
BiocBot follows a split architecture with a public frontend and a private backend, adhering to clear separation of concerns for maintainability and security.
- Frontend: HTML + Vanilla JS (no frameworks), styled via separate CSS files
- Backend: Node.js (Express 5), built with modular architecture
- Database: MongoDB (documents, user sessions, analytics, quiz attempts)
- Vector Database: Qdrant for semantic search and similarity retrieval
- Embeddings: UBC GenAI Toolkit with OpenAI (text-embedding-3-small)
- Authentication: Passport.js — local strategy + SAML / UBC Shibboleth
- Node.js v18.x or higher
- MongoDB instance
- Qdrant vector database (Docker recommended)
- OpenAI API key
git clone <repository-url>
cd tlef-biocbot
npm installCreate a .env file in the root directory with the following variables:
# MongoDB Connection
MONGO_URI=mongodb://localhost:27017/biocbot
# Server Port
TLEF_BIOCBOT_PORT=8080
# Qdrant Configuration
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=super-secret-dev-key
# Embeddings Provider Configuration
EMBEDDING_PROVIDER=ubc-genai-toolkit-llm
# LLM Provider Settings
LLM_PROVIDER=openai
LLM_API_KEY=your-openai-api-key
OPENAI_MODEL=gpt-4.1-mini
LLM_EMBEDDING_MODEL=text-embedding-3-smalldocker run -p 6333:6333 qdrant/qdrantnpm run dev- Access: Navigate to
/instructor - Onboarding: Complete the guided course setup wizard (AI-assisted topic extraction)
- Upload Documents: Add course materials to units/lectures
- Create Questions: Build multiple-choice, true/false, and short-answer assessments
- Publish Units: Make content available to students
- Quiz Settings: Enable quiz practice, select testable units, and control material access for failed answers
- Retrieval Mode: On the course Home page, toggle "Use additive retrieval" to allow chat to include earlier published units in addition to the selected unit. When off, chat uses only the selected unit.
- Manage TAs: Promote students to TAs via the TA Hub; assign course and flag permissions
- Review Flags: View and respond to student-flagged question issues
- Monitor Students: Use the Student Hub to review engagement and struggle activity
- Access: Navigate to
/student - Agreement: Accept the user agreement on first login
- Course Selection: Choose your course
- Chat Interface: Select a unit, then ask questions about course material
- Quiz Practice: Practice assessment questions with immediate AI feedback and attempt history
- Flag Questions: Report unclear or incorrect questions for instructor review
- Chat History: Review past conversations
- Access: Navigate to
/ta - Onboarding: Complete TA onboarding
- Settings: Configure TA-specific options
- Flagged Questions: Review and respond to flagged questions (if permitted)
BiocBot uses Qdrant for vector-based semantic search:
- Automatic Document Processing: Documents are automatically chunked, embedded, and stored on upload
- Semantic Search: Find relevant content using natural language queries
- Course-Aware Search: Filter results by course and lecture
- Real-time Indexing: New documents are immediately searchable
GET /api/qdrant/status— Check Qdrant service statusPOST /api/qdrant/process-document— Process and store a documentPOST /api/qdrant/search— Semantic search across documentsDELETE /api/qdrant/document/:id— Delete document chunksGET /api/qdrant/collection-stats— Get collection statistics
Visit /qdrant-test to test the Qdrant functionality interactively.
tlef-biocbot/
├── public/ # Frontend assets
│ ├── common/
│ │ └── scripts/ # Shared scripts (auth, login, idle-timer, etc.)
│ ├── instructor/ # Instructor interface
│ │ ├── scripts/ # home, settings, onboarding, ta-hub, student-hub, ...
│ │ └── *.html
│ ├── student/ # Student interface
│ │ ├── scripts/ # dashboard, quiz, history, flagged, ...
│ │ └── *.html
│ ├── ta/ # TA interface
│ │ ├── scripts/
│ │ └── *.html
│ └── qdrant-test.html # Qdrant testing page
├── src/ # Backend source
│ ├── config/ # Passport, app config
│ ├── middleware/ # Auth middleware (requireAuth, requireRole, etc.)
│ ├── models/ # MongoDB models
│ ├── routes/ # API route handlers
│ ├── services/ # Business logic (LLM, Qdrant, auth, tracker)
│ └── server.js # Main server entry point
└── documents/ # Project documentation
| Model | Collection | Purpose |
|---|---|---|
Course |
courses |
Course metadata, lecture structure, quiz settings |
User |
users |
Accounts, roles, preferences, struggle state |
Document |
documents |
Uploaded files and parsed content |
Question |
embedded in Course | MC, TF, and short-answer questions per lecture |
QuizAttempt |
quizAttempts |
Per-student quiz attempt records |
FlaggedQuestion |
flaggedQuestions |
Student-reported question issues |
StruggleActivity |
struggleActivity |
Student struggle state transitions |
UserAgreement |
useragreements |
Terms acceptance records |
- LLMService (
src/services/llm.js): AI chat responses and short-answer evaluation via UBC GenAI Toolkit - QdrantService (
src/services/qdrantService.js): Vector DB indexing and semantic search - AuthService (
src/services/authService.js): User registration, login, preferences - TrackerService (
src/services/tracker.js): Student engagement and struggle tracking - prompts (
src/services/prompts.js): System prompt management (base, tutor, protege, quizHelp modes)
requireAuth— Must be logged inrequireStudent/requireInstructor/requireInstructorOrTA— Role-based accessrequireStudentEnrolled— Must be enrolled in the requested courserequireTAPermission(permission)— TA-scoped permission checks
ISC License