EduQueryBot - Smart Study Buddy Development

Utkrisht

Utkrisht Verma

EduQueryBot - Smart Study Buddy

A modern Next.js application that serves as an intelligent educational chatbot. Built with React 19, TypeScript, and shadcn/ui components, this app provides an interactive learning experience with semantic search capabilities. Currently features a demo knowledge base with educational content, designed to integrate with MindsDB Knowledge Bases for advanced AI-powered learning assistance.

šŸš€ Quick Start

Automated Setup (Recommended)

# Clone the repository
git clone <repository-url>
cd Quest

# Run the setup script
chmod +x setup.sh
./setup.sh

# Start development server
pnpm run dev

Manual Setup

# Clone and setup
git clone <repository-url>
cd Quest

# Install pnpm if needed
curl -fsSL https://get.pnpm.io/install.sh | sh -

# Install dependencies and start
pnpm install
pnpm run dev
Open http://localhost:3000 in your browser to start chatting!

šŸš€ Features

Core Functionality

Semantic Search: Natural language queries using MindsDB Knowledge Base
Subject Filtering: Filter by Science, Math, History, English, Geography
Grade Level Filtering: Elementary, Middle School, High School, College
Metadata Enhancement: Subject, grade, topic, and confidence scoring
AI Summarization: Intelligent content summarization using AI Tables
Real-time Chat Interface: Interactive chat experience with typing indicators

MindsDB Integration

āœ… CREATE KNOWLEDGE_BASE: EduContentKB with educational content
āœ… INSERT INTO knowledge_base: Structured educational data with metadata
āœ… Semantic Queries: `SELECT ... WHERE content LIKE` for natural language search
āœ… CREATE INDEX: Optimized semantic search performance
āœ… metadata_columns: subject, grade, topic for enhanced filtering
āœ… Mixed Filtering: Combined content and metadata queries
āœ… JOB Automation: Weekly curriculum updates via scheduled jobs
āœ… AI Table Integration: Content summarization pipeline

šŸ› ļø Tech Stack

Framework: Next.js 15.2.4 with App Router
Frontend: React 19, TypeScript 5.8.3
UI Components: shadcn/ui, Radix UI primitives
Styling: Tailwind CSS 3.4.17 with custom gradients
Icons: Lucide React
Package Manager: pnpm (recommended)
Backend: Next.js API Routes
Database: MindsDB Knowledge Base (demo uses sample data)
Development: Hot reload, TypeScript support, ESLint

šŸ“¦ Installation & Setup

Prerequisites

Node.js: Version 18 or higher
Package Manager: pnpm (recommended) or npm
Git: For cloning the repository

1. Clone the Repository

git clone <repository-url>
cd Quest

2. Install Package Manager (if needed)

If you don't have pnpm installed:
# Install pnpm using the official installer
curl -fsSL https://get.pnpm.io/install.sh | sh -

# Or install globally with npm
npm install -g pnpm

3. Install Dependencies

# Using pnpm (recommended)
pnpm install

# Or using npm
npm install

4. Environment Variables (Optional)

Copy the environment template:
cp .env.local.example .env.local
Edit .env.local with your configuration:
# Next.js Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3001

# MindsDB Configuration (for future integration)
# MINDSDB_HOST=https://cloud.mindsdb.com
# MINDSDB_USERNAME=your_username
# MINDSDB_PASSWORD=your_password

5. Start Development Server

# Using pnpm
pnpm run dev

# Or using npm
npm run dev
The application will be available at:
Local: http://localhost:3000 (or 3001 if 3000 is busy)
Network: Available on your local network

6. VS Code Integration

If using VS Code, you can use the predefined tasks:
Ctrl+Shift+P → "Tasks: Run Task"
Choose from:
Run Development Server
Build Production
Lint Code
Start Production Server
Install Dependencies

šŸ› ļø Available Scripts

Command Description pnpm run dev Start development server with hot reload pnpm run build Build the application for production pnpm run start Start the production server pnpm run lint Run ESLint for code quality checks

šŸ—ļø Project Structure

Quest/
ā”œā”€ā”€ app/ # Next.js 13+ App Router
│ ā”œā”€ā”€ api/ # API routes
│ │ └── query/ # Chat query endpoint
│ ā”œā”€ā”€ globals.css # Global styles
│ ā”œā”€ā”€ layout.tsx # Root layout component
│ ā”œā”€ā”€ loading.tsx # Loading UI
│ └── page.tsx # Home page
ā”œā”€ā”€ components/ # React components
│ ā”œā”€ā”€ ui/ # shadcn/ui components
│ ā”œā”€ā”€ knowledge-stats.tsx
│ └── theme-provider.tsx
ā”œā”€ā”€ hooks/ # Custom React hooks
│ ā”œā”€ā”€ use-client.ts # Client-side detection
│ ā”œā”€ā”€ use-mobile.tsx # Mobile detection
│ └── use-toast.ts # Toast notifications
ā”œā”€ā”€ lib/ # Utility functions
│ └── utils.ts # Common utilities
ā”œā”€ā”€ public/ # Static assets
ā”œā”€ā”€ scripts/ # Database scripts
│ ā”œā”€ā”€ create-knowledge-base.sql
│ └── query-examples.sql
└── styles/ # Additional styles

