An intelligent, full-stack AI-powered study workspace built to elevate learning efficiency. The platform enables students and researchers to upload PDF documents, extract intelligent context using Retrieval-Augmented Generation (RAG), and engage in interactive, context-aware conversations powered by the Groq LLM API.
- 📄 PDF Document Processing: Instant PDF text extraction and chunking.
- ⚡ RAG Engine (Retrieval-Augmented Generation): Uses FAISS vector storage & HuggingFace Embeddings for semantic document retrieval.
- 🤖 Groq LLM Integration: Ultra-fast responses powered by Groq's high-performance LLM infrastructure (
llama-3.3-70b-versatile). - 💬 Interactive Chat UI: Modern, responsive React frontend with Markdown rendering, math formula support, and real-time streaming feedback.
- 🧹 Context Clearance: Easily reset uploaded document context or start fresh study sessions.
- 🌐 RESTful API: FastAPI backend with clean routing, CORS support, and robust error handling.
- Framework: FastAPI
- LLM Provider: Groq API (
groq) - Vector Search: FAISS (
faiss-cpu) - Embeddings: Sentence-Transformers (
all-MiniLM-L6-v2) - PDF Parser:
PyPDF - Environment: Python 3.10+
- Framework: React 19 + Vite + TypeScript
- UI & Styling: Vanilla CSS with dark mode aesthetic & custom components
- Markdown Rendering:
react-markdown
project_Hemant_and_Ayush/
├── AI Study Workspace/
│ ├── ai-service/ # FastAPI Backend Service
│ │ ├── app/
│ │ │ ├── routes/ # API Routers (chat.py, pdf.py)
│ │ │ ├── services/ # Core Business Logic (llm.py, rag.py, pdf_loader.py)
│ │ │ ├── config.py # Configuration & Environment Variables
│ │ │ └── main.py # FastAPI Entry Point
│ │ ├── .env.example # Environment Variable Template
│ │ ├── requirements.txt # Python Dependencies
│ │ └── .gitignore
│ │
│ └── frontend/ # React + Vite Frontend App
│ ├── src/
│ │ ├── components/ # React Components (Chat, PDFUpload, MessageList, ChatInput)
│ │ ├── services/ # API Axios/Fetch Integration (api.js)
│ │ ├── App.tsx # Main App Component
│ │ └── index.css # Global Styles & Theme
│ ├── package.json # Frontend Dependencies
│ └── vite.config.ts # Vite Configuration
│
├── .gitignore # Root Git Ignore
└── README.md # Project Documentation
Ensure you have the following installed on your machine:
- Python 3.10+
- Node.js 18+ & npm
- Groq API Key: Obtain a free key from the Groq Console.
-
Navigate to the backend directory:
cd "AI Study Workspace/ai-service"
-
Create and activate a virtual environment:
- Windows:
python -m venv venv .\venv\Scripts\activate
- macOS / Linux:
python3 -m venv venv source venv/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables: Create a
.envfile insideai-service/based on.env.example:GROQ_API_KEY=your_actual_groq_api_key_here
-
Start the FastAPI server:
uvicorn app.main:app --reload --port 8000
The backend API will be available at
http://127.0.0.1:8000. You can view interactive API docs athttp://127.0.0.1:8000/docs.
-
Navigate to the frontend directory:
cd "AI Study Workspace/frontend"
-
Install dependencies:
npm install
-
Start the Vite development server:
npm run dev
Open your browser and navigate to
http://localhost:5173.
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Health check endpoint |
POST |
/api/v1/pdf/upload |
Upload a PDF file to process and build vector index |
POST |
/api/v1/pdf/clear |
Clear active document context from vector index |
POST |
/api/v1/chat |
Send prompt to Groq LLM (with or without PDF context) |
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
This project is open source and available under the MIT License.