Skip to content

Conversation

nirinchev
Copy link
Collaborator

@nirinchev nirinchev commented Oct 7, 2025

Proposed changes

This adds the ability to create a vector search index to the create-index tool. This is a consolidated tool that's using a discriminated union definition when deciding what type of index to create.

For the initial release, we're feature-flagging the search capabilities, so only adding the vector search option to the union in case the feature flag is enabled, but that will be dropped in the future. We're not updating the definition regardless of whether we're connected to atlas search capable server or not.

@github-actions

This comment has been minimized.

@coveralls
Copy link
Collaborator

coveralls commented Oct 8, 2025

Pull Request Test Coverage Report for Build 18482155309

Details

  • 116 of 119 (97.48%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 82.392%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/tools/tool.ts 9 10 90.0%
src/tools/mongodb/create/createIndex.ts 107 109 98.17%
Totals Coverage Status
Change from base Build 18478241913: 0.2%
Covered Lines: 5729
Relevant Lines: 6823

💛 - Coveralls

@nirinchev nirinchev force-pushed the ni/create-vector-index branch from 4113579 to 69aa6d0 Compare October 13, 2025 23:07
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

📊 Accuracy Test Results

📈 Summary

Metric Value
Commit SHA f9049793f49cf21f476ddc3ac63ab3a62b556e65
Run ID 68279090-52b9-4b9b-8b68-099b6eb9896f
Status done
Total Prompts Evaluated 73
Models Tested 1
Average Accuracy 91.1%
Responses with 0% Accuracy 6
Responses with 75% Accuracy 2
Responses with 100% Accuracy 65

📊 Baseline Comparison

Metric Value
Baseline Commit faad36d48d7d7968df509c730188898f29fd6e0f
Baseline Run ID eba50acd-56e7-4a8a-b4f7-3fa0c0f1a536
Baseline Run Status done
Responses Improved 3
Responses Regressed 1

📎 Download Full HTML Report - Look for the accuracy-test-summary artifact for detailed results.

Report generated on: 10/14/2025, 10:36:40 AM

@nirinchev nirinchev marked this pull request as ready for review October 14, 2025 11:33
@nirinchev nirinchev requested a review from a team as a code owner October 14, 2025 11:33
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 11:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds vector search index creation capability to the existing create-index tool, allowing users to create both classic MongoDB indexes and vector search indexes through the MCP server.

  • Extends the create-index tool to support vector search indexes alongside existing classic indexes
  • Refactors the tool's API to use a definition array with discriminated union types for different index types
  • Adds comprehensive test coverage for the new vector search functionality

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tools/mongodb/create/createIndex.ts Core implementation adding vector search index support with feature flag gating
src/tools/tool.ts Adds feature flag infrastructure for vector search functionality
tests/integration/tools/mongodb/create/createIndex.test.ts Extensive test coverage for both classic and vector search index creation
tests/integration/tools/mongodb/mongodbHelpers.ts Moves shared search helper functions from individual test files
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts Refactors to use centralized helper functions
tests/integration/helpers.ts Updates parameter validation to handle discriminated union schemas
tests/accuracy/createIndex.test.ts Updates accuracy tests with new API and adds vector search test cases
tests/accuracy/dropIndex.test.ts Updates to use new definition array format
tests/accuracy/sdk/describeAccuracyTests.ts Adds voyage API key parameter support
tests/accuracy/sdk/accuracyTestingClient.ts Adds voyage API key to client initialization

Copy link
Collaborator

@himanshusinghs himanshusinghs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🚀 I have left small suggestions.

const isVectorSearchSupported = await this.session.isConnectedToMongot;
if (!isVectorSearchSupported) {
// TODO: remove hacky casts once we merge the local dev tools
const isLocalAtlasAvailable =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are checking if a tool exists in a few places already in other places, maybe we can extract this to a function and refactor?

@nirinchev nirinchev enabled auto-merge (squash) October 15, 2025 11:43
@nirinchev nirinchev merged commit a7720fe into main Oct 15, 2025
16 checks passed
@nirinchev nirinchev deleted the ni/create-vector-index branch October 15, 2025 11:45
@nirinchev nirinchev changed the title feat: add ability to create vector search indexes MCP-234 feat: add ability to create vector search indexes MCP-234 MCP-243 Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants