|
| 1 | +# RAGnarok |
| 2 | +> RAG powered research and documentation assistant for professionals |
| 3 | +
|
| 4 | +--- |
| 5 | + |
| 6 | +### Tech Stack |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +## Overview |
| 21 | + |
| 22 | +RAGnarok is a full-stack, retrieval-augmented generation (RAG) system that lets you: |
| 23 | + |
| 24 | +1. **Ingest** arbitrary documents pertaining to diverse professions into a vector store |
| 25 | +2. **Serve** a REST API that retrieves relevant passages and generates answers via |
| 26 | +3. **Interact** through a modern NextJS based chat UI |
| 27 | +4. **Deploy** the entire stack using Docker Compose onto the cloud or self host locally |
| 28 | + |
| 29 | +The project consists of four main components: |
| 30 | + |
| 31 | +- **Ingestion Pipeline** |
| 32 | + Reads documents (PDFs, text, markdown), splits and vectorizes them, and stores embeddings in a vector database (e.g. Pinecone, Weaviate). |
| 33 | + |
| 34 | +- **Backend API** |
| 35 | + A FastAPI service exposing endpoints for querying the vector store, invoking SoTa LLMs such as Deepseek, and streaming chat responses. |
| 36 | + |
| 37 | +- **Frontend UI** |
| 38 | + A NextJS + Typescript chat interface that calls the Backend API for conversational RAG. |
| 39 | + |
| 40 | +- **Deployment Manifests** |
| 41 | + Dockerfiles and Docker Compose manifests to deploy entire project locally or in the cloud. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +## Prerequisites |
| 46 | + |
| 47 | +- **Docker & Docker Compose** |
| 48 | +- **Node.js** (v20+) and **Bun** |
| 49 | +- **Python** (v3.11+) |
| 50 | +- **LLM API key** (Groq, Gemini, etc.) |
| 51 | +- **[AstraDB](https://www.datastax.com/lp/vector-database) Vector database credentials** |
| 52 | + |
| 53 | +## Project Structure |
| 54 | +``` |
| 55 | +. |
| 56 | +├───.github |
| 57 | +│ └───workflows |
| 58 | +├───assets |
| 59 | +├───backend |
| 60 | +│ └───app |
| 61 | +│ ├───models |
| 62 | +│ ├───routes |
| 63 | +│ ├───services |
| 64 | +│ └───utils |
| 65 | +├───deployment |
| 66 | +├───frontend |
| 67 | +│ ├───public |
| 68 | +│ └───src |
| 69 | +│ ├───app |
| 70 | +│ │ └───test |
| 71 | +│ ├───components |
| 72 | +│ │ └───ui |
| 73 | +│ ├───context |
| 74 | +│ └───lib |
| 75 | +└───ingestion-pipeline |
| 76 | +
|
| 77 | +20 directories, 65 files |
| 78 | +``` |
| 79 | + |
| 80 | + |
| 81 | +## Setup |
| 82 | + |
| 83 | +1. **Clone the repo** |
| 84 | + ```bash |
| 85 | + git clone https://github.com/3xCaffeine/rag.git |
| 86 | + cd rag |
| 87 | + ``` |
| 88 | +2. Configure environment variables |
| 89 | + |
| 90 | + Copy the example `.env.example` into each service folder and add the API keys, URLs and AstraDB database credentials. |
| 91 | + |
| 92 | +3. Build & run with Docker Compose |
| 93 | + |
| 94 | + ``` |
| 95 | + docker-compose up -d |
| 96 | + ``` |
| 97 | +> [!NOTE] |
| 98 | +> In case GPU support is unavailable on the machine, utilize a hosted text embedding model (OpenAI Ada, Jina AI, Cohere etc.) and remove the Ollama section from the Compose config. |
| 99 | +
|
| 100 | +4. (Optional) For remote deployment with custom domains, configure the `deployment/Caddyfile` otherwise remove the Caddy section from Compose configuration. |
| 101 | +
|
| 102 | +### Expected Result |
| 103 | +
|
| 104 | +```bash |
| 105 | +$ docker compose ps |
| 106 | +NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS |
| 107 | +backend-api-1 ragbackend:latest "fastapi run app/mai…" api 3 minutes ago Up 3 minutes (healthy) 0.0.0.0:8000->8000/tcp |
| 108 | +ollama ollama/ollama:latest "/bin/sh ./run_model…" ollama 9 seconds ago Up 9 seconds 0.0.0.0:11434->11434/tcp |
| 109 | +``` |
| 110 | + |
| 111 | +## Usage |
| 112 | + |
| 113 | +Visit Ragnarok chat at http://localhost:3000. |
| 114 | + |
| 115 | + |
| 116 | +#### Demo |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | +## Authors |
| 121 | +This project was built for the AISoC Chronos Hackathon 2025 by the 3xCaffeine team. |
| 122 | + |
| 123 | +- Sourasish Basu ([@SourasishBasu](https://github.com/SourasishBasu)) |
| 124 | +- Swapnil Dutta ([@rycerzes])(https://github.com/rycerzes) |
| 125 | +- Vaibhav Singh ([@monkeplication])(https://github.com/monkeplication) |
| 126 | + |
| 127 | +## Version |
| 128 | +| Version | Date | Comments | |
| 129 | +| ------- | ------------------- | --------------- | |
| 130 | +| 1.0 | May 14th, 2025 | Revised release | |
0 commit comments