Skip to content

feat: add Azure AI Search vector contract and update existing vector …#46

Merged
furkan-cyber merged 3 commits intomainfrom
feat/add-azure-ai-search-and-update-vector-contracts
Mar 13, 2026
Merged

feat: add Azure AI Search vector contract and update existing vector …#46
furkan-cyber merged 3 commits intomainfrom
feat/add-azure-ai-search-and-update-vector-contracts

Conversation

@furkan-cyber
Copy link
Contributor

…provider contracts

  • Add azureAiSearchVector.contract.ts with full Zod schema for Azure AI Search configuration
  • Update elasticsearchCloudVector.contract.ts with expanded field support
  • Extend milvusCloudVector.contract.ts and milvusVector.contract.ts with additional fields
  • Register azureAiSearch in contracts/index.ts
  • Update package.json and package-lock.json dependencies

…provider contracts

- Add azureAiSearchVector.contract.ts with full Zod schema for Azure AI Search configuration
- Update elasticsearchCloudVector.contract.ts with expanded field support
- Extend milvusCloudVector.contract.ts and milvusVector.contract.ts with additional fields
- Register azureAiSearch in contracts/index.ts
- Update package.json and package-lock.json dependencies
@anilguleroglu
Copy link
Contributor

Review summary (key correctness/regression risks):

  1. Milvus metric mismatch on auto-created indexes
  • Files: src/lib/providers/contracts/milvusCloudVector.contract.ts, milvusVector.contract.ts
  • upsertVectors creates index with metric_type 'COSINE' when missing. If configured metric is dot/euclidean, recreated indexes use cosine -> incorrect similarity scoring.
  • Suggest: use handle.metric (or stored config) to set metric_type consistently.
  1. Elasticsearch Cloud API key requirement vs runtime behavior
  • File: elasticsearchCloudVector.contract.ts
  • Form now requires apiKey, but runtime still allows username/password. This blocks existing username/password-only configs even though runtime supports them.
  • Suggest: keep apiKey optional or remove username/password support to match validation.
  1. Elasticsearch Cloud init permission regression
  • createRuntime calls client.info(); API keys with only index-level perms may fail 403 even if index ops would succeed.
  • Suggest: check indices.exists or handle 403 with guidance.
  1. Node compatibility risk from new deps
  • package-lock shows @azure/search-documents and related Azure libs require Node >=20; package.json has no engines.
  • Confirm runtime Node version or declare engines.node.

Tests to consider: Milvus dot metric index creation + upsert; ES Cloud with least-privilege API key; Azure AI Search smoke test on Node 18/20.

@anilguleroglu
Copy link
Contributor

PR review findings:

  1. Elasticsearch Cloud validation regression: elasticsearchCloudVector.contract.ts marks apiKey as required in the form, but runtime accepts API key or username/password. This blocks existing/basic-auth setups from saving config. Suggest making apiKey optional or conditionally required.

  2. Milvus metric mismatch on upsert: Both milvusCloudVector.contract.ts and milvusVector.contract.ts create missing indexes with metric_type: 'COSINE' during upsert, regardless of configured metric. This can corrupt similarity behavior for dot/euclidean indexes. Use the configured metric or reuse the metric helper to keep consistency.

Minor: listIndexes returns metric: 'cosine' for all Milvus collections; consider returning actual metric if used downstream.

See /tasks/adb6edb9-87b5-42f9-92b2-c1c386be75a6/run_1/pr_review_report.md for full details.

- elasticsearch-cloud: make apiKey optional in form (runtime already accepts apiKey OR username/password)
- milvus + milvus-cloud: use configured metric instead of hardcoded COSINE when auto-creating missing index on upsert
- milvus + milvus-cloud: listIndexes now fetches actual metric_type via describeIndex instead of returning static 'cosine'
- add metricFromMilvusType / metricFromMilvusCloudType reverse-mapping helpers
@furkan-cyber furkan-cyber merged commit 60c727b into main Mar 13, 2026
@anilguleroglu anilguleroglu deleted the feat/add-azure-ai-search-and-update-vector-contracts branch March 25, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants