An open API service indexing awesome lists of open source software.

https://github.com/Siyamuddin/AiBuddy

This project is a Java-SpringBoot-based backend application that uses RAG(Retrieval-Augmented Generation) which is going to change the way students engage with class materials. The application will use AI technology to assist students in understanding lecture topics and preparing for exams.
https://github.com/Siyamuddin/AiBuddy

ai docker-compose java jwt-authentication langchain4j llama3 mysql-database ollama rag spring-boot spring-security swagger-ui

Last synced: about 1 year ago
JSON representation

This project is a Java-SpringBoot-based backend application that uses RAG(Retrieval-Augmented Generation) which is going to change the way students engage with class materials. The application will use AI technology to assist students in understanding lecture topics and preparing for exams.

Awesome Lists containing this project

README

          

# AI-Powered Student Study Aid with RAG (Retrieval-Augmented Generation)

This project provides a Java-based backend application leveraging Retrieval-Augmented Generation (RAG) to transform the way students engage with lecture materials. Using advanced AI models, the application assists students in understanding topics and preparing for exams by generating exam-ready content from lecture slides.

## 📑 Project Overview

The system enables students to upload lecture slides in PDF format, query information directly from these slides using AI, and receive autogenerated exam preparation materials such as multiple-choice questions (MCQs) and short-answer questions. By harnessing RAG, it retrieves the most relevant slide sections for student queries, offering clear and contextually appropriate responses.

## 🛠️ Technologies Used

- **Programming Language**: Java
- **Framework**: Spring Boot
- **Database**: MySQL
- **Security**: JWT (JSON Web Tokens) for secure login and logout functionality
- **AI Model**: Ollama (Llama-3.2) open-source model
- **Libraries**:
- Apache PDFBox for PDF handling
- Langchain4j (Java library for RAG operations)
- **User Interface**: Swagger UI for API documentation and exploration

## 🌟 Features

### 1. Class Management
- **Create Classes**: Students can create and manage classes within the application.
- **Upload Materials**: Lecture slides can be uploaded in PDF format for AI-driven analysis.

### 2. AI-Powered Study Assistance
- **Text Extraction & Segmentation**: Uploaded PDFs are converted to text and segmented into manageable sections.
- **Vector Embeddings**: Text segments are transformed into vector embeddings using Langchain4j, stored in an in-memory embedding store for efficient retrieval.
- **Retrieval-Augmented Generation (RAG)**: Upon a student's query, the system retrieves the most relevant lecture sections and provides AI-generated responses, helping students understand complex topics.

### 3. Exam Preparation Assistance
- **Automatic Summarization**: Summarizes uploaded lecture content automatically.
- **MCQ and Short Answer Generation**: Generates potential MCQs and short-answer questions from slide content to aid in exam preparation.

### 4. User Authentication
- **JWT-Based Security**: Secure login and logout features with JWT tokens to manage user sessions and prevent unauthorized access.

### 5. API Documentation with Swagger UI
- **Interactive Documentation**: Swagger UI enables developers and users to explore API endpoints, execute requests, and view real-time responses within a user-friendly interface.

## 🛠️ Implementation Details

- **Spring Boot**: Facilitates REST API development, handling core logic, routing, authentication, and backend services.
- **Langchain4j for RAG**: Manages text segmentation into embeddings, retrieves relevant segments, and integrates responses using the Llama-3.2 AI model.
- **MySQL**: Stores user data, class info, lecture materials, and AI-generated content.
- **JWT**: Secures API access by managing user authentication and authorization.
- **Swagger UI**: Provides an interactive interface to test and understand the API endpoints.

## 🚀 Getting Started

### Prerequisites
- Java Development Kit (JDK) 11 or later
- MySQL
- Maven or Gradle for dependency management

### Installation

1. **Clone the Repository**:
```bash
https://github.com/Siyamuddin/RAG_and_Langchain4j
cd RAG_and_Langchain4j
```

2. **Set Up MySQL Database**:
- Create a new MySQL database.
- Update database configurations in `application.properties`.

3. **Build the Application**:
```bash
mvn clean install
```

4. **Run the Application**:
```bash
mvn spring-boot:run
```

5. **Access Swagger UI**:
Navigate to `http://localhost:8080/swagger-ui.html` to explore the API endpoints.

## 🤝 Contributions

Contributions are welcome! Feel free to open issues, submit pull requests, or suggest features.