Skip to main content

Qdrant provider for NLWeb - third-party vector database provider

Project description

nlweb-qdrant-vectordb

Qdrant provider for NLWeb.

Overview

This package provides Qdrant vector database support for NLWeb, demonstrating how to create third-party provider packages.

Installation

pip install nlweb-core nlweb-qdrant-vectordb

For LLM and embedding, you'll also need a model provider:

pip install nlweb-azure-models

Or use the bundle packages:

pip install nlweb-core nlweb-retrieval nlweb-models

Configuration

Create config.yaml:

retrieval:
  provider: qdrant
  import_path: nlweb_qdrant_vectordb.qdrant_client
  class_name: QdrantClient
  api_endpoint_env: QDRANT_URL  # Optional for remote Qdrant
  api_key_env: QDRANT_API_KEY  # Optional for remote Qdrant
  database_path_env: QDRANT_PATH  # Optional for local Qdrant
  index_name: my-collection

Authentication

For remote Qdrant:

export QDRANT_URL=https://your-cluster.qdrant.tech
export QDRANT_API_KEY=your_api_key_here

For local Qdrant:

export QDRANT_PATH=./data/qdrant

Usage

import nlweb_core

# Initialize
nlweb_core.init(config_path="./config.yaml")

# Search
from nlweb_core import retriever

results = await retriever.search(
    query="example query",
    site="example.com",
    num_results=10
)

Features

  • Vector similarity search with Qdrant
  • Support for both remote and local Qdrant instances
  • HNSW-based efficient similarity search
  • Configurable collection names
  • API key authentication for remote instances
  • Local file-based storage option
  • Compatible with NLWeb Protocol v0.5

Creating Your Own Provider Package

Use this package as a template:

  1. Create package structure:

    nlweb-yourprovider/
    ├── pyproject.toml
    ├── README.md
    └── nlweb_yourprovider/
        ├── __init__.py
        └── your_client.py
    
  2. Implement VectorDBClientInterface:

    from nlweb_core.retriever import VectorDBClientInterface
    
    class YourClient(VectorDBClientInterface):
        async def search(self, query, site, num_results, **kwargs):
            # Your implementation
            pass
    
  3. Declare dependencies in pyproject.toml:

    dependencies = [
        "nlweb-core>=0.5.0",
        "your-provider-sdk>=1.0.0",
    ]
    
  4. Publish to PyPI:

    python -m build
    twine upload dist/*
    

License

MIT License - Copyright (c) 2025 Microsoft Corporation

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

nlweb_qdrant_vectordb-0.5.5.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

nlweb_qdrant_vectordb-0.5.5-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file nlweb_qdrant_vectordb-0.5.5.tar.gz.

File metadata

  • Download URL: nlweb_qdrant_vectordb-0.5.5.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for nlweb_qdrant_vectordb-0.5.5.tar.gz
Algorithm Hash digest
SHA256 86bfb5f1adfa730bf5714a38bf3590e960c851d47dec03b2a765a0af5c404bcd
MD5 2e40ca51805da2174500735e6bda7400
BLAKE2b-256 26f783ff188201a1cf362c138453c03d1890ce4857c4e0c9a6ec34c1fd272f73

See more details on using hashes here.

File details

Details for the file nlweb_qdrant_vectordb-0.5.5-py3-none-any.whl.

File metadata

File hashes

Hashes for nlweb_qdrant_vectordb-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5e5d5bf06197c47f39aa4b6a5828ece45e721dd4b7e66233588ba884e597f18d
MD5 d0a077335577d973425a5ee36bd74567
BLAKE2b-256 6f31ab99cd5991df5897a3ac81866ca953e3c541080e85fb47464ae753160279

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