Skip to content

CantBeSubh/rag-ollama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RagOllama - Adaptive RAG Chatbot

RAG Ollama is an Adaptive RAG Agent web app that uses LLM to answer questions about a PDF document. The app uses a graph-based approach to answer questions. The graph is built using LangGraph. Rag Ollama Architecture UI

The RAG technique is used is called Adaptive RAG. Why is this called Adaptive?

  1. Routing: Route questions to different retrieval approaches
  2. Fallback: Fallback to web search if docs are not relevant to query
  3. Self-correction: Fix answers w/ hallucinations or don’t address question

Tech Stack

This monorepo has a frontend and backend. The following are the technologies used in this project:-

Frontend

Backend

Getting Started

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Ollama (with suitable LLM model installed, in my case I used llama3:8B)
  • Tavily API Key (for web search)
  • LangSmith API Key (optional, for tracing)

Installation

  1. Clone the repository

  2. Replace LangSmith API keys in backend/main.py

  3. Create a .env file in backend and add the following environment variables:

    • TAVILY_API_KEY
  4. cd backend

  5. pip install -r requirements.txt 4.fastapi dev main,py

  6. cd ../frontend

  7. npm install

  8. Create a clerk account, and create a clerk project.

  9. Add the following keys to .env file in frontend folder. -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY -CLERK_SECRET_KEY

    -NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in -NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

    -NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard -NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard

  10. npm run dev

  11. Open http://localhost:3000 with your browser to see the result.

  12. Create a account by clicking on sign-in button.

  13. Upload PDF(s), type your question and click process button.

  14. Depending on your specs, it may take a few minutes to process your question.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published