Skip to content

A modern RAG framework for closed and open source LLMs built as a demo for the startup Brance.

License

Notifications You must be signed in to change notification settings

kinshukdua/BRAG

Repository files navigation

Brance Retrieval Augmented Generation (BRAG)

This project is a chatbot to interact with a given document i.e. a knowledge source and answer questions based on it.

Core Features

  • Answer user questions from document - via LangChain and vectorDBs
  • Prevent hallucination - via prompt engineering and answer evaluation

Additional Features (WIP)

  • Evaluation of the answers - via RAGAS
  • Multi-lingual support - via OpenAI/Llama, speech and prompt support
  • Speech Compatibility (TtS and StT) - via OpenAI Whisper (offline) and gTTS
  • Basic GUI - Barebones HTML (only for testing)

Architecture

BRAG Architecture

Installation

Will be replaced with DOCKERFILE and requirements.txt

pip -r requirements.txt
python app.py

Algorithm

  1. Store Documents
  2. Split documents into chunks
  3. Process chunks as embeddings
  4. Save embeddings in vector DB
  5. Initialize Chat history
  6. Take input via SpeechRecognition (Whisper API/Offline)
  7. Convert input to embeddings
  8. Use similarity search to get relevant chunks
  9. Add relevant chunks to context in prompt
  10. Send prompt and history to LLM
  11. Get result
  12. Get metrics via RAGAS
  13. Show output to user (via TTS)
  14. Append output to chat history
  15. Repeat 6-14

About

A modern RAG framework for closed and open source LLMs built as a demo for the startup Brance.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published