https://github.com/samadpls/bestrag
BestRAG: A library for hybrid RAG, combining dense, sparse, and late interaction methods for efficient document storage and search.
https://github.com/samadpls/bestrag
best-rag bm25 embedding-vectors hybrid-rag llm opensource pypi-package qdrant rag retrival-augmented-generation
Last synced: 8 months ago
JSON representation
BestRAG: A library for hybrid RAG, combining dense, sparse, and late interaction methods for efficient document storage and search.
- Host: GitHub
- URL: https://github.com/samadpls/bestrag
- Owner: samadpls
- License: mit
- Created: 2024-11-07T12:40:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-12-31T17:16:39.000Z (9 months ago)
- Last Synced: 2025-01-30T00:33:59.743Z (8 months ago)
- Topics: best-rag, bm25, embedding-vectors, hybrid-rag, llm, opensource, pypi-package, qdrant, rag, retrival-augmented-generation
- Language: Python
- Homepage: https://pypi.org/project/bestrag/
- Size: 36.1 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://www.python.org/dev/peps/pep-0008/)
[](LICENSE)
[](https://github.com/samadpls/BestRAG/actions/workflows/pytest.yml)

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:
```bash
pip install bestrag
```## π¦ Usage
Hereβs how you can use **BestRAG** in your projects:
```python
from bestrag import BestRAGrag = 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](https://qdrant.tech/).
## π€ Try it on Hugging Face Spaces
You can explore and interact with **BestRAG** directly on Hugging Face Spaces: [BestRAG on Hugging Face](https://huggingface.co/spaces/samadpls/BestRAG)
## π€ 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](LICENSE).
---
Created by [samadpls](https://github.com/samadpls) π