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.4.tar.gz (6.0 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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ragger_simple-0.1.4.tar.gz.

File metadata

  • Download URL: ragger_simple-0.1.4.tar.gz
  • Upload date:
  • Size: 6.0 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.4.tar.gz
Algorithm Hash digest
SHA256 8a731aac617b8dd044369708d1882169e36aaa9375e07d5dce6a86912b28358c
MD5 6851fa84d22d371c1f42a7c51c3a2241
BLAKE2b-256 299d398400fb9325624f7bef303a4d80e444156596c2ff8f2ef1ac9ff7ce3d59

See more details on using hashes here.

File details

Details for the file ragger_simple-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ragger_simple-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 79e960f8a8a05efcea4cac4c1e18058038f8eb79f244c450f70a6b150769c486
MD5 e3b1e1a426a220af140ef66e248edab8
BLAKE2b-256 e82ba6a5c9fbd52f4eb42b8ee0b5e1d44bd14d1543d075bc647d8294082449fb

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