Skip to content

Commit c9575de

Browse files
committed
Initial version released
0 parents  commit c9575de

File tree

10 files changed

+591
-0
lines changed

10 files changed

+591
-0
lines changed

.github/workflows/pytest.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Run Pytest
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.10"
17+
18+
- name: Install dependencies
19+
run: |
20+
python3 -m pip install --upgrade pip
21+
pip3 install -r requirements.txt
22+
23+
- name: Run Pytest
24+
run: |
25+
python3 -m pytest bestrag/tests/test_best_rag.py

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
7+
8+
# PyInstaller
9+
# Usually these files are written by a python script from a template
10+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
11+
*.manifest
12+
*.spec
13+
14+
# Installer logs
15+
pip-log.txt
16+
pip-delete-this-directory.txt
17+
18+
# Unit test / coverage reports
19+
.coverage
20+
.coverage.*
21+
.cache
22+
*.py,cover
23+
.hypothesis/
24+
.pytest_cache/
25+
cover/
26+
27+
# Translations
28+
*.mo
29+
*.pot
30+
31+
# Django stuff:
32+
*.log
33+
local_settings.py
34+
db.sqlite3
35+
db.sqlite3-journal
36+
37+
# Flask stuff:
38+
instance/
39+
.webassets-cache
40+
41+
# Scrapy stuff:
42+
.scrapy
43+
44+
# Sphinx documentation
45+
docs/_build/
46+
47+
48+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
49+
__pypackages__/
50+
51+
# Celery stuff
52+
.devcontainer/
53+
.vscode/
54+
55+
# SageMath parsed files
56+
*.sage.py
57+
test.py
58+
59+
# Environments
60+
.env
61+
.venv
62+
env/
63+
venv/
64+
ENV/
65+
env.bak/
66+
venv.bak/
67+
68+
# Spyder project settings
69+
.spyderproject
70+
.spyproject
71+
build/
72+
dist/
73+
bestrag.egg-info
74+
75+
# Rope project settings
76+
.ropeproject
77+
78+
# mkdocs documentation
79+
/site
80+
81+
# mypy
82+
.mypy_cache/
83+
.dmypy.json
84+
dmypy.json
85+
86+
# Pyre type checker
87+
.pyre/
88+
89+
# pytype static type analyzer
90+
.pytype/
91+
92+
# Cython debug symbols
93+
cython_debug/

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Contribution Guidelines
2+
3+
Please ensure your pull request adheres to the following guidelines:
4+
5+
- Check your syntax and grammar.
6+
- Follow best practices
7+
8+
Thank you for your suggestions!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Abdul Samad Siddiqui
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
![Supported python versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
3+
[![PEP8](https://img.shields.io/badge/code%20style-pep8-black.svg)](https://www.python.org/dev/peps/pep-0008/)
4+
[![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](LICENSE)
5+
[![Run Pytest](https://github.com/samadpls/bestrag/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/samadpls/bestrag/actions/workflows/pytest.yml)
6+
<img src='https://img.shields.io/github/stars/samadpls/bestrag?color=red&label=stars&logoColor=black&style=social'>
7+
8+
Welcome to **BESTRAG**! This Python library enables you to efficiently store and retrieve embeddings using a hybrid Retrieval-Augmented Generation (RAG) approach. It combines dense, sparse, and late interaction embeddings to provide a robust solution for handling large datasets.
9+
10+
## 🚀 Installation
11+
12+
To install **bestrag**, simply run:
13+
14+
```bash
15+
pip install bestrag
16+
```
17+
18+
## 📦 Usage
19+
20+
Here’s how you can use **BestRAG** in your projects:
21+
22+
```python
23+
from bestrag import BestRAG
24+
25+
rag = BestRAG(
26+
url="https://YOUR_QDRANT_URL",
27+
api_key="YOUR_API_KEY",
28+
collection_name="YOUR_COLLECTION_NAME"
29+
)
30+
31+
rag.store_pdf_embeddings("your_pdf_file.pdf")
32+
```
33+
34+
> **Note**: To generate your API key and endpoint, visit [Qdrant](https://qdrant.tech/).
35+
36+
## ✨ Features
37+
38+
- **Hybrid RAG**: Utilizes dense, sparse, and late interaction embeddings for enhanced performance.
39+
- **Easy Integration**: Simple API for storing and searching embeddings.
40+
- **PDF Support**: Directly store embeddings from PDF documents.
41+
42+
## 🤝 Contributing
43+
44+
Feel free to contribute to **BESTRAG**! Whether it’s reporting bugs, suggesting features, or submitting pull requests, your contributions are welcome.
45+
46+
## 📝 License
47+
48+
This project is licensed under the [MIT License](LICENSE).
49+
50+
---
51+
52+
Created by [samadpls](https://github.com/samadpls) 🎉

bestrag/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .best_rag import BestRAG

0 commit comments

Comments
 (0)