EngE-AI is an AI-powered learning assistant for UBC Engineering courses which emphasizes on developing student's critical thinking.
- Course creation and management
- Document upload (PDF, DOCX) for RAG
- Learning objectives and materials
- Flags management and responses
- Student chat monitoring
- Assistant and system prompts configuration
- Course-aware AI chat
- Flag creation ("I'm struggling")
- Flag history
- Access to course materials and objectives
- Vector search (Qdrant)
- Streaming chat responses
- Session-based authentication
- MongoDB for courses and users
- Custom UBC Shibboleth SAML 2.0 authentication strategy for Passport.js
- Node.js (v18+)
- MongoDB (running and accessible)
- Qdrant (vector database)
- LLM endpoint (e.g. Ollama or other provider)
- SAML (optional): IdP metadata, issuer, callback URL for CWL auth. For local development, use docker-simple-saml as a containerized IdP.
-
Clone the repo:
git clone https://github.com/ubc/tlef-engeai.git cd tlef-engeai -
Install dependencies:
npm install
-
Create a
.envfile in the project root (see Environment Variables below). -
Run the application:
- Development:
npm run dev(nodemon + BrowserSync) - Production:
npm start
- Development:
| Group | Variables |
|---|---|
| Server | TLEF_ENGE_AI_PORT (default 8020) |
| MongoDB | MONGO_HOST, MONGO_PORT, MONGO_USERNAME, MONGO_PASSWORD, MONGO_AUTH_SOURCE, MONGO_DB_NAME |
| Qdrant | QDRANT_URL, QDRANT_COLLECTION_NAME, QDRANT_VECTOR_SIZE, QDRANT_DISTANCE_METRIC, QDRANT_API_KEY (optional) |
| LLM | LLM_PROVIDER, LLM_ENDPOINT, LLM_DEFAULT_MODEL, LLM_API_KEY |
| Embeddings | EMBEDDING_PROVIDER, EMBEDDINGS_ENDPOINT, EMBEDDINGS_MODEL |
| RAG | RAG_CHUNK_SIZE, RAG_OVERLAP_SIZE, RAG_CHUNKING_STRATEGY, RAG_MIN_CHUNK_SIZE |
| SAML | SAML_AVAILABLE, SAML_ISSUER, SAML_CALLBACK_URL, SAML_ENTRY_POINT, SAML_LOGOUT_URL, SAML_METADATA_URL, SAML_ENVIRONMENT |
| Session | SESSION_SECRET, SESSION_TIMEOUT_MS |
| Optional | DEBUG, DEVELOPING_MODE (mock LLM), instructor PUID overrides |
| Role | Name |
|---|---|
| Principal Investigator | Alireza Bagherzadeh — Associate Professor of Teaching, CHBE |
| Co-Investigator | Amir M. Dehkhoda — Assistant Professor of Teaching, Materials Engineering |
| Software Developer | Richard Tape |
| Software Developer | Charisma Rusdiyanto |
- Fork the repo
- Create a feature branch
- Follow existing code style (TypeScript, Express patterns)
- Submit a pull request
For API reference, see documentation/ENDPOINT_ARCHITECTURE.md.
- Endpoint Architecture
- Responsive Design
- docker-simple-saml — Containerized SAML 2.0 IdP for local development
Pushing to the main branch in this repo will trigger a deploy automatically to the staging server.