Skip to main content

BenoStreamDB Search (benostreamdb-search)

OpenSearch / Elasticsearch 7.10 and Qdrant REST compatibility gateway for BenoStreamDB.

⚠️ Security: This gateway ships stateless authentication (API key and/or JWT — see Authentication) but no TLS. Bind to 127.0.0.1 or an internal interface and terminate TLS at a reverse proxy. Do not expose it directly to the public internet. See SECURITY.md.

Overview

benostreamdb-search enables drop-in integration with applications, vector libraries, and ingest pipelines that speak:

  1. OpenSearch / Elasticsearch 7.10 REST API (/_bulk, /{index}/_doc, /{index}/_search, aggregations, index templates).
  2. Qdrant REST API (/collections, /collections/{name}/points, search, scroll).

It runs as a standalone daemon (bsdb-search) backed directly by BenoStreamDB tables on local or cloud object storage.

Installation

Via Cargo

cargo install benostreamdb-search

Via Python / PyPI

pip install benostreamdb-search

Running the Server

# Start server listening on port 9200 (OpenSearch) and 6333 (Qdrant)
bsdb-search --bind 0.0.0.0 --port 9200 --storage-uri file:///data/benostreamdb

Configuration

All configuration is via environment variables (or the equivalent CLI flags). These variables are specific to this gateway; the core engine's variables are documented in docs/CONFIGURATION.md.

Server & storage

