An AI-powered teaching and learning companion designed for job and academic preparation, with specialized support for Bangladesh's National Curriculum and Textbook Board (NCTB) materials.
- RAG (Retrieval Augmented Generation): Intelligent document processing and question-answering system
- NCTB Book Support: Specialized support for Class 9-10 textbooks from Bangladesh's NCTB curriculum
- Notebook Integration: Upload and query your own educational documents
- Multi-language Support: Answers in Bengali or English based on the source material
- FastAPI Backend: Robust REST API for document processing and queries
- Vector Search: FAISS-based semantic search for accurate document retrieval
- FastAPI: Modern Python web framework
- LangChain: LLM orchestration and document processing
- FAISS: Vector similarity search
- OpenRouter API: LLM integration
- Sentence Transformers: Text embeddings
- PyPDF2: PDF document processing
- Next.js: React framework
- TypeScript: Type-safe development
- Clerk: Authentication
- Arcjet: Security
sphere/
├── backend/ # FastAPI backend application
│ ├── app/
│ │ ├── api/ # API routes
│ │ │ ├── notebook.py
│ │ │ ├── class_9_10.py
│ │ │ └── router.py
│ │ ├── services/ # Business logic
│ │ │ ├── document_processor.py
│ │ │ ├── vector_store.py
│ │ │ ├── llm_service.py
│ │ │ ├── notebook.py
│ │ │ └── class_9_10.py
│ │ ├── models/ # Data models and schemas
│ │ ├── data/ # Documents and vector indexes (gitignored)
│ │ └── main.py # FastAPI application entry point
│ └── requirements.txt
├── src/ # Next.js frontend
└── README.md
- Python 3.8+
- Node.js 18+
- OpenRouter API key (for LLM services)
-
Navigate to the backend directory:
cd backend -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the backend directory:OPENROUTER_API_KEY=your_openrouter_api_key_here OPENROUTER_MODEL=openai/gpt-oss-120b:free
-
Run the FastAPI server:
cd app uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at
http://localhost:8000- API Documentation:
http://localhost:8000/docs - Health Check:
http://localhost:8000/
- API Documentation:
-
Install dependencies:
npm install # or yarn install # or pnpm install
-
Set up environment variables: Create a
.env.localfile with your configuration:NEXT_PUBLIC_API_URL=http://localhost:8000
-
Run the development server:
npm run dev # or yarn dev # or pnpm dev
Open http://localhost:3000 in your browser.
POST /api/v1/notebook/upload- Upload and process documentsPOST /api/v1/notebook/query- Query uploaded documentsGET /api/v1/notebook/documents- List uploaded documents
POST /api/v1/class-9-10/query- Query NCTB Class 9-10 textbooksGET /api/v1/class-9-10/documents- List available textbooks
- Supports PDF, TXT, and MD file formats
- Automatic text extraction and chunking
- Semantic embedding generation
- Vector index creation for fast retrieval
- Natural language question processing
- Context-aware retrieval from documents
- Multi-language response generation
- Curriculum-aligned answers for NCTB materials
- FAISS-based similarity search
- Automatic index persistence
- Support for multiple document collections
- Efficient retrieval of relevant document chunks
- The backend uses FastAPI with automatic API documentation
- Services are modular and can be extended
- Vector indexes are stored in
backend/app/data/faiss_index/ - Uploaded documents are stored in
backend/app/data/documents/
- Create a new service file in
backend/app/services/ - Create corresponding API routes in
backend/app/api/ - Register the router in
backend/app/api/router.py
OPENROUTER_API_KEY: Your OpenRouter API key (required)OPENROUTER_MODEL: LLM model to use (default:openai/gpt-oss-120b:free)
NEXT_PUBLIC_API_URL: Backend API URL
.env files to version control. They are already included in .gitignore.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For issues, questions, or contributions, please open an issue on GitHub.
Built with ❤️ for students and educators in Bangladesh