Skip to main content

Azure vector database provider for NLWeb - Azure AI Search client

Project description

nlweb-azure-vectordb

Azure AI Search provider for NLWeb.

Overview

This is a blueprint package demonstrating how to create individual provider packages for NLWeb. It contains only the Azure AI Search retrieval provider.

Third-party developers can use this as a template for creating their own provider packages (e.g., nlweb-pinecone, nlweb-weaviate, etc.).

Installation

pip install nlweb-core nlweb-azure-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: azure_ai_search
  import_path: nlweb_azure_vectordb.azure_search_client
  class_name: AzureSearchClient
  api_endpoint_env: AZURE_SEARCH_ENDPOINT
  auth_method: azure_ad  # or api_key
  index_name: my-search-index

Authentication Methods

API Key Authentication

retrieval:
  provider: azure_ai_search
  import_path: nlweb_azure_vectordb.azure_search_client
  class_name: AzureSearchClient
  api_endpoint_env: AZURE_SEARCH_ENDPOINT
  api_key_env: AZURE_SEARCH_KEY
  auth_method: api_key
  index_name: my-index

Set environment variables:

export AZURE_SEARCH_ENDPOINT=https://your-service.search.windows.net
export AZURE_SEARCH_KEY=your_key_here

Managed Identity (Azure AD) Authentication

retrieval:
  provider: azure_ai_search
  import_path: nlweb_azure_vectordb.azure_search_client
  class_name: AzureSearchClient
  api_endpoint_env: AZURE_SEARCH_ENDPOINT
  auth_method: azure_ad
  index_name: my-index

Set environment variable:

export AZURE_SEARCH_ENDPOINT=https://your-service.search.windows.net

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 Azure AI Search
  • Hybrid search (vector + keyword)
  • Managed identity (Azure AD) authentication support
  • API key authentication support
  • Configurable index names
  • 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_azure_vectordb-0.6.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

nlweb_azure_vectordb-0.6.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file nlweb_azure_vectordb-0.6.0.tar.gz.

File metadata

  • Download URL: nlweb_azure_vectordb-0.6.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nlweb_azure_vectordb-0.6.0.tar.gz
Algorithm Hash digest
SHA256 336489bff1f6eb2bf1a5f997901d1d3e6daf0bf5ff139c17f01153b927bea8e2
MD5 c0138f2699d81bce1e48702d880e5e9e
BLAKE2b-256 2ef4eb771bb331948dd99d7cc57e907fd3c2daa193f52911e5767cc521bbf7c1

See more details on using hashes here.

File details

Details for the file nlweb_azure_vectordb-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: nlweb_azure_vectordb-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nlweb_azure_vectordb-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d466e0e57608844a673686ae011f4416473bb82d935a1360d3b204377c675e1
MD5 fd1ae579ba5aba1bd6ddfc72503a370a
BLAKE2b-256 d16811e02dd1cb9822a61c4fc3bd69cf7b022c3b6aeaa2314c807386e9eb05cb

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