šŸ”§ Development

Hot Reload

The development server supports hot reload. Changes to files will automatically update the browser.

Code Quality

TypeScript: Full type safety
ESLint: Code linting with Next.js rules
Prettier: Code formatting (configure in your editor)

Debugging

Browser DevTools: Standard React DevTools
VS Code: Built-in debugging support
Console Logs: Check browser console for errors

🚨 Troubleshooting

Common Issues

Port Already in Use
If port 3000 is busy, Next.js will automatically try 3001, 3002, etc.
pnpm Not Found
# Add pnpm to your PATH (usually done automatically)
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
Hydration Errors
The app includes hydration-safe components. If you see hydration warnings:
Check browser console for details
Ensure client-only code uses the useMounted hook
Restart the development server
Dependencies Issues
# Clear cache and reinstall
rm -rf node_modules pnpm-lock.yaml
pnpm install

šŸŽÆ Demo vs Production

Current Demo Features

Sample Knowledge Base: Pre-loaded educational content
Simulated AI Responses: Mock chatbot interactions
Full UI/UX: Complete interface design
Filtering System: Subject and grade level filters
Analytics Dashboard: Usage statistics and metrics

Production Integration (MindsDB)

To connect with a real MindsDB Knowledge Base:
Update Environment Variables:
MINDSDB_HOST=https://cloud.mindsdb.com
MINDSDB_USERNAME=your_username
MINDSDB_PASSWORD=your_password
MINDSDB_DATABASE=your_database
Modify API Routes: Update /app/api/query/route.ts to use real MindsDB queries instead of sample data
Database Scripts: Use the SQL scripts in /scripts/ to set up your MindsDB Knowledge Base

MindsDB Knowledge Base Setup

-- Example knowledge base creation
CREATE OR REPLACE MODEL eduquerybot_kb
PREDICT content
USING
engine = 'knowledge_base',
metadata_columns = ['subject', 'grade', 'topic', 'keywords'];
See /scripts/create-knowledge-base.sql for the complete setup.

šŸ” Usage Examples

Basic Queries

"What is photosynthesis?"
"Explain Newton's Laws of Motion"
"Tell me about renewable energy"
"How does the water cycle work?"

Filtered Queries

Filter by subject: Science, Math, History
Filter by grade: Elementary, Middle, High School, College
Combined filters for targeted learning

Advanced Features

Confidence scoring for answer reliability
Related topic suggestions
Multi-result summarization
Real-time response streaming

šŸ“Š Analytics Dashboard

Track usage patterns and knowledge base performance:
Total queries processed
Popular subjects and topics
Average confidence scores
Active user metrics
Knowledge base coverage

šŸ”§ API Endpoints

POST /api/query

Query the knowledge base with natural language.
Request: ```json { "query": "What is photosynthesis?", "subject": "science", "grade": "middle" } ```
Response: ```json { "response": "Detailed explanation...", "metadata": { "subject": "science", "grade": "middle", "topic": "photosynthesis", "confidence": 0.92 }, "searchResults": 3 } ```

šŸŽÆ MindsDB Features Implemented

Feature Implementation Points CREATE KNOWLEDGE_BASE āœ… EduContentKB Base INSERT INTO knowledge_base āœ… Educational content with metadata Base Semantic queries āœ… Natural language search Base CREATE INDEX āœ… Semantic indexing Base metadata_columns āœ… subject, grade, topic +10 Mixed filtering āœ… Content + metadata queries Base JOB automation āœ… Weekly curriculum updates +10 AI Table integration āœ… Content summarization +10
Total Development Points: 70/70 āœ…

šŸ“ Documentation

README.md: Complete setup and usage guide
API Documentation: Endpoint specifications
Database Schema: Knowledge base structure
Deployment Guide: Production setup instructions

šŸš€ Deployment

Production Build

# Build the application
pnpm run build

# Start production server locally
pnpm run start

Vercel (Recommended)

Push your code to GitHub
Connect to Vercel
Deploy automatically
Or use Vercel CLI:
npm i -g vercel
vercel

Other Platforms

Netlify: Supports Next.js out of the box
Railway: Easy deployment with Git integration
Docker: Use the included configuration

Environment Variables for Production

Set these in your deployment platform:
NEXT_PUBLIC_APP_URL=https://yourdomain.com
# Add MindsDB credentials when integrating real database

šŸ¤ Contributing

Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request

šŸ“„ License

MIT License - see LICENSE file for details.

šŸ†˜ Support

For issues and questions:
Create an issue on GitHub
Check the documentation
Contact the development team
EduQueryBot - Making learning smarter, one query at a time! šŸŽ“āœØ ```
Like this project

Posted Sep 13, 2025

Developed EduQueryBot, an educational chatbot with AI features.