Coder Social home page Coder Social logo

llm-retrieval-stack's Introduction

LLM Retrieval Stack: Prompt Augmentation for Large Language Models (LLMs) using Semantic Search

Description

This project aims to develop a cloud-based system to embed and store arbitrary user data, facilitating semantic search and retrieval of personal or organizational knowledge for input to GPT-4 and other language models.

Systems like this one are useful for improving the relevance and quality of large language model outputs, as they supply the model with additional context from a knowledge base of the user's choosing - allowing the model's knowledge to be supplemented on the fly. For more information, see the Retrieval-Augmented Generation (RAG) paper.

Advantages over Existing Solutions

ChatGPT Retrieval Plugin

The ChatGPT Retrieval Plugin by OpenAI serves the same purpose: "it allows users to obtain the most relevant document snippets from their data sources, such as files, notes, or emails, by asking questions or expressing needs in natural language. Enterprises can make their internal documents available to their employees through ChatGPT using this plugin."

Advantages of this project:

  • Serverless: this project is deployed serverlessly instead of as a container
    • Improved scalability
    • Cost benefits depend on use case and workload
  • Stream processing: this project processes input as a stream
    • Constant amount of memory required, regardless of input size
    • API requests for chunks in the stream can proceed asynchronously during stream processing, rather than after the entire input is processed
  • Data parallelism: this project splits input into parts (e.g., 1 MB in size) and allocates these parts across an arbitrary number of cloud function instances instead of processing the entire input sequentially
    • More efficient processing of large inputs
  • Coupling to OpenAI services: this project is designed to be extensible to support arbitrary clients, LLMs, and text embedding services instead of only OpenAI services (i.e., ChatGPT web interface and OpenAI embedding models)
  • Storage of original data: this project uses an object storage service (e.g., AWS S3) as a single source of truth for the original data instead of storing it alongside the embeddings in the vector store (e.g., Pinecone, Weaviate)
    • Improved data durability
    • Larger supported uploads
    • Lower costs

Architecture

Project Structure

Getting Started

Prerequisites:

  • SAM CLI
  • AWS account
  • OpenAI API key
  • Pinecone API key

To get started with this project, follow the steps below:

  1. Clone the repository
  2. Run sam deploy --guided in deploy/aws and follow the instructions

Milestone Progress

✅ Milestone 1: Scalable Processing and Storage for Text Embeddings

Goal: Develop a cloud-based system to embed and store arbitrary user data, facilitating semantic search and retrieval of personal or organizational knowledge for input to GPT-4 and other language models.

⬜ Milestone 2: Semantic Search and Prompt Augmentation

Goal: Develop a cloud-based system to perform semantic search and prompt augmentation for large language models (LLMs) using the system developed in Milestone 1.

⬜ Milestone 3: User Interface

Goal: Develop a demo web application to showcase the system developed in previous milestones.

llm-retrieval-stack's People

Contributors

callumcurtis 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.