Git Product home page Git Product logo

rag-with-url's Introduction

LLM x Website URLs

Most of the language models like GPT 4 and even Gemini Pro have the issue of not having the latest information considering they were trained with a set of data for pretraining.

In cases ,We may need to access real-time information from websites to get up-to-date information. LLMs do not have this functionality by default. But through Retrieval Augmented Generation(RAG), we can allow them to access the data that we provide.

Here, we use Langchain's Webloader and get the data from the site and store the data into a vectorstore, from where we can get the necessary answers for our queries.

Usage Instructions:

  1. Install Dependencies:

    pip install -r requirements.txt
  2. Run the Application:

    python main.py
  3. Access the Gradio Interface:

    • Open your web browser and navigate to the provided URL.
  4. Input Parameters:

    • Query: Enter your question or input.
    • URL: Provide the website URL for context.
    • OpenAI Key: Enter your OpenAI key for authentication.
  5. Interact with the Chatbot:

    • Receive responses based on your input and website context.

Code Overview:

  • main.py: Python script containing the main application code.
  • Functions:
    • getvecstore(url): Retrieves a vector store from the given website URL.
    • getcontext(vector_store): Obtains a context-aware retriever chain.
    • getragchain(retriever_chain): Retrieves a conversational RAG (Retrieval-Augmented Generation) chain.
    • getresp(user_input, website_url): Gets a response from the chatbot based on user input and website URL.
    • interact(Query, URL, OpenAI_Key): Function to interact with the chatbot through Gradio interface.

Future Improvements:

For future enhancements, I am considering incorporating a complete local and private workflow using the following technologies:

  • Ollama for Embeddings: Explore the use of Ollama for embeddings to enhance local processing and privacy.
  • LLM (Language Model): The use of local LLM inference through LM Studio and Ollama can be added to make it completely private to our system alone.

Important Note:

  • Keep your OpenAI key secure and avoid sharing it publicly.
  • Implement additional security measures for handling sensitive information.

Feel free to explore and contribute to the codebase for further improvements and customization.

rag-with-url's People

Contributors

abishek-ctrl avatar

Watchers

 avatar

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.