Giter Site home page Giter Site logo

nebeyoumusie / end-to-end-rag-project-using-objectbox-and-langchain Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 4.62 MB

In this end to end project I have built a RAG app using ObjectBox Vector Databse and LangChain. With Objectbox you can do OnDevice AI, without the data ever needing to leave the device.

Home Page: https://8512-01hwj8ynshjz7spkr595x77ec2.cloudspaces.litng.ai/

Python 100.00%
groq groq-api huggingface huggingface-embeddings langchain llama3 llama3-rag objectbox pyhton retrieval-augmented-generation

end-to-end-rag-project-using-objectbox-and-langchain's Introduction

End to End RAG Project using ObjectBox and LangChain

  • In this end to end project I have built a RAG app using ObjectBox Vector Databse and LangChain. RAG techniques allow us to augment a language model's knowledge base actively, ensuring your AI can access and reason with your data and the very latest information. With ObjectBox you can do that, without the data ever needing to leave the device.

Streamlit Web App Interface

DEMO

  • You can check the project live here

Description

  • This project showcase the implementation of an advanced RAG system that uses Objectbox vectordatabse and Groq's LLAM3 model as an llm to retrieve information from different PDF documents.

Steps I followed:

  1. I have used the PyPdfDirectoryLoader from the langchain_community document loader to load the PDF documents from the us-census-data directory.
  2. transformed each text into a chunk of 1000 using the RecursiveCharacterTextSplitter imported from the langchain.text_splitter
  3. stored the vector embeddings which were made using the HuggingFaceBgeEmbeddings using the ObjectBox vector store.
  4. setup the llm ChatGroq with the model name Llama3-8b-8192
  5. Setup ChatPromptTemplate
  6. Setup vector_embedding function to enbedd the documents and store them in the ObjectBox vectorstore
  7. finally created the document_chain and retrieval_chain for chaining llm to prompt and retriever to document_chain respectively

Libraries Used

  • langchain==0.1.20
  • langchain-community==0.0.38
  • langchain-core==0.1.52
  • langchain-groq==0.1.3
  • langchain-objectbox
  • python-dotenv==1.0.1
  • pypdf==4.2.0

Installation

  1. Prerequisites
    • Git
    • Command line familiarity
  2. Clone the Repository: git clone https://github.com/NebeyouMusie/End-to-End-RAG-Project-using-ObjectBox-and-LangChain.git
  3. Create and Activate Virtual Environment (Recommended)
    • python -m venv venv
    • source venv/bin/activate
  4. Navigate to the projects directory cd ./End-to-End-RAG-Project-using-ObjectBox-and-LangChain using your terminal
  5. Install Libraries: pip install -r requirements.txt
  6. Navigate to the app directory cd ./app using your terminal
  7. run streamlit run app.py
  8. open the link displayed in the terminal on your preferred browser
  9. As I have already embedded the documents you don't need to click on the Embedd Documents button/ But, if it's not working then you need to click on the Embedd Documents button and wait until the documnets are processed
  10. Enter your question from the PDFs found in the us-census-data directory

Collaboration

  • Collaborations are welcomed ❤️

Acknowledgments

Contact

end-to-end-rag-project-using-objectbox-and-langchain's People

Contributors

nebeyoumusie avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

sampsontan

end-to-end-rag-project-using-objectbox-and-langchain's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.