@@ -18,7 +18,7 @@ import {
1818 WeaviateVectorsConfig ,
1919} from '../../openapi/types.js' ;
2020import { DbVersionSupport } from '../../utils/dbVersion.js' ;
21- import { QuantizerGuards , VectorIndexGuards } from '../configure/parsing.js' ;
21+ import { MultiVectorEncodingGuards , QuantizerGuards , VectorIndexGuards } from '../configure/parsing.js' ;
2222import {
2323 PropertyConfigCreate ,
2424 ReferenceConfigCreate ,
@@ -39,6 +39,7 @@ import {
3939 ModuleConfig ,
4040 MultiTenancyConfig ,
4141 MultiVectorConfig ,
42+ MultiVectorEncodingConfig ,
4243 PQConfig ,
4344 PQEncoderConfig ,
4445 PQEncoderDistribution ,
@@ -147,18 +148,34 @@ export const parseVectorIndex = (module: ModuleConfig<VectorIndexType, VectorInd
147148 } ;
148149 }
149150
150- let multiVector ;
151+ let multivector : any ;
151152 if ( VectorIndexGuards . isHNSW ( module . config ) && module . config . multiVector !== undefined ) {
152- multiVector = {
153- ... module . config . multiVector ,
153+ multivector = {
154+ aggregation : module . config . multiVector . aggregation ,
154155 enabled : true ,
155156 } ;
157+ if (
158+ module . config . multiVector . encoding !== undefined &&
159+ MultiVectorEncodingGuards . isMuvera ( module . config . multiVector . encoding )
160+ ) {
161+ multivector . muvera = {
162+ enabled : true ,
163+ ksim : module . config . multiVector . encoding . ksim ,
164+ dprojections : module . config . multiVector . encoding . dprojections ,
165+ repetitions : module . config . multiVector . encoding . repetitions ,
166+ } ;
167+ }
156168 }
157169
158- const { quantizer, ...conf } = module . config as
170+ const { quantizer, ...rest } = module . config as
159171 | VectorIndexConfigFlatCreate
160172 | VectorIndexConfigHNSWCreate
161173 | Record < string , any > ;
174+
175+ const conf = {
176+ ...rest ,
177+ multivector,
178+ } ;
162179 if ( quantizer === undefined ) return conf ;
163180 if ( QuantizerGuards . isBQCreate ( quantizer ) ) {
164181 const { type, ...quant } = quantizer ;
@@ -476,6 +493,7 @@ class ConfigMapping {
476493 } else {
477494 quantizer = undefined ;
478495 }
496+
479497 return {
480498 cleanupIntervalSeconds : v . cleanupIntervalSeconds ,
481499 distance : v . distance ,
@@ -502,8 +520,25 @@ class ConfigMapping {
502520 if ( v . enabled === false ) return undefined ;
503521 if ( ! exists < string > ( v . aggregation ) )
504522 throw new WeaviateDeserializationError ( 'Multi vector aggregation was not returned by Weaviate' ) ;
523+ let encoding : MultiVectorEncodingConfig | undefined ;
524+ if (
525+ exists < {
526+ ksim : number ;
527+ dprojections : number ;
528+ repetitions : number ;
529+ enabled : boolean ;
530+ } > ( v . muvera )
531+ ) {
532+ encoding = v . muvera . enabled
533+ ? {
534+ type : 'muvera' ,
535+ ...v . muvera ,
536+ }
537+ : undefined ;
538+ }
505539 return {
506540 aggregation : v . aggregation ,
541+ encoding,
507542 } ;
508543 }
509544 static bq ( v ?: Record < string , unknown > ) : BQConfig | undefined {
0 commit comments