Skip to content

Add TypeScript select-algorithm sample#60

Closed
diberry wants to merge 3 commits into
Azure-Samples:mainfrom
diberry:squad/docdb-vector-algorithms-typescript
Closed

Add TypeScript select-algorithm sample#60
diberry wants to merge 3 commits into
Azure-Samples:mainfrom
diberry:squad/docdb-vector-algorithms-typescript

Conversation

@diberry

@diberry diberry commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

Adds TypeScript sample for comparing DocumentDB vector index algorithms (DiskANN, HNSW, IVF) across distance functions (cosine, L2, inner product).

Replaces #54 (branch rename for consistency).

Compares DiskANN, HNSW, and IVF vector index algorithms across
COS, L2, and IP similarity metrics. Creates 9 collections
(3 algorithms × 3 distances) for comprehensive comparison.

Follows vector-search-typescript pattern: OIDC auth, mongodb driver,
db.command() index creation, $search aggregation queries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry

diberry commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator Author

🔄 Squad Review — PR #60 (DocumentDB Vector Algorithms - TypeScript)

Reviewers: Alex (TypeScript), Drummer (Tech Review)

✅ Approved

Alex (TypeScript Engineer):

  • Adds TypeScript sample comparing DocumentDB vector index algorithms (DiskANN, HNSW, IVF) across distance functions (cosine, L2, inner product)
  • Uses getClientsPasswordless() — correct auth pattern matching existing DocumentDB samples
  • 1751 additions, 11 files — well-scoped
  • Replaces DocumentDB | quickstart-sdk | Compare vector index algorithms with TypeScript #54 (branch rename for consistency) — good housekeeping
  • Uses ESM imports, MongoDB driver, OIDC auth callback — aligns with documented DocumentDB patterns

Drummer (Tech Reviewer):

  • ✅ Auth: Passwordless via OIDC callback — correct for DocumentDB
  • ✅ Index creation via db.command() — correct pattern
  • ✅ `` aggregation for vector queries — correct
  • ✅ Multiple algorithm comparison (DiskANN, HNSW, IVF) — good coverage

Holden (Content Lead):

  • ✅ Concise but informative PR description
  • ✅ Sample structure follows established patterns

Verdict: squad:pr-reviewed

Awaiting squad:pr-dina-approved before merge.

@diberry diberry added the squad:pr-reviewed Squad team has reviewed this PR label Mar 31, 2026
@diberry

diberry commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator Author

📊 Squad Status — PR Review

Ralph (Work Monitor) — sweep on 2026-03-31

Review Pipeline Status

  • squad:pr-reviewed — Squad review complete
  • Awaiting squad:pr-dina-approved — Dina must review and approve before merge

Next Steps

  1. Dina reviews this PR
  2. If approved, Dina adds squad:pr-dina-approved label
  3. Ralph merges after Dina's approval

⚠️ Will NOT merge without Dina's explicit approval.

@diberry diberry changed the title DocumentDB | quickstart-sdk | Compare vector index algorithms with TypeScript Add TypeScript select-algorithm sample Apr 27, 2026
diberry and others added 2 commits April 27, 2026 12:33
- Remove noImplicitAny: false (strict: true already enables it)
- Update target from ES2020 to ES2022 (Node.js 20+ features)
- Add embedding dimension validation after query embedding generation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add timeout (30s) and maxRetries (3) to AzureOpenAI client
- Update API version to 2024-10-21
- Add explicit types to function parameters
- Add startup validation for required environment variables

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry

diberry commented May 5, 2026

Copy link
Copy Markdown
Collaborator Author

Closing — this work has been consolidated into PR #74 (combined Article 2+3: select-algorithm samples for all 5 languages).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad:pr-reviewed Squad team has reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant