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.3.tar.gz (5.8 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.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for ragger_simple-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f22c0ee836b0bc77c4fc9fd9ae3eb9441beb0a692e889495f1437f2f3a8f1181
MD5 b4a28f226ffe20d49278ecf53fcdf569
BLAKE2b-256 8c38d60a894b0b1ff79717ae96a4f8ff9b4dc924745aaffc12d6ed605a5950c4

See more details on using hashes here.

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

Hashes for ragger_simple-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b8342b29df2968300421fa4ee0351a22f3c404e29d8c0dcf670789c053efcc52
MD5 8c7a521426f45d4b4a8895c5225796b6
BLAKE2b-256 a52118d4f642b43f7b7e39443703b871c57705e358c674e36375d064c647c083

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