40
40
use Symfony \AI \Platform \ResultConverterInterface ;
41
41
use Symfony \AI \Store \Bridge \Azure \SearchStore as AzureSearchStore ;
42
42
use Symfony \AI \Store \Bridge \ChromaDb \Store as ChromaDbStore ;
43
+ use Symfony \AI \Store \Bridge \Meilisearch \Store as MeilisearchStore ;
43
44
use Symfony \AI \Store \Bridge \MongoDb \Store as MongoDbStore ;
45
+ use Symfony \AI \Store \Bridge \Neo4j \Store as Neo4jStore ;
44
46
use Symfony \AI \Store \Bridge \Pinecone \Store as PineconeStore ;
47
+ use Symfony \AI \Store \Bridge \Qdrant \Store as QdrantStore ;
48
+ use Symfony \AI \Store \Bridge \SurrealDb \Store as SurrealDbStore ;
45
49
use Symfony \AI \Store \Document \Vectorizer ;
46
50
use Symfony \AI \Store \Indexer ;
51
+ use Symfony \AI \Store \InMemoryStore ;
47
52
use Symfony \AI \Store \StoreInterface ;
48
53
use Symfony \AI \Store \VectorStoreInterface ;
49
54
use Symfony \Component \Config \Definition \Configurator \DefinitionConfigurator ;
@@ -476,6 +481,50 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
476
481
}
477
482
}
478
483
484
+ if ('meilisearch ' === $ type ) {
485
+ foreach ($ stores as $ name => $ store ) {
486
+ $ arguments = [
487
+ new Reference ('http_client ' ),
488
+ $ store ['api_key ' ],
489
+ $ store ['index_name ' ],
490
+ ];
491
+
492
+ if (\array_key_exists ('embedder ' , $ store )) {
493
+ $ arguments [3 ] = $ store ['embedder ' ];
494
+ }
495
+
496
+ if (\array_key_exists ('vector_field ' , $ store )) {
497
+ $ arguments [4 ] = $ store ['vector_field ' ];
498
+ }
499
+
500
+ if (\array_key_exists ('dimensions ' , $ store )) {
501
+ $ arguments [5 ] = $ store ['dimensions ' ];
502
+ }
503
+
504
+ $ definition = new Definition (MeilisearchStore::class);
505
+ $ definition
506
+ ->addTag ('ai.store ' )
507
+ ->setArguments ($ arguments );
508
+
509
+ $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
510
+ }
511
+ }
512
+
513
+ if ('memory ' === $ type ) {
514
+ foreach ($ stores as $ name => $ store ) {
515
+ $ arguments = [
516
+ $ store ['distance ' ],
517
+ ];
518
+
519
+ $ definition = new Definition (InMemoryStore::class);
520
+ $ definition
521
+ ->addTag ('ai.store ' )
522
+ ->setArguments ($ arguments );
523
+
524
+ $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
525
+ }
526
+ }
527
+
479
528
if ('mongodb ' === $ type ) {
480
529
foreach ($ stores as $ name => $ store ) {
481
530
$ arguments = [
@@ -502,6 +551,43 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
502
551
}
503
552
}
504
553
554
+ if ('neo4j ' === $ type ) {
555
+ foreach ($ stores as $ name => $ store ) {
556
+ $ arguments = [
557
+ new Reference ('http_client ' ),
558
+ $ store ['endpoint ' ],
559
+ $ store ['username ' ],
560
+ $ store ['password ' ],
561
+ $ store ['database ' ],
562
+ $ store ['vector_index_name ' ],
563
+ $ store ['node_name ' ],
564
+ ];
565
+
566
+ if (\array_key_exists ('vector_field ' , $ store )) {
567
+ $ arguments [7 ] = $ store ['vector_field ' ];
568
+ }
569
+
570
+ if (\array_key_exists ('dimensions ' , $ store )) {
571
+ $ arguments [8 ] = $ store ['dimensions ' ];
572
+ }
573
+
574
+ if (\array_key_exists ('distance ' , $ store )) {
575
+ $ arguments [9 ] = $ store ['distance ' ];
576
+ }
577
+
578
+ if (\array_key_exists ('quantization ' , $ store )) {
579
+ $ arguments [10 ] = $ store ['quantization ' ];
580
+ }
581
+
582
+ $ definition = new Definition (Neo4jStore::class);
583
+ $ definition
584
+ ->addTag ('ai.store ' )
585
+ ->setArguments ($ arguments );
586
+
587
+ $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
588
+ }
589
+ }
590
+
505
591
if ('pinecone ' === $ type ) {
506
592
foreach ($ stores as $ name => $ store ) {
507
593
$ arguments = [
@@ -525,6 +611,72 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
525
611
$ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
526
612
}
527
613
}
614
+
615
+ if ('qdrant ' === $ type ) {
616
+ foreach ($ stores as $ name => $ store ) {
617
+ $ arguments = [
618
+ new Reference ('http_client ' ),
619
+ $ store ['endpoint ' ],
620
+ $ store ['api_key ' ],
621
+ $ store ['collection_name ' ],
622
+ ];
623
+
624
+ if (\array_key_exists ('dimensions ' , $ store )) {
625
+ $ arguments [4 ] = $ store ['dimensions ' ];
626
+ }
627
+
628
+ if (\array_key_exists ('distance ' , $ store )) {
629
+ $ arguments [5 ] = $ store ['distance ' ];
630
+ }
631
+
632
+ $ definition = new Definition (QdrantStore::class);
633
+ $ definition
634
+ ->addTag ('ai.store ' )
635
+ ->setArguments ($ arguments );
636
+
637
+ $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
638
+ }
639
+ }
640
+
641
+ if ('surreal_db ' === $ type ) {
642
+ foreach ($ stores as $ name => $ store ) {
643
+ $ arguments = [
644
+ new Reference ('http_client ' ),
645
+ $ store ['endpoint ' ],
646
+ $ store ['username ' ],
647
+ $ store ['password ' ],
648
+ $ store ['namespace ' ],
649
+ $ store ['database ' ],
650
+ ];
651
+
652
+ if (\array_key_exists ('table ' , $ store )) {
653
+ $ arguments [6 ] = $ store ['table ' ];
654
+ }
655
+
656
+ if (\array_key_exists ('vector_field ' , $ store )) {
657
+ $ arguments [7 ] = $ store ['vector_field ' ];
658
+ }
659
+
660
+ if (\array_key_exists ('strategy ' , $ store )) {
661
+ $ arguments [8 ] = $ store ['strategy ' ];
662
+ }
663
+
664
+ if (\array_key_exists ('dimensions ' , $ store )) {
665
+ $ arguments [9 ] = $ store ['dimensions ' ];
666
+ }
667
+
668
+ if (\array_key_exists ('namespaced_user ' , $ store )) {
669
+ $ arguments [10 ] = $ store ['namespaced_user ' ];
670
+ }
671
+
672
+ $ definition = new Definition (SurrealDbStore::class);
673
+ $ definition
674
+ ->addTag ('ai.store ' )
675
+ ->setArguments ($ arguments );
676
+
677
+ $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
678
+ }
679
+ }
528
680
}
529
681
530
682
/**
0 commit comments