Skip to main content

Modular Retrieval-Augmented Generation (RAG) framework.

Project description

Hayagriva

Illuminate what was forgotten. Retrieve what matters.

Hayagriva is a lightweight, modular Retrieval-Augmented Generation (RAG) framework designed to help developers build production-ready AI systems that combine large language models with real-world contextual knowledge. Inspired by Hayagriva, the divine preserver and restorer of the Vedas, this library focuses on retrieving truth from stored knowledge and generating accurate, grounded responses.

Features

  • Pluggable retrievers (vector databases, keyword search, hybrid search)
  • Model-agnostic generation (choose any LLM backend)
  • Flexible embeddings and rerankers
  • Built-in document loaders and chunking utilities
  • Minimal and extensible architecture
  • Easy integration with existing pipelines
  • Lightweight and fast
  • Basic CLI and Gradio UI for experimentation

Project Structure

hayagriva/
├── core/           # Core RAG building blocks (chunker, embeddings, vector store, retriever, generator)
├── ingestion/      # Loaders and parsers for documents
├── ui/             # Gradio UI components
├── cli/            # Command line interface
├── utils/          # Utilities for logging, validation, etc.
├── config.py       # Configuration dataclasses
├── exceptions.py   # Custom exception types
└── version.py      # Version metadata

Quick Start

Python API

from hayagriva import Hayagriva, HayagrivaConfig

config = HayagrivaConfig()  # customize models or retrieval parameters if needed
rag = Hayagriva(config)
rag.add_documents(["Hayagriva restores forgotten knowledge."])
response = rag.ask("Who retrieved the lost Vedas?")
print(response)

CLI

# Launch the Gradio UI
hayagriva ui --port 7878

# Ingest local text files
hayagriva ingest ./docs

# Ask a question from the terminal
hayagriva query "Explain retrieval-augmented generation"

Gradio UI

Running hayagriva ui starts a simple two-panel UI: left for ingestion, right for chat-based Q&A. It is a placeholder designed for future expansion.

Minimum Requirements

  • Python 3.10+
  • Dependencies: sentence-transformers, faiss-cpu, openai>=1.0.0, gradio

Set OPENAI_API_KEY in your environment or configure it programmatically when instantiating Hayagriva.

Installation

Install the package and dependencies in a Python 3.10+ environment:

pip install -e .

Ensure you have system build tools available for faiss-cpu (the default vector store) and that OPENAI_API_KEY is set before running generation.

Roadmap

  • Built-in document ingestion for PDFs, DOCX, JSON
  • Streaming responses and multi-turn chat memory
  • Additional vector stores (Chroma, Qdrant, Pinecone, Milvus)
  • Hybrid retrieval and reranking
  • Rich UI controls and analytics
  • Agentic tool-use within the pipeline

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hayagriva-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hayagriva-0.1.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file hayagriva-0.1.0.tar.gz.

File metadata

  • Download URL: hayagriva-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for hayagriva-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b911b5f0784b92da2ab2760e98d4695af1585cd5c2b66d9101013001cbd25a0
MD5 1111088fde8029af78c8533c9d67e42a
BLAKE2b-256 8274b21d43d88abab0158cf5c746a4437fe8d6c055e3ca8c45720673ad91d5f7

See more details on using hashes here.

File details

Details for the file hayagriva-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hayagriva-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for hayagriva-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07b935e90aaefee5de69bf3bd5e71125d3a45f7a19e3c025f069f7dfe2b53402
MD5 4dc4c56649457a1beb57b40a27631078
BLAKE2b-256 d83c767ee450f92f39dd1b862a1a26ee71363fad76354b5ff4103bb73a425667

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page