Versions in this module Expand all Collapse all v1 v1.17.0 Jul 8, 2026 Changes in this version + const DefaultEmbeddingDimensions + const DefaultQueryTopK + const DefaultTitanEmbedTextModelID + const EnvEmbeddingDimensions + const EnvEmbeddingModelID + const EnvEmbeddingNormalize + const EnvEmbeddingProvider + const EnvVectorBucketName + const EnvVectorDimension + const EnvVectorIndexARN + const EnvVectorIndexName + const ErrorCodeDimensionMismatch + const ErrorCodeEmbeddingFailed + const ErrorCodeInvalidConfig + const ErrorCodeInvalidInput + const ErrorCodeInvalidVector + const ErrorCodeNotFound + const ErrorCodeUnsupportedOperation + const MaxPutDeleteBatchSize + const MaxQueryTopK + var ErrDimensionMismatch = &Error + var ErrEmbeddingFailed = &Error + var ErrInvalidConfig = &Error + var ErrInvalidInput = &Error + var ErrInvalidVector = &Error + var ErrNotFound = &Error + var ErrUnsupportedOperation = &Error + func CloneMetadata(in map[string]any) map[string]any + func CloneVector(in []float32) []float32 + func EmbeddingErrorCode(err error) string + func NormalizeTopK(topK int) int + func ValidateDimension(dimension int) error + func ValidateKey(key string) error + func ValidateRequiredMetadata(metadata map[string]any, required []string) error + func ValidateVector(vector []float32, dimension int) error + type BedrockRuntimeAPI interface + InvokeModel func(context.Context, *bedrockruntime.InvokeModelInput, ...) (*bedrockruntime.InvokeModelOutput, error) + type Call struct + Filter map[string]any + Keys []string + Operation string + Records []VectorRecord + ReturnMetadata bool + TopK int + Vector []float32 + type DeleteInput struct + Keys []string + type Embedder interface + Embed func(context.Context, string) ([]float32, error) + EmbedBatch func(context.Context, []string) ([][]float32, error) + type Error struct + Cause error + Code string + Message string + func NewError(code, message string, cause error) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Unwrap() error + type FakeEmbedder struct + Calls []string + Default []float32 + Embeddings map[string][]float32 + func NewFakeEmbedder(embeddings map[string][]float32) *FakeEmbedder + func (e *FakeEmbedder) Embed(_ context.Context, text string) ([]float32, error) + func (e *FakeEmbedder) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error) + type FakeStore struct + Dimension int + RequiredMetadataKeys []string + func NewFakeStore(dimension int) *FakeStore + func (s *FakeStore) Calls() []Call + func (s *FakeStore) DeleteVectors(_ context.Context, input DeleteInput) error + func (s *FakeStore) GetVectors(_ context.Context, input GetInput) ([]VectorRecord, error) + func (s *FakeStore) PutVectors(_ context.Context, input PutInput) error + func (s *FakeStore) QueryVectors(_ context.Context, input QueryInput) ([]QueryHit, error) + func (s *FakeStore) SetError(operation string, err error) + type GetInput struct + Keys []string + ReturnMetadata bool + type PutInput struct + Records []VectorRecord + type QueryHit struct + Distance float32 + Key string + Metadata map[string]any + type QueryInput struct + Filter map[string]any + ReturnMetadata bool + TopK int + Vector []float32 + type S3VectorStore struct + Client S3VectorsAPI + Dimension int + IndexName string + MaxBatchSize int + VectorBucketName string + func NewS3VectorStore(ctx context.Context, vectorBucketName, indexName string, dimension int) (*S3VectorStore, error) + func (s *S3VectorStore) DeleteVectors(ctx context.Context, input DeleteInput) error + func (s *S3VectorStore) GetVectors(ctx context.Context, input GetInput) ([]VectorRecord, error) + func (s *S3VectorStore) PutVectors(ctx context.Context, input PutInput) error + func (s *S3VectorStore) QueryVectors(ctx context.Context, input QueryInput) ([]QueryHit, error) + type S3VectorsAPI interface + DeleteVectors func(context.Context, *s3vectors.DeleteVectorsInput, ...func(*s3vectors.Options)) (*s3vectors.DeleteVectorsOutput, error) + GetVectors func(context.Context, *s3vectors.GetVectorsInput, ...func(*s3vectors.Options)) (*s3vectors.GetVectorsOutput, error) + PutVectors func(context.Context, *s3vectors.PutVectorsInput, ...func(*s3vectors.Options)) (*s3vectors.PutVectorsOutput, error) + QueryVectors func(context.Context, *s3vectors.QueryVectorsInput, ...func(*s3vectors.Options)) (*s3vectors.QueryVectorsOutput, error) + type SemanticIndex struct + Dimension int + Embedder Embedder + RequiredMetadataKeys []string + Store Store + func (i *SemanticIndex) PutText(ctx context.Context, records []SemanticRecord) error + func (i *SemanticIndex) QueryText(ctx context.Context, text string, input QueryInput) ([]QueryHit, error) + type SemanticRecord struct + Key string + Metadata map[string]any + Text string + type Store interface + DeleteVectors func(context.Context, DeleteInput) error + GetVectors func(context.Context, GetInput) ([]VectorRecord, error) + PutVectors func(context.Context, PutInput) error + QueryVectors func(context.Context, QueryInput) ([]QueryHit, error) + type TitanEmbedder struct + BatchConcurrency int + Dimensions int + ModelID string + Normalize bool + Runtime BedrockRuntimeAPI + func NewTitanEmbedder(ctx context.Context) (*TitanEmbedder, error) + func (e *TitanEmbedder) Embed(ctx context.Context, text string) ([]float32, error) + func (e *TitanEmbedder) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error) + type VectorRecord struct + Data []float32 + Key string + Metadata map[string]any v1.17.0-rc Jul 8, 2026