Skip to content

Implementing Chat with Pdf using langchain, React, Cohere & Postgres

Notifications You must be signed in to change notification settings

kanugurajesh/LLM-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The application has a rate limit so kindly upload documents which are less than 10-20 pages even though it accepts upto 40 only put 10-20 for safety this rate limit it is due to free key access from cohere embeddings if we use another embedding model it can be improved based on the key rate limit

LLM Chat

A RAG application to chat with your documents with complete control over your data you can delete your files in the db and see which files are loaded into the vector database and also delete the vectors of a particular file

✨ Key Features

  • 📄 Document Upload & Query:
    Upload your PDF documents, securely store them in Postgres, and query their content using Cohere embeddings.

  • 🧠 RAG-Powered Question Answering:
    Ask questions related to your uploaded documents, and receive precise answers thanks to Cohere's advanced embeddings and postgres's vector storage.

  • 🔒 Full Data Control:
    You have total control over your documents, including the ability to delete, manage, or reference them whenever needed.

  • 🎨 Dynamic UI with Animations:
    Built with TailwindCSS for responsiveness and Framer Motion for smooth transitions. Unauthorized pages are highlighted with engaging Rive animations for user feedback.


🚀 Quick Start

📦 Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/LLM-Chat.git
  2. Change the directory
    cd LLM-Chat
  3. Add the environment variables in the .env.local
cd backend && create .env file

Environment Variables

To run this application, you need to set the following environment variables:

COHERE_API_KEY=
# get the cohere api key from cohere website
DATABASE_URL=
# get the neondb postgres url
  1. Install the packages

    pip install -r requirements.txt
  2. Run the project

    uvicorn main:app --reload
  3. Change the directory

    cd frontend
  4. Install the packages

    npm install
  5. Run the project

    npm run dev

Images

Screenshot 2024-10-28 185749

Screenshot 2024-10-28 185754

Screenshot 2024-10-28 185814

Screenshot 2024-10-28 185820

Screenshot 2024-10-28 185828

Screenshot 2024-10-28 191607

Screenshot 2024-10-28 191618

Screenshot 2024-10-28 191632

Screenshot 2024-10-28 191618

▶️ Demo

SnapText

🌐 Socials:

portfolio linkedin twitter youtube YouTube Channel Subscribers