CoolFace
Apppublic

SyntaxSphinx/Itivrit-ai

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

Indian History RAG System ๐Ÿช”

A Retrival-Augmented Generation (RAG) system for exploring Indian history using authenticated sources. This application uses Sentence Transformers for semantic search and an Ollama LLM to answer questions about India's rich historical heritage.

Features

  • โ€”Semantic search across multiple historical texts
  • โ€”Accurate page citations for all sources
  • โ€”Beautiful Streamlit UI with Indian-themed styling
  • โ€”Contextual answers grounded in retrieved documents

Setup

Local Development

  1. 1.Clone this repository:
bash
git clone <your-repo-url>
cd india-history-rag
  1. 1.Install dependencies:
bash
pip install -r requirements.txt
  1. 1.Download pre-built FAISS index and embeddings:
  • โ€”Ensure data/vector_db_faiss/faiss.index and data/vector_db_faiss/metadata.json are present
  1. 1.Start Ollama server:
bash
ollama serve
ollama pull mistral:7b
  1. 1.Run the Streamlit app:
bash
streamlit run streamlit_app.py

Deployment

Streamlit Community Cloud

  1. 1.Push your code to GitHub
  2. 2.Go to streamlit.io/cloud
  3. 3.Connect your GitHub repository
  4. 4.Deploy!

Note: Ensure your FAISS index files are committed to the repository or rebuild them during deployment.

Structure

india-history-rag/
โ”œโ”€โ”€ streamlit_app.py          # Main Streamlit UI
โ”œโ”€โ”€ rag_pipeline.py           # RAG orchestration
โ”œโ”€โ”€ retriever.py              # FAISS-based retrieval
โ”œโ”€โ”€ llm_ollama.py             # Ollama LLM client
โ”œโ”€โ”€ generate_embeddings_local.py  # Build FAISS index
โ””โ”€โ”€ data/
    โ””โ”€โ”€ vector_db_faiss/      # FAISS index and metadata

License

MIT License