Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 AI Study Assistant

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.


✨ Features

  • 📄 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.

🛠️ Tech Stack

Backend (ai-service/)

Frontend (frontend/)

  • Framework: React 19 + Vite + TypeScript
  • UI & Styling: Vanilla CSS with dark mode aesthetic & custom components
  • Markdown Rendering: react-markdown

📁 Repository Structure

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

🚀 Getting Started

Prerequisites

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.

1️⃣ Backend Setup (ai-service)

  1. Navigate to the backend directory:

    cd "AI Study Workspace/ai-service"
  2. Create and activate a virtual environment:

    • Windows:
      python -m venv venv
      .\venv\Scripts\activate
    • macOS / Linux:
      python3 -m venv venv
      source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure environment variables: Create a .env file inside ai-service/ based on .env.example:

    GROQ_API_KEY=your_actual_groq_api_key_here
  5. 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 at http://127.0.0.1:8000/docs.


2️⃣ Frontend Setup (frontend)

  1. Navigate to the frontend directory:

    cd "AI Study Workspace/frontend"
  2. Install dependencies:

    npm install
  3. Start the Vite development server:

    npm run dev

    Open your browser and navigate to http://localhost:5173.


🔌 API Endpoints Summary

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)

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.


📄 License

This project is open source and available under the MIT License.

About

Full-stack AI Study Workspace with PDF RAG search, FastAPI backend, and React TypeScript frontend powered by Groq LLM

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages