Skip to content

erickasakya/langchain-rag-app

Repository files navigation

Retrieval-Augmented Generation (RAG) APP

Overview

This application allows users to upload a document and ask questions against the document. The application uses Langchain, GroQ LLM, Azure OpenAI embeddings and Retrieval-Augmented Generation (RAG).

APP Features

  • Load: Document ingestion
  • Split: Document chunking using semantic chuncker, and embedding function from Azure openai.
  • Store: This is done using a vector store (chromadb) and Embeddings model
  • Retrieve: Given a user input, relevant splits are retrieved from storage using a retriever.
  • Generate: A chatmodel LLM(GroQ) produces an answer using a prompt that includes both the question with the retrieved data.
  • Chat: Streamlit web interface for seamless user interaction

Tools Used

  • Python -> Backend development
  • Langchain -> LLM framework
  • ChromaDB -> vector store
  • Streamlit -> Frontend/Chat Builder
  • Docker -> Application packaging tool
  • Docker Compose -> Application deployment

Steps to Run this Application

  1. Have the following installed on your machine.
  1. Clone the Repository
git clone https://github.com/erickasakya/langchain-rag-app.git

cd langchain-rag-app
  1. Create .env from .env.template and update the api keys

mv .env.template .env

  1. Build Docker Containers

docker compose up -d --build

Access

Open the browser and enter the url below.

http://localhost:8502

Test application.

  1. Load the sample text document in context_data folder.
  2. After loading use the below sample prompts to test
  • Who is the writer of the book The Man Who Was Thursday: A Nightmare?
  • Which year was it realased
  • Which language

About

LangChain RAG app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published