This is a Retrieval-Augmented Generation (RAG) application that allows users to upload documents and query them using natural language. The application uses Azure OpenAI for embeddings and language model capabilities, with a vector database for efficient document retrieval.
- FastAPI for the REST API
- LangChain and LlamaIndex for RAG capabilities
- Azure OpenAI for embeddings and LLM
- Weaviate as the vector database
- Unstructured.io for document parsing
- Temporal.io for workflow orchestration
- MinIO for object storage
- PostgreSQL for Temporal.io persistence
- Next.js 15.1 with TypeScript
- TailwindCSS for styling
- Dark/Light mode support
- File upload and chat interface
- Docker and Docker Compose
- Python 3.12+
- Node.js 18+
- Azure OpenAI API access
- First, start the required infrastructure using Docker Compose:
cd build
docker compose up -dThis will start:
- Weaviate (Vector Database) - Port 8081
- Unstructured API (Document Processing) - Port 8800
- PostgreSQL (Database) - Port 5432
- Temporal (Workflow Engine) - Port 7233
- Temporal UI - Port 8233
- MinIO (Object Storage) - Ports 9000, 9001
- Set up the backend:
cd backendCreate and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall dependencies
uv syncCopy environment file and configure it
cp .env.dist .envEdit .env with your Azure OpenAI and other credentials
Start the backend server
python -m uvicorn src.main:app --reload- Set up the frontend:
cd frontendInstall dependencies
npm installCopy environment file and configure it
cp .env.dist .envSet NEXT_PUBLIC_BACKEND_URL to your backend URL (default: http://localhost:8000)
Start the development server
npm run dev- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Temporal UI: http://localhost:8233
- MinIO Console: http://localhost:9001
- Document Upload: Upload and process various document types
- Two Query Modes:
- Simple: Direct RAG with Azure OpenAI
- Agentic: Advanced RAG with multi-step reasoning
- Source Attribution: See which documents were used to answer queries
- Dark/Light Theme Support
- Real-time Chat Interface
The application requires several environment variables to be set. Check the following files for required variables:
- Backend:
backend/.env.dist - Frontend:
frontend/.env.dist
The project uses modern development tools and practices:
- Ruff for Python linting and formatting
- TypeScript for type-safe JavaScript
- TailwindCSS for styling
- Next.js App Router for frontend routing
This project is private and confidential. All rights reserved.