https://github.com/akdevv/ai-rag-prod
A fast RAG app built with LangChain, QdrantDB, and Ollama for local models.
https://github.com/akdevv/ai-rag-prod
Last synced: 11 months ago
JSON representation
A fast RAG app built with LangChain, QdrantDB, and Ollama for local models.
- Host: GitHub
- URL: https://github.com/akdevv/ai-rag-prod
- Owner: akdevv
- Created: 2025-05-01T04:36:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-07T20:43:32.000Z (about 1 year ago)
- Last Synced: 2025-06-08T12:43:07.356Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI-RAG: PDF Document Chat Application
A powerful RAG (Retrieval-Augmented Generation) application that allows users to upload PDF documents and engage in contextual conversations with AI about the document content.
## Features
- PDF document upload and processing
- AI-powered chat interface for document interaction
- Local LLM integration using Ollama
- Vector database for efficient document retrieval
- Queue-based document processing
- Modern and responsive UI
- User authentication with Clerk
## Tech Stack
### Frontend
- Next.js - React framework for building the user interface
- Shadcn - UI component library for a modern design system
- Clerk - Authentication and user management
### Backend
- Express.js - Node.js web application framework
- Bun - JavaScript runtime and package manager
- LangChain - Framework for building LLM-powered applications
- Ollama - Local LLM integration (Mistral model)
- QdrantDB - Vector database for storing embeddings
- BullMQ - Queue system for handling document processing
- Multer - File upload handling
- Docker - Containerization
- Valkey - Key-value store
## Prerequisites
- Docker and Docker Compose
- Bun runtime
- Ollama
- Clerk account for authentication
## Local Setup
1. **Start Docker Services**
```bash
docker compose up -d
# To stop services
docker compose down
```
2. **Setup Ollama**
- Install Ollama from [ollama.ai](https://ollama.ai)
- Pull required models:
```bash
ollama pull mistral
ollama pull nomic-embed-text
```
- Start Ollama service
3. **Backend Setup**
```bash
cd server
bun install
# Start the worker
bun run dev:worker
# In a new terminal, start the server
bun run dev
```
4. **Frontend Setup**
```bash
cd client
bun install
# Create .env file and add Clerk credentials
echo "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=" > .env
bun run dev
```
5. **Access the Application**
- Open [http://localhost:3000](http://localhost:3000)
- Sign in using Clerk authentication
- Upload a PDF document
- Start chatting with the AI about the document content
## Technology Details
- **Ollama**: Local LLM framework for running open-source models
- **Docker**: Containerization platform for consistent development environments
- **BullMQ**: Redis-based queue system for handling background jobs
- **Valkey**: High-performance key-value store
- **LangChain**: Framework for building LLM applications with RAG capabilities
- **Multer**: Middleware for handling multipart/form-data (file uploads)
- **QdrantDB**: Vector similarity search engine for storing and retrieving embeddings
- **Clerk**: Authentication and user management platform
## Credits
This project was inspired by and built following the tutorial from [Build AI Chat with PDF App with Next.js and Vector DB](https://www.youtube.com/watch?v=2DXiOtEwWtU).