Skip to main content

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 name
  • model_name (str, default: "all-MiniLM-L6-v2") — sentence-transformers model
  • model_path (str, optional) — local folder with your model
  • qdrant_url (str, optional) — cloud URL
  • qdrant_api_key (str, optional) — cloud API key
  • qdrant_path (str, optional) — local path
  • qdrant_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 text
  • chunk_size — words per chunk
  • overlap — overlapping words
results = db.search(
    query: str,
    k: int = 5,
) -> List[Dict]
  • query — query text
  • k — 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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragger_simple-0.1.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for ragger_simple-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f66488ce499ffae16b9f7fda8268fe692afc1b4a91e69124a3702c4a7c9e641d
MD5 87a61770679ea95fce35df43f1965955
BLAKE2b-256 e107ba4fba1e3e767d9672d263fb2452c147c5fd86893831cd31c281d37d2454

See more details on using hashes here.

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

Hashes for ragger_simple-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23a19804b59c493260938b74db04b3f6eea4f64aa095755c83cd9c6807ed7f90
MD5 a5f10b2394e50b9da5d1b67799c74238
BLAKE2b-256 b2c62e529230ffefb0a5524f4e064f1e6105ffe6e5ba7dd521f8867cc56fce3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page