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.2.tar.gz
(5.7 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.2.tar.gz.
File metadata
- Download URL: ragger_simple-0.1.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f66488ce499ffae16b9f7fda8268fe692afc1b4a91e69124a3702c4a7c9e641d
|
|
| MD5 |
87a61770679ea95fce35df43f1965955
|
|
| BLAKE2b-256 |
e107ba4fba1e3e767d9672d263fb2452c147c5fd86893831cd31c281d37d2454
|
File details
Details for the file ragger_simple-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ragger_simple-0.1.2-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 |
23a19804b59c493260938b74db04b3f6eea4f64aa095755c83cd9c6807ed7f90
|
|
| MD5 |
a5f10b2394e50b9da5d1b67799c74238
|
|
| BLAKE2b-256 |
b2c62e529230ffefb0a5524f4e064f1e6105ffe6e5ba7dd521f8867cc56fce3d
|