Skip to content

BestRAG: A library for hybrid RAG, combining dense, sparse, and late interaction methods for efficient document storage and search.

License

Notifications You must be signed in to change notification settings

samadpls/BestRAG

Repository files navigation

Supported python versions PEP8 License Run Pytest GitHub stars PyPI - Downloads

Introducing BestRAG! This Python library leverages a hybrid Retrieval-Augmented Generation (RAG) approach to efficiently store and retrieve embeddings. By combining dense, sparse, and late interaction embeddings, BestRAG offers a robust solution for managing large datasets.

✨ Features

πŸš€ Hybrid RAG: Utilizes dense, sparse, and late interaction embeddings for enhanced performance.
πŸ”Œ Easy Integration: Simple API for storing and searching embeddings.
πŸ“„ PDF Support: Directly store embeddings from PDF documents.

πŸš€ Installation

To install BestRAG, simply run:

pip install bestrag

πŸ“¦ Usage

Here’s how you can use BestRAG in your projects:

from bestrag import BestRAG

rag = BestRAG(
    url="https://YOUR_QDRANT_URL", 
    api_key="YOUR_API_KEY", 
    collection_name="YOUR_COLLECTION_NAME"
)

# Store embeddings from a PDF
rag.store_pdf_embeddings("your_pdf_file.pdf", "pdf_name")

# Search using a query
results = rag.search(query="your search query", limit=10)
print(results)

# Delete particular pdf embeddings
rag.delete_pdf_embeddings("home/notes.pdf")

Note: Qdrant offers a free tier with 4GB of storage. To generate your API key and endpoint, visit Qdrant.

πŸ€— Try it on Hugging Face Spaces

You can explore and interact with BestRAG directly on Hugging Face Spaces: BestRAG on Hugging Face

🀝 Contributing

Feel free to contribute to BestRAG! Whether it’s reporting bugs, suggesting features, or submitting pull requests, your contributions are welcome.

πŸ“ License

This project is licensed under the MIT License.


Created by samadpls πŸŽ‰

About

BestRAG: A library for hybrid RAG, combining dense, sparse, and late interaction methods for efficient document storage and search.

Topics

Resources

License

Stars

Watchers

Forks

Languages