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).
- 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
- Python -> Backend development
- Langchain -> LLM framework
- ChromaDB -> vector store
- Streamlit -> Frontend/Chat Builder
- Docker -> Application packaging tool
- Docker Compose -> Application deployment
- Have the following installed on your machine.
- Clone the Repository
git clone https://github.com/erickasakya/langchain-rag-app.git
cd langchain-rag-app
- Create .env from .env.template and update the api keys
mv .env.template .env
- Build Docker Containers
docker compose up -d --build
Open the browser and enter the url below.
http://localhost:8502
- Load the sample text document in context_data folder.
- 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