Backend server for the More Knowledgeable Other (MKO) chatbot - an AI-powered educational assistant based on Vygotsky's sociocultural learning theory.
The MKO Server is an Express.js backend that provides AI chatbot functionality designed around the concept of a "More Knowledgeable Other" - a term from educational psychology referring to someone who has greater knowledge or expertise than the learner and can provide guidance and support.
This server is built to integrate with the Deep Chat component and supports multiple AI service providers as proxies.
- Express.js Backend: Fast and lightweight Node.js server
- AI Service Integration: Supports multiple AI providers including:
- Deep Chat Compatible: Pre-configured to work with Deep Chat UI component
- Educational Focus: Designed specifically for educational chatbot applications
- Proxy Functionality: Can act as a proxy for various AI APIs
The "More Knowledgeable Other" (MKO) is a key concept in Lev Vygotsky's sociocultural theory of learning. An MKO is:
- Someone with greater understanding or higher ability than the learner
- A guide who helps learners navigate their Zone of Proximal Development (ZPD)
- Can be a teacher, peer, parent, or in this case, an AI assistant
- Provides scaffolding and support to help learners achieve tasks they couldn't complete independently
This server implements these educational principles through AI-powered conversational interfaces.
- Node.js (v14 or higher)
- npm or yarn
-
Clone the repository
git clone --depth 1 https://github.com/duncanscode/mko-server.git cd mko-server -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory and add your API keys:OPENAI_API_KEY=your_openai_api_key_here HUGGINGFACE_API_KEY=your_huggingface_api_key_here STABILITY_API_KEY=your_stability_api_key_here COHERE_API_KEY=your_cohere_api_key_here
-
Start the server
npm run start
The server will start running on the default port (typically 3000).
The server uses environment variables to configure API access. Create a .env file with the following variables:
OPENAI_API_KEY: Your OpenAI API key for GPT modelsHUGGINGFACE_API_KEY: Your HuggingFace API key for various modelsSTABILITY_API_KEY: Your StabilityAI API key for image generationCOHERE_API_KEY: Your Cohere API key for language models
This server is pre-configured to work with the Deep Chat UI project. Once both the server and UI are running, they will communicate seamlessly.
The server provides various endpoints for different AI services:
/openai/*- OpenAI proxy endpoints/huggingface/*- HuggingFace proxy endpoints/stability/*- StabilityAI proxy endpoints/cohere/*- Cohere proxy endpoints
Note: Specific endpoint documentation would depend on the actual implementation in the codebase.
fetch('http://localhost:3000/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: 'Help me understand photosynthesis',
context: 'biology lesson'
})
});The MKO server is designed for educational use cases such as:
- Tutoring Sessions: AI acts as a knowledgeable tutor
- Homework Help: Providing guidance without giving direct answers
- Concept Explanation: Breaking down complex topics into understandable parts
- Study Companion: Supporting learning through interactive conversations
mko-server/
├── src/
│ ├── routes/ # API route handlers
│ ├── middleware/ # Express middleware
│ ├── services/ # AI service integrations
│ └── utils/ # Utility functions
├── .env # Environment variables (create this file)
├── package.json # Project dependencies
└── README.md # This file
- Ensure Node.js is installed on your server
- Clone the repository
- Install dependencies with
npm install - Set up your
.envfile with production API keys - Start the server with
npm start
This project embodies Vygotsky's educational principles:
- Social Learning: AI facilitates social interaction around learning
- Zone of Proximal Development: Helps learners achieve more than they could alone
- Scaffolding: Provides structured support that gradually decreases
- Cultural Mediation: Incorporates cultural and contextual learning elements
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on the foundation of Deep Chat
- Deep Chat UI - Frontend component for this server
- Deep Chat Examples - Main Deep Chat repository with examples