From 73e18e3cf942052478eed6e0c3941a31a3864117 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 17 Sep 2025 13:06:37 +0200 Subject: [PATCH] [Demo] Fix QueryCommand to use same embedding model as vectorizer Use TEXT_ADA_002 for query embeddings to match the vectorizer configuration, ensuring consistent embedding models between indexing and querying for better similarity search results. --- demo/src/Blog/Command/QueryCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/src/Blog/Command/QueryCommand.php b/demo/src/Blog/Command/QueryCommand.php index 82c2ad67d..e315c33e9 100644 --- a/demo/src/Blog/Command/QueryCommand.php +++ b/demo/src/Blog/Command/QueryCommand.php @@ -44,7 +44,7 @@ public function __invoke(SymfonyStyle $io): int $io->comment(\sprintf('Converting "%s" to vector & searching in Chroma DB ...', $search)); $io->comment('Results are limited to 4 most similar documents.'); - $platformResponse = $this->platform->invoke(new Embeddings(Embeddings::TEXT_3_SMALL), $search); + $platformResponse = $this->platform->invoke(new Embeddings(Embeddings::TEXT_ADA_002), $search); $queryResponse = $collection->query( queryEmbeddings: [$platformResponse->asVectors()[0]->getData()], nResults: 4,