Simple vector database operations with Qdrant
Project description
Ragger Simple
A simple Python package for vector database operations using Qdrant.
Features
- Initialize connection with Qdrant vector database
- Parse, chunk, and process text into vector embeddings
- Search for relevant text chunks based on semantic similarity
Installation
pip install ragger-simple
Usage
Python API
Import and initialize VectorDB:
from ragger_simple import VectorDB
db = VectorDB(
collection_name="my_documents",
model_name="all-MiniLM-L6-v2",
model_path=None,
qdrant_url=None,
qdrant_api_key=None,
qdrant_path=None,
qdrant_timeout=500.0,
)
Constructor parameters:
collection_name(str, default:"documents") — Qdrant collection namemodel_name(str, default:"all-MiniLM-L6-v2") — sentence-transformers modelmodel_path(str, optional) — local folder with your modelqdrant_url(str, optional) — cloud URLqdrant_api_key(str, optional) — cloud API keyqdrant_path(str, optional) — local pathqdrant_timeout(float, default:500) — request timeout in seconds
Methods:
db.add_documents(
documents: Dict[str, str],
chunk_size: int = 200,
overlap: int = 50,
)
documents— dict mapping doc names to textchunk_size— words per chunkoverlap— overlapping words
results = db.search(
query: str,
k: int = 5,
) -> List[Dict]
query— query textk— number of results
Example:
documents = {
"Article 1": "This is the content of article 1...",
"Article 2": "This is the content of article 2..."
}
db.add_documents(documents, chunk_size=200, overlap=50)
results = db.search("your query here", k=5)
print(results)
License
MIT
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
ragger_simple-0.1.3.tar.gz
(5.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragger_simple-0.1.3.tar.gz.
File metadata
- Download URL: ragger_simple-0.1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f22c0ee836b0bc77c4fc9fd9ae3eb9441beb0a692e889495f1437f2f3a8f1181
|
|
| MD5 |
b4a28f226ffe20d49278ecf53fcdf569
|
|
| BLAKE2b-256 |
8c38d60a894b0b1ff79717ae96a4f8ff9b4dc924745aaffc12d6ed605a5950c4
|
File details
Details for the file ragger_simple-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ragger_simple-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8342b29df2968300421fa4ee0351a22f3c404e29d8c0dcf670789c053efcc52
|
|
| MD5 |
8c7a521426f45d4b4a8895c5225796b6
|
|
| BLAKE2b-256 |
a52118d4f642b43f7b7e39443703b871c57705e358c674e36375d064c647c083
|