Skip to content

Latest commit

Β 

History

History
102 lines (88 loc) Β· 4.21 KB

README.md

File metadata and controls

102 lines (88 loc) Β· 4.21 KB

LabMate-AI - A AI Assistant for Tinkerers' Lab, PREC Loni

Welcome to the AI Lab Assistant repository of Tinkerers' Lab, PREC Loni! πŸš€ This project is a Spring Boot-based RAG (Retrieval-Augmented Generation) LLM model, designed to assist students and researchers by providing contextual responses based on academic materials, research papers, and lab resources.

✨ Features

  • RAG-Powered AI: Combines retrieval-based search with a powerful LLM for accurate and contextual responses.
  • Spring Boot Backend: A robust and scalable backend built using Java Spring Boot.
  • Vector Database Integration: Uses pgvector with PostgreSQL to store and retrieve embeddings efficiently.
  • Local Embedding Generation: Utilizes nomic-embed-text to generate embeddings without relying on external API keys.
  • PDF Processing: Scans and processes PDFs to extract relevant knowledge for AI-assisted answers.

πŸ“ Repository Structure

β”œβ”€β”€ src/main/java/com/TinkerersLab/LabAssistant  # Backend Spring Boot code
β”‚   β”œβ”€β”€ config/                                 # Configuration files
β”‚   β”œβ”€β”€ controller/                             # REST API controllers
β”‚   β”œβ”€β”€ service/                                # Business logic
β”‚   β”œβ”€β”€ model/                                  # Data models
β”‚   β”œβ”€β”€ util/                                   # Utility functions
β”‚   β”œβ”€β”€ LabAssistantApplication.java            # Application Entrypoint
β”‚
β”œβ”€β”€ data/                                       # PDF and document storage
β”œβ”€β”€ Dockerfile                                  # Docker setup for containerization
β”œβ”€β”€ README.md                                   # Project documentation
β”œβ”€β”€ comose.yaml                                 # Docker configuration of services
β”œβ”€β”€ pom.xml                                     # Project dependency configuration
└── .env                                        # Environment variables

πŸš€ Getting Started

Prerequisites

  • Java 17+
  • Spring Boot 3+
  • PostgreSQL with pgvector
  • Docker (optional, for containerized deployment)
  • Ollama

Installation & Setup

  1. Clone the Repository

    git clone https://github.com/tinkererslab/LabMate-AI.git
    cd LabMate-AI
  2. Set Up the Database

    • Install PostgreSQL and enable pgvector extension.
    • Create a new database and update .env with database credentials.
  3. Run the Application

    ./LabMate-AI/mvnw spring-boot:run

    or

    docker compose up
  4. Add PDF file for context

    cp ~/input-context.pdf /opt/docs/.

    or

    cp data/input.zip /opt/docs;
    cd /opt/docs;
    unzip input.zip

    (you have have multiple pdf files at /opt/docs)

  5. Access the API

    • API runs on http://localhost:8080/api/v1/llm/ask and http://localhost:8080/api/v1/llm/askAndStream?query=this+is+my+query
    • add request body as
    {
       "query": "you query"
    }
  6. Access the UI

πŸ“Œ Future Enhancements

  • Fine-tuning the LLM for improved contextual accuracy.
  • Integration with Chat UI for a seamless user experience.
  • Multi-Document Support to process various academic file formats.

πŸ”„ Customizing for Personal Use

This AI Lab Assistant can be used as a personal AI assistant for any purpose! Simply replace the contents of the input PDF files in the data/ directory with your own documents. The system will process and retrieve information based on your specific files, making it a versatile tool for various applications.

🀝 Contributing

We welcome contributions from the community! Feel free to fork this repository, submit pull requests, or open issues.

πŸ“œ License

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


πŸš€ Built with passion at Tinkerers' Lab, PREC Loni. Let's innovate together! πŸ”₯

Contact

For any inquiries or feedback, please reach out to us at: