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).
- 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.
- 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
- 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
- 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.
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS 4
- Markdown Rendering: react-markdown
- Icons: Lucide React
- Runtime: Node.js + Express 5
- Orchestration: LangChain
- LLM: Google Gemini 1.5 Flash
- Embeddings: Cohere AI (embed-english-v3.0)
- Vector DB: Pinecone (v5 SDK)
- Storage: ImageKit
git clone <your-repo-url>
cd DocuChatNavigate 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_endpointInstall and start:
cd server
npm install
npm startcd ../client
npm install
npm run devDocuChat/
├── 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
- 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.
This project is licensed under the ISC License.
Built with ❤️ for intelligent document interaction.