Skip to content

Commit 3b104b5

Browse files
committed
chore: clean up embeddings cache after creating an index
1 parent 3264796 commit 3b104b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tools/mongodb/create/createIndex.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ export class CreateIndexTool extends MongoDBToolBase {
125125

126126
responseClarification =
127127
" Since this is a vector search index, it may take a while for the index to build. Use the `list-indexes` tool to check the index status.";
128+
// clean up the embeddings cache so it considers the new index
129+
this.session.vectorSearchEmbeddings.cleanupEmbeddingsForNamespace({ database, collection });
128130
}
129131

130132
break;

0 commit comments

Comments
 (0)