Skip to content

pranjalkuhikar/DocuChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 DocuChat

DocuChat is a high-performance Document & Web Analyzer built with LangChain, Gemini 1.5 Flash, and Pinecone. It enables users to upload PDF documents or provide website URLs to instantly chat with the content using state-of-the-art RAG (Retrieval-Augmented Generation).

🚀 Features

  • PDF Knowledge Extraction: Upload and vectorize complex PDF documents for instant querying.
  • Web URL Scraper: Paste any article or website URL to chat with its real-time content.
  • Intelligent Conversations: Powered by Google Gemini 1.5 Flash for low-latency, context-aware responses.
  • Advanced Vector Search: High-precision retrieval using Cohere English v3.0 Embeddings (1024-dim).
  • Rich Markdown UI: Beautifully formatted AI responses including lists, tables, and code snippets.
  • DB Management: One-click "Reset DB" to wipe vectors from Pinecone and start a fresh session.
  • Premium Design: Sleek, dark-mode ready interface built with Tailwind CSS 4.

✨ Latest Improvements (May 2026)

Precision & Performance

  • Smaller Chunks (500 chars) for more targeted, relevant responses
  • Concise Answers - System prompt enforces 5-sentence limit
  • Smart Context Filtering - Limits context to 2000 chars max
  • Better Separation - Chunks separated with "---" for clarity

Reliability & Safety

  • File Validation - PDF type/size checks (25MB limit)
  • URL Validation - Validates format before processing
  • Message Validation - 3-500 character range enforcement
  • Request Timeout - 120-second limit prevents hanging requests
  • Better Error Messages - Clear, actionable error feedback

Configuration

  • Environment Variables - API URL now configurable (.env.local)
  • Production Ready - Easy switch between dev/production endpoints

See SETUP_GUIDE.md for detailed configuration and troubleshooting.


🛠️ Tech Stack

Frontend

Backend


⚙️ Setup & Installation

1. Clone the Repository

git clone <your-repo-url>
cd DocuChat

2. Backend Configuration

Navigate to server and create a .env file:

PORT=3001
GEMINI_API_KEY=your_gemini_key
COHERE_API_KEY=your_cohere_key
PINECONE_API_KEY=your_pinecone_key
PINECONE_INDEX=your_index_name
IMAGEKIT_PUBLIC_KEY=your_key
IMAGEKIT_PRIVATE_KEY=your_key
IMAGEKIT_URL_ENDPOINT=your_endpoint

Install and start:

cd server
npm install
npm start

3. Frontend Configuration

cd ../client
npm install
npm run dev

📁 Project Structure

DocuChat/
├── client/              # Next.js Frontend
│   ├── app/             # App Router logic & UI
│   └── public/          # Favicon & Assets
├── server/              # Express Backend
│   ├── src/
│   │   ├── controllers/ # Business logic (Chat, Upload, Clear)
│   │   ├── routes/      # Express API endpoints
│   │   └── utils/       # RAG logic & Scrapers
│   └── uploads/         # Temporary processing
└── README.md

🛡️ Key Functions

  • Hybrid Loader: Dynamically handles local PDFs, Cloud PDFs (ImageKit), and Web URLs.
  • MRL Embeddings: Optimized 1024-dimension vector generation for high semantic accuracy.
  • Auto-Cleanup: Temporary file handling with automated purging post-vectorization.

📝 License

This project is licensed under the ISC License.


Built with ❤️ for intelligent document interaction.

About

DocuChat is a high-performance Document & Web Analyzer built with LangChain, Gemini Flash, and Pinecone. It enables users to upload PDF documents or provide website URLs to instantly chat with the content using state-of-the-art RAG.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors