Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions demo/config/packages/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ai:
technical: ['bug', 'problem', 'technical', 'error', 'code', 'debug']
fallback: 'fallback'
store:
chroma_db:
chromadb:
symfonycon:
collection: 'symfony_blog'
vectorizer:
Expand All @@ -99,11 +99,11 @@ ai:
- 'Symfony\AI\Store\Document\Transformer\TextSplitTransformer'
- 'Symfony\AI\Store\Document\Transformer\TextTrimTransformer'
vectorizer: 'ai.vectorizer.openai'
store: 'ai.store.chroma_db.symfonycon'
store: 'ai.store.chromadb.symfonycon'
retriever:
blog:
vectorizer: 'ai.vectorizer.openai'
store: 'ai.store.chroma_db.symfonycon'
store: 'ai.store.chromadb.symfonycon'

services:
_defaults:
Expand All @@ -112,7 +112,7 @@ services:

Symfony\AI\Agent\Bridge\SimilaritySearch\SimilaritySearch:
$vectorizer: '@ai.vectorizer.openai'
$store: '@ai.store.chroma_db.symfonycon'
$store: '@ai.store.chromadb.symfonycon'

Symfony\AI\Store\Document\Loader\RssFeedLoader: ~
Symfony\AI\Store\Document\Transformer\TextSplitTransformer: ~
Expand Down
26 changes: 13 additions & 13 deletions docs/bundles/ai-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Advanced Example with Multiple Agents
model: 'text-to-speech'
tools: false
store:
chroma_db:
chromadb:
# multiple collections possible per type
default:
collection: 'my_collection'
Expand All @@ -129,7 +129,7 @@ Advanced Example with Multiple Agents
default:
loader: 'Symfony\AI\Store\Document\Loader\InMemoryLoader'
vectorizer: 'ai.vectorizer.openai_embeddings'
store: 'ai.store.chroma_db.default'
store: 'ai.store.chromadb.default'

research:
loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader'
Expand Down Expand Up @@ -212,15 +212,15 @@ For each configured store, the bundle automatically creates two types of aliases
strategy: 'cosine'
products:
strategy: 'manhattan'
chroma_db:
chromadb:
main:
collection: 'documents'

From the configuration above, the following aliases are automatically registered:

- ``StoreInterface $main`` - References the memory store (first occurrence)
- ``StoreInterface $memoryMain`` - Explicitly references the memory store
- ``StoreInterface $chromaDbMain`` - Explicitly references the chroma_db store
- ``StoreInterface $chromadbMain`` - Explicitly references the chromadb store
- ``StoreInterface $products`` - References the memory products store
- ``StoreInterface $memoryProducts`` - Explicitly references the memory products store

Expand All @@ -232,14 +232,14 @@ You can inject stores into your services using the generated aliases::
{
public function __construct(
private StoreInterface $main, // Uses memory store (first occurrence)
private StoreInterface $chromaDbMain, // Explicitly uses chroma_db store
private StoreInterface $chromadbMain, // Explicitly uses chromadb store
private StoreInterface $memoryProducts, // Explicitly uses memory products store
) {
}
}

When multiple stores share the same name (like ``main`` in the example), the simple alias (``$main``) will reference the first occurrence.
Use type-prefixed aliases (``$memoryMain``, ``$chromaDbMain``) for explicit disambiguation.
Use type-prefixed aliases (``$memoryMain``, ``$chromadbMain``) for explicit disambiguation.

Model Configuration
-------------------
Expand Down Expand Up @@ -692,8 +692,8 @@ The ``ai:store:setup`` command prepares the required infrastructure for a store

$ php bin/console ai:store:setup <store>

# Setup the chroma_db store
$ php bin/console ai:store:setup chroma_db.default
# Setup the chromadb store
$ php bin/console ai:store:setup chromadb.default

.. note::

Expand All @@ -709,8 +709,8 @@ The ``ai:store:drop`` command drops the infrastructure for a store (e.g., remove

$ php bin/console ai:store:drop <store> --force

# Drop the chroma_db store
$ php bin/console ai:store:drop chroma_db.default --force
# Drop the chromadb store
$ php bin/console ai:store:drop chromadb.default --force

.. warning::

Expand Down Expand Up @@ -987,12 +987,12 @@ Once configured, vectorizers can be referenced by name in indexer configurations
documents:
loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader'
vectorizer: 'ai.vectorizer.openai_small'
store: 'ai.store.chroma_db.documents'
store: 'ai.store.chromadb.documents'

research:
loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader'
vectorizer: 'ai.vectorizer.openai_large'
store: 'ai.store.chroma_db.research'
store: 'ai.store.chromadb.research'

knowledge_base:
loader: 'Symfony\AI\Store\Document\Loader\InMemoryLoader'
Expand Down Expand Up @@ -1024,7 +1024,7 @@ Retrievers are defined in the ``retriever`` section of your configuration:
retriever:
default:
vectorizer: 'ai.vectorizer.openai_small'
store: 'ai.store.chroma_db.default'
store: 'ai.store.chromadb.default'

research:
vectorizer: 'ai.vectorizer.mistral_embed'
Expand Down
2 changes: 1 addition & 1 deletion docs/components/store.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ you can use the ``bin/console ai:store:setup`` command to initialize the store a
# ...

store:
chroma_db:
chromadb:
symfonycon:
collection: 'symfony_blog'

Expand Down
6 changes: 3 additions & 3 deletions docs/cookbook/rag-implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,15 @@ When using the AI Bundle, configure RAG with YAML:
model: 'text-embedding-3-small'

store:
chroma_db:
chromadb:
knowledge_base:
collection: 'docs'

indexer:
docs:
loader: 'App\Document\Loader\DocLoader'
vectorizer: 'ai.vectorizer.default'
store: 'ai.store.chroma_db.knowledge_base'
store: 'ai.store.chromadb.knowledge_base'

agent:
rag_assistant:
Expand All @@ -311,7 +311,7 @@ Then use the indexer command to populate your store:

.. code-block:: terminal

$ php bin/console ai:store:setup chroma_db.knowledge_base
$ php bin/console ai:store:setup chromadb.knowledge_base
$ php bin/console ai:store:index docs

Performance Optimization
Expand Down
2 changes: 1 addition & 1 deletion src/ai-bundle/config/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@
->end()
->end()
->end()
->arrayNode('chroma_db')
->arrayNode('chromadb')
->useAttributeAsKey('name')
->arrayPrototype()
->children()
Expand Down
2 changes: 1 addition & 1 deletion src/ai-bundle/src/AiBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
}
}

if ('chroma_db' === $type) {
if ('chromadb' === $type) {
foreach ($stores as $name => $store) {
$definition = new Definition(ChromaDbStore::class);
$definition
Expand Down
34 changes: 17 additions & 17 deletions src/ai-bundle/tests/DependencyInjection/AiBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,18 +687,18 @@ public function testChromaDbStoreCanBeConfigured()
$container = $this->buildContainer([
'ai' => [
'store' => [
'chroma_db' => [
'my_chroma_db_store' => [
'chromadb' => [
'my_chromadb_store' => [
'collection' => 'foo',
],
],
],
],
]);

$this->assertTrue($container->hasDefinition('ai.store.chroma_db.my_chroma_db_store'));
$this->assertTrue($container->hasDefinition('ai.store.chromadb.my_chromadb_store'));

$definition = $container->getDefinition('ai.store.chroma_db.my_chroma_db_store');
$definition = $container->getDefinition('ai.store.chromadb.my_chromadb_store');
$this->assertSame(ChromaDbStore::class, $definition->getClass());

$this->assertTrue($definition->isLazy());
Expand All @@ -711,9 +711,9 @@ public function testChromaDbStoreCanBeConfigured()
$this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy'));
$this->assertTrue($definition->hasTag('ai.store'));

$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chroma_db_my_chroma_db_store'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromaDbStore'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromaDbMyChromaDbStore'));
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chromadb_my_chromadb_store'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromadbStore'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromadbMyChromadbStore'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface'));
}

Expand All @@ -722,8 +722,8 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured()
$container = $this->buildContainer([
'ai' => [
'store' => [
'chroma_db' => [
'my_chroma_db_store_with_custom_client' => [
'chromadb' => [
'my_chromadb_store_with_custom_client' => [
'client' => 'bar',
'collection' => 'foo',
],
Expand All @@ -732,9 +732,9 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured()
],
]);

$this->assertTrue($container->hasDefinition('ai.store.chroma_db.my_chroma_db_store_with_custom_client'));
$this->assertTrue($container->hasDefinition('ai.store.chromadb.my_chromadb_store_with_custom_client'));

$definition = $container->getDefinition('ai.store.chroma_db.my_chroma_db_store_with_custom_client');
$definition = $container->getDefinition('ai.store.chromadb.my_chromadb_store_with_custom_client');
$this->assertSame(ChromaDbStore::class, $definition->getClass());

$this->assertTrue($definition->isLazy());
Expand All @@ -747,9 +747,9 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured()
$this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy'));
$this->assertTrue($definition->hasTag('ai.store'));

$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chroma_db_my_chroma_db_store_with_custom_client'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromaDbStoreWithCustomClient'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromaDbMyChromaDbStoreWithCustomClient'));
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chromadb_my_chromadb_store_with_custom_client'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromadbStoreWithCustomClient'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromadbMyChromadbStoreWithCustomClient'));
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface'));
}

Expand Down Expand Up @@ -6719,11 +6719,11 @@ private function getFullConfig(): array
'strategy' => 'chebyshev',
],
],
'chroma_db' => [
'my_chroma_store' => [
'chromadb' => [
'my_chromadb_store' => [
'collection' => 'my_collection',
],
'my_chroma_db_store_with_custom_client' => [
'my_chromadb_store_with_custom_client' => [
'client' => 'bar',
'collection' => 'foo',
],
Expand Down
Loading