Variable Description Default
BSDB_SEARCH_PORT Port for the OpenSearch/Elasticsearch 7.10 compatible HTTP REST API. 9200
BSDB_SEARCH_BIND Bind IP address for the OpenSearch REST server. 0.0.0.0
BSDB_SEARCH_DEVICE Compute device target ("auto", "cpu", "cuda", "rocm", "metal"). "auto"
BSDB_SEARCH_STORAGE_URI Storage URI for search indices (e.g. s3://bucket/search or file:///data). ./data
BSDB_SEARCH_INDEX_CACHE_GB Size cap in GB for on-demand sidecar index file LRU cache. 1
BSDB_SEARCH_PRELOAD Preload index sidecars into memory on open (0/false/no/off disables). true
BSDB_SEARCH_PRELOAD_GB In-memory budget in GB for preloaded index sidecars; overflow spills to the mmap disk cache. 4
BSDB_SEARCH_AUTO_REFRESH_SECS Background timer interval in seconds to flush memtables to Iceberg snapshots. 1.0
BSDB_SEARCH_WAL_DURABILITY Gateway ingestion durability ("async" for batched WAL, "sync" for per-doc fsync). "async"
BSDB_SEARCH_RRF_K Smoothing constant ($k$) for Reciprocal Rank Fusion hybrid search scoring. 60
BSDB_QDRANT_BIND Bind IP address for the Qdrant-compatible Vector REST API listener. Matches BSDB_SEARCH_BIND
BSDB_QDRANT_PORT Port for the Qdrant-compatible Vector REST API listener. 6333

Authentication

The gateway supports stateless authentication — no user database to maintain. Identity is delegated to a shared secret or an external IdP's signing key. The same credentials protect both the OpenSearch/ES API and the Qdrant API.

Variable Description Default
BSDB_API_KEY Shared secret. Accepted via Authorization: Bearer <key>, Authorization: ApiKey <key>, or api-key: <key> (Qdrant). unset
BSDB_JWT_SECRET HS256 shared secret for JWT verification. unset
BSDB_JWT_PUBLIC_KEY RS256 public key (PEM) for JWT verification — the "delegate to your IdP" path. unset
BSDB_JWT_AUDIENCE Required aud claim (if set). unset
BSDB_JWT_ISSUER Required iss claim (if set). unset
BSDB_AUTH_REQUIRED Fail closed (401) when no credential is configured. false
BSDB_METRICS_PUBLIC Exempt /metrics from auth (for an internal Prometheus scraper). false

Health endpoints (/_health, /_cluster/health, /_cat/health, /healthz, /readyz, /livez) and GET / are always public.

# API key
export BSDB_API_KEY="$(openssl rand -hex 32)"
curl -H "api-key: $BSDB_API_KEY" http://127.0.0.1:9200/_cat/indices

# JWT (HS256) — verify a token minted by your IdP
export BSDB_JWT_SECRET="shared-secret"
curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:9200/_search

Where to keep the secret: never in the repo or a world-readable env file. Use a secret manager (Vault, AWS/GCP/Azure Secrets Manager) or a 0600 file mounted at /run/secrets/ (Docker/K8s) or /etc/benostreamdb/secrets/, loaded via systemd LoadCredential=/EnvironmentFile= (mode 0600).

Catalog storage policy (access control)

The gateway is an untrusted, network-facing connector: reads and writes are governed by the authoritative catalog storage policy — a .benostream-policy.json object in the warehouse/bucket root (a local path or an object store such as s3://, resolved through the core object store).

  • Schemas come from the backend — the gateway never creates one. A schema exists because an operator provisioned it and named it in the policy. Writing an index whose schema is not granted returns 403.
  • Writes are allowed only to schemas listed in readwrite_schemas. There is no default scratch namespace (unlike the local MCP server): a server connector is read-only until an operator publishes a policy.
  • Reads have a read-only floor — with no policy every schema is readable (read-only) — and, when a policy is present, its readwrite_schemas / readonly_schemas / immutable lists are an allowlist for reads too. A read of a schema the policy does not name is denied before the index's existence is even checked.
  • Immutable system schemas (default, public, information_schema, sys, system) are never writable.
  • Policy updates are read-modify-write with optimistic concurrency (CAS on object stores that support conditional PUTs).

Enforcement is identical across the OpenSearch API (_search, _count, _doc/{id}, _mapping, _bulk, aliases, index create/delete) and the Qdrant API (search / query / scroll / retrieve / count / recommend / discover plus every mutating route).

Example .benostream-policy.json at the warehouse root:

{
  "policy_version": "1.0",
  "readwrite_schemas": ["analytics", "reporting"],
  "readonly_schemas": ["archive"],
  "no_access_schemas": ["pii"],
  "default_write_schema": "analytics"
}

With this policy the gateway may write analytics.* and reporting.* indexes, may only read analytics, reporting, and archive, and denies everything else.

Operational note: a deployment that publishes no policy is read-only — the gateway logs a WARN at startup ("search gateway is READ-ONLY: no writable schema"). Provision the schema(s) and publish a policy before expecting writes. Set BSDB_SEARCH_REQUIRE_POLICY=1 to refuse to start rather than run read-only. See docs/CATALOG_USAGE.md and docs/SUPPORT_MATRIX.md for the full model.

Iceberg catalog integration

benostreamdb-search can automatically synchronize search indices with an external Apache Iceberg catalog (Snowflake / Apache Polaris, Project Nessie, AWS Glue, Hive Metastore, or Unity Catalog) so ingested documents immediately advance the catalog's current snapshot.

Variable Description Default
BSDB_SEARCH_CATALOG_TYPE Catalog provider: "rest" (Snowflake Polaris / Lakekeeper), "nessie", "glue", "hive", "unity". None (path-based Iceberg)
BSDB_SEARCH_CATALOG_URL Catalog REST/Service endpoint (e.g. https://polaris.example.com/api/catalog/v1). None
BSDB_SEARCH_CATALOG_URI Alias for BSDB_SEARCH_CATALOG_URL (also accepts BSDB_CATALOG_URI). None
BSDB_SEARCH_CATALOG_NAMESPACE Catalog namespace where search index tables are created and committed. default
BSDB_SEARCH_CATALOG_CREDENTIAL OAuth2 Client Credentials (<client_id>:<client_secret>) for Polaris / REST. None
BSDB_SEARCH_CATALOG_TOKEN Bearer token for Iceberg REST authentication. None
BSDB_SEARCH_CATALOG_PREFIX Warehouse or catalog prefix (e.g. Polaris warehouse name). None
BSDB_SEARCH_CATALOG_ID AWS Glue Account / Catalog ID (when using Glue). None

Note: The gateway also accepts the core-engine aliases BSDB_CATALOG_TYPE, BSDB_CATALOG_URL / BSDB_CATALOG_URI, BSDB_CATALOG_TOKEN, BSDB_CATALOG_CREDENTIAL, and BSDB_CATALOG_NAMESPACE as fallbacks when the corresponding BSDB_SEARCH_CATALOG_* variable is unset.

Snowflake Polaris setup: Set BSDB_SEARCH_CATALOG_TYPE=rest, BSDB_SEARCH_CATALOG_URL=https://<account>.snowflakecomputing.com/polaris/api/catalog/v1, and BSDB_SEARCH_CATALOG_CREDENTIAL=<client_id>:<client_secret>. Every bulk ingest via /_bulk or _doc automatically executes an Iceberg atomic swap against Snowflake Polaris.

Metadata

Release files for benostreamdb-search 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for benostreamdb-search 0.13.0
File
benostreamdb_search-0.13.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
benostreamdb_search-0.13.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
benostreamdb_search-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
benostreamdb_search-0.13.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
benostreamdb_search-0.13.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 311.0 MB

Release files / benostreamdb_search-0.13.0-py3-none-win_amd64.whl

Download URL benostreamdb_search-0.13.0-py3-none-win_amd64.whl
Size 67.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
38634e3d303f260a4255da5b56553e115c9a97865ede22a196c342ce43d7b330
BLAKE2b-256 checksum
How to use checksums
624b70273c024f5ad00a6a6006e9ec3f321b8eac3d27c7a9183ea1a187cd06e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / benostreamdb_search-0.13.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL benostreamdb_search-0.13.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 63.9 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2422b706c03a3b167d765dba5252b1b3bd0466aaccc3c8571191ac99747603d0
BLAKE2b-256 checksum
How to use checksums
61b75dc39310b8a29deada59717143f122563308c61fc461835897f4fec6378f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / benostreamdb_search-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL benostreamdb_search-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 60.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b2d12b698c46e6246035b167f409f0cfc927ed96385f2597e1c3cd76a2196602
BLAKE2b-256 checksum
How to use checksums
cac9fca95a5a76915d9ecebcf43fe94f93fe722f644658ac7d0e8355e68477c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / benostreamdb_search-0.13.0-py3-none-macosx_11_0_arm64.whl

Download URL benostreamdb_search-0.13.0-py3-none-macosx_11_0_arm64.whl
Size 57.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2b8a2460c9856e00a56504d6cde3ac53829e27fc579b1636727ba13b042546d7
BLAKE2b-256 checksum
How to use checksums
f05abbf75e31b114819491d45493791bb81a42f69efe074d288819d655d5143b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / benostreamdb_search-0.13.0-py3-none-macosx_10_12_x86_64.whl

Download URL benostreamdb_search-0.13.0-py3-none-macosx_10_12_x86_64.whl
Size 61.2 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
81f9d692fc9c5cdc4fcedbd20846f64e8c41f837283b818717c2dbd26b859d88
BLAKE2b-256 checksum
How to use checksums
51a584326041c2c2aea9394cac6641c7ae0c03fc029216973598a6b1461ffcf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for benostreamdb-search 0.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for benostreamdb_search-0.13.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page