New: DocDirector - Create startup-ready documents in minutesLearn more
Open Source RAG Library

Insta RAG

A modular, plug-and-play Python library for building advanced Retrieval-Augmented Generation pipelines

Core Features

Everything you need to build production-grade RAG pipelines

Semantic Chunking

Splits documents at natural topic boundaries to preserve context and improve retrieval accuracy.

Hybrid Retrieval

Combines semantic vector search with BM25 keyword search for the best of both worlds.

Query Transformation

Uses an LLM to generate hypothetical answers (HyDE), improving retrieval relevance.

Reranking

Integrates with state-of-the-art rerankers like Cohere to intelligently re-order results.

Pluggable Architecture

Easily extend the library by adding new chunkers, embedders, or vector databases.

Hybrid Storage

Optional MongoDB integration for cost-effective content storage while keeping Qdrant lean.

Quick Start

1. Installation

# Recommended: using uv
uv pip install insta-rag
# Or with pip
pip install insta-rag

2. Basic Usage

from insta_rag import RAGClient, RAGConfig, DocumentInput

# Load configuration from environment variables (.env file)
config = RAGConfig.from_env()
client = RAGClient(config)

# 1. Add documents to a collection
documents = [DocumentInput.from_text("Your first document content.")]
client.add_documents(documents, collection_name="my_docs")

# 2. Retrieve relevant information
response = client.retrieve(
    query="What is this document about?",
    collection_name="my_docs"
)

# Print the most relevant chunk
if response.chunks:
    print(response.chunks[0].content)

Key Capabilities

Semantic Chunking

Intelligent document splitting that preserves context and meaning at natural boundaries.

Hybrid Retrieval

Combine vector and keyword search for comprehensive document retrieval.

Query Transformation

Improve relevance with HyDE (Hypothetical Document Embeddings) support.

Intelligent Reranking

Use state-of-the-art rerankers to refine and order search results.

Extensible Design

Built on a modular architecture that allows easy customization and extension.

Multi-Storage Support

Works with MongoDB, Qdrant, and other vector databases seamlessly.

Contributing

We welcome contributions! Here is how to help:

1.

Set up your development environment

Clone the repository and install dependencies

2.

Code quality tools and pre-commit hooks

Run linters and tests locally before pushing

3.

Follow commit and branch naming conventions

Use clear, descriptive names for your contributions

4.

Version management

Follow semantic versioning guidelines

5.

Submit a pull request

Provide clear description and testing results

View Contributing Guide

License

This project is licensed under the MIT License.

View License

Ready to Build Your RAG Pipeline?

Start with Insta RAG today and simplify your document processing workflows