Skip to content

[Submission] konthamsaisriharshith[TechYuga] — RAG App

Ancient India 🧭

RAG-based study tool for ancient Indian scientific thought alongside modern scientific theories.

Overview

This app ingests your uploaded PDF/text notes, builds a FAISS index with embeddings, retrieves relevant passages, and uses a HuggingFace chat model to answer your questions grounded in the uploaded sources.

Response Modes

Research Mode: Structured, evidence-grounded answers with source-aware wording Comparison Mode: Careful comparison of ancient ideas vs modern theories Simple Mode: Plain-language explanations for faster understanding Architecture

User Query → Retrieve from FAISS → HuggingFace Inference API → Answer Output Setup

Prerequisites

Python 3.8+ HuggingFace account (free) Installation

Clone the repository

git clone cd kshetraverse Install dependencies

pip install -r requirements.txt Get HuggingFace Token

Sign up at huggingface.co Go to Settings → Access Tokens → Create New Token (read permission) Free tier includes Llama 3.2 and other models Configure the project

Copy .env.example to .env: cp .env.example .env Update .env with your HuggingFace token: HUGGINGFACE_TOKEN=your_hf_token_here Get your free token from huggingface.co/settings/tokens Ingest the knowledge base

python src/ingest.py python src/rag_system.py ingest Run the application

streamlit run ui/app.py Project Structure

Ancient India/ ├── config.yaml # Configuration file ├── requirements.txt # Python dependencies ├── src/ │ ├── ingest.py # PDF ingestion │ └── rag_system.py # RAG pipeline implementation ├── ui/ │ └── app.py # Streamlit UI ├── data/ │ ├── source/ # (optional) extra PDFs/TXT/MD │ ├── raw/ # Generated extracted text │ └── processed/ # Generated chunks └── logs/ # Application logs Usage

Open your browser to http://localhost:8501

Enter your HuggingFace token in the sidebar

Select a response mode:

Research Comparison Simple Enter your query or use an example query

Click "Generate Answer" to get your result

Key Features

Source-grounded answers from your uploaded PDF/text Three response modes (research / comparison / simple) Context-aware retrieval using FAISS Uses HuggingFace chat completions Runs locally with Streamlit Technology Stack

Component Solution Cost LLM HuggingFace Inference API Free tier Embeddings sentence-transformers Free Vector DB FAISS Free UI Streamlit Free

Knowledge base not found

Run the ingestion commands:

python src/ingest.py python src/rag_system.py ingest HuggingFace API errors

Verify your token has read permissions Check if you have available API credits Try a different model in config.yaml Memory issues

Reduce CHUNK_SIZE and CHUNK_OVERLAP in config.yaml

License

This project is for educational purposes. The text is sourced from the Sacred Texts Archive.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Acknowledgments

text from Sacred Texts Archive HuggingFace for the free Inference API Streamlit for the UI framework

Merge request reports

Loading