MCPcopy Index your code
hub / github.com/KANISHKGX/AGH-Intern-Project

github.com/KANISHKGX/AGH-Intern-Project @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
14 symbols 65 edges 12 files 1 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🧠 Universal RAG System using Groq API

A Retrieval-Augmented Generation (RAG) system that allows users to ask natural language questions over their own documents (JSON, TXT, PDF). The system retrieves relevant information using semantic search and generates accurate, grounded answers using Groq-hosted LLaMA models.

🚀 Features

🔍 Semantic search using vector embeddings

📄 Supports JSON, TXT, and PDF documents

⚡ Ultra-fast LLM inference via Groq API

🧠 Uses Retrieval-Augmented Generation (RAG) to reduce hallucinations

🗂️ Modular, production-style project structure

🔐 Secure API key handling using .env

🏗️ Architecture Overview User Query ↓ Query Embedding ↓ FAISS Vector Search ↓ Top-K Relevant Chunks ↓ Groq LLM (LLaMA 3.1) ↓ Final Answer

🛠️ Tech Stack Component Technology Why Used Language Python Strong AI ecosystem Embeddings Sentence Transformers Semantic understanding Vector DB FAISS Fast similarity search LLM Inference Groq API Low-latency, scalable Models LLaMA 3.1 High-quality reasoning Config python-dotenv Secure env handling 📁 Project Structure doc_RAG/ │ ├── core/ │ ├── embedder.py # Embedding model │ ├── vector_db.py # FAISS operations │ ├── retriever.py # Similarity search │ └── groq_llm.py # Groq LLM integration │ ├── loaders/ │ ├── init.py # Universal loader │ ├── json_loader.py │ ├── text_loader.py │ └── pdf_loader.py │ ├── data/ │ ├── colleges.json │ ├── college_from_js.json │ ├── sample.txt │ └── document.pdf │ ├── build_index.py # Build vector database ├── rag_chat.py # CLI chat interface ├── requirements.txt ├── .env └── README.md

⚙️ Setup Instructions 1️⃣ Clone the Repository git clone https://github.com/your-username/universal-rag-groq.git cd universal-rag-groq

2️⃣ Install Dependencies pip install -r requirements.txt

3️⃣ Configure Environment Variables

Create a .env file in the project root:

GROQ_API_KEY=your_groq_api_key_here

⚠️ Do not commit .env to GitHub

4️⃣ Build the Vector Database python build_index.py

Expected output:

✅ Vector DB built from multiple documents

5️⃣ Start the RAG Chat python rag_chat.py

💬 Example Usage

Query:

get me the location of Ariyalur Engineering College

Response:

NH-227, Trichy-Chithambaram NH, Karuppur-Senapathy Post, Ariyalur District, Tamil Nadu

⭐ If you like this project

Give it a ⭐ on GitHub — it helps a lot!

Core symbols most depended-on inside this repo

get_embedder
called by 2
core/embedder.py
main
called by 1
build_index.py
main
called by 1
rag_chat.py
build_vector_db
called by 1
core/vector_db.py
save_vector_db
called by 1
core/vector_db.py
load_vector_db
called by 1
core/vector_db.py
retrieve
called by 1
core/retriever.py
get_groq_client
called by 1
core/groq_llm.py

Shape

Function 14

Languages

Python100%

Modules by API surface

core/vector_db.py3 symbols
core/groq_llm.py2 symbols
rag_chat.py1 symbols
loaders/text_loader.py1 symbols
loaders/pdf_loader.py1 symbols
loaders/json_loader.py1 symbols
loaders/js_loader.py1 symbols
loaders/__init__.py1 symbols
core/retriever.py1 symbols
core/embedder.py1 symbols
build_index.py1 symbols

For agents

$ claude mcp add AGH-Intern-Project \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page