NLWeb Snowflake Cortex Search Provider
Snowflake Cortex Search vector database provider for NLWeb, enabling hybrid search capabilities using Snowflake's Cortex Search Service.
Features
- Cortex Search Integration: Native integration with Snowflake Cortex Search Service
- REST API Based: Uses Snowflake's REST API for search operations
- Hybrid Search: Combines vector similarity with keyword search
- Site Filtering: Filter search results by site or URL
- PAT Authentication: Secure authentication using Programmatic Access Tokens
- Async Support: Built with async/await for high performance
Installation
pip install nlweb-snowflake-vectordb
Configuration
Configure the Snowflake Cortex Search endpoint in your config.yaml:
retrieval_endpoints:
snowflake_prod:
db_type: snowflake_cortex_search
api_endpoint: "https://your-account.snowflakecomputing.com"
api_key: "${SNOWFLAKE_PAT}"
index_name: "MY_DATABASE.MY_SCHEMA.MY_SEARCH_SERVICE"
vector_dimensions: 1024
The index_name should be in the format: <database>.<schema>.<service>
Usage
Basic Search
from nlweb_snowflake_vectordb import SnowflakeCortexClient
# Initialize client
client = SnowflakeCortexClient(endpoint_name="snowflake_prod")
# Search for documents
results = await client.search(
query="machine learning models",
site="docs.example.com",
num_results=10
)
# Process results
for url, schema_json, name, site in results:
print(f"{name}: {url}")
Search by URL
# Find a specific document by URL
results = await client.search_by_url(
url="https://docs.example.com/ml-guide",
query="machine learning"
)
Get Available Sites
# Get list of all indexed sites
sites = await client.get_sites()
print(f"Available sites: {sites}")
API Reference
SnowflakeCortexClient
Main client for Snowflake Cortex Search operations.
Methods
search(query, site, num_results, **kwargs): Search for documents by query and sitesearch_by_url(url, query, **kwargs): Search for a specific document by URLget_sites(**kwargs): Get list of unique site names
Snowflake Cortex Search Service
This provider requires a Snowflake Cortex Search Service with the following columns:
url: Document URL (TEXT)site: Site name (TEXT)schema_json: Schema metadata (TEXT/VARIANT)
The search service should be created with vector embeddings enabled.
Requirements
- Python 3.10+
- nlweb-core >= 0.5.4
- httpx >= 0.28.1
- Active Snowflake account with Cortex Search enabled
- Valid Programmatic Access Token (PAT)
Note on Data Ingestion
Unlike other vector database providers, Snowflake Cortex Search does not support programmatic document upload through this client. Data must be loaded into Snowflake tables using Snowflake's native data loading tools (COPY INTO, Snowpipe, etc.) before creating the Cortex Search Service.
This package provides read-only access to existing Cortex Search Services.
License
MIT License - see LICENSE file for details.
Links
Metadata
Release files for nlweb-snowflake-vectordb 0.5.42
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nlweb_snowflake_vectordb-0.5.42.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nlweb_snowflake_vectordb-0.5.42-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / nlweb_snowflake_vectordb-0.5.42.tar.gz
| Download URL | nlweb_snowflake_vectordb-0.5.42.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be2bd99e8d073de83857f2f124190b228bb3a87ea870bca14d8cd4a0d93aa6cd
|
|
BLAKE2b-256 checksum How to use checksums |
7a5e2ea252b1f967327aa35231cd03e34748596ca1277748aab490a7c5cbcf85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / nlweb_snowflake_vectordb-0.5.42-py3-none-any.whl
| Download URL | nlweb_snowflake_vectordb-0.5.42-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f33e9576d071ca468d93cc9a89905c85ad4fb11c5a7198e042fe624283c949e
|
|
BLAKE2b-256 checksum How to use checksums |
6bd568acff40b039d5994d49d1660132c03358e20f8298498cb0e50fbff031a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|