store

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 1 Imported by: 0

README

vectorstores

Go Reference

This repo is a collection of clients for various vector stores aligned with the VectorStores interface defined in https://github.com/tmc/langchaingo. This repo allows for testing the store client implementations.

Supported Stores

  1. Chroma: https://docs.trychroma.com/
  2. PGVector: https://github.com/pgvector/pgvector

Usage:

// Initialize the PGVector store
store, err = pgvector.NewPGVectorStore(
   pgvector.WithCreds("test", "test"),
   pgvector.WithCollection("myproject"),
   pgvector.WithEndpoint("localhost", 5432),
   pgvector.WithDBName("test"),
   pgvector.WithEmbedder(openAIEmbedder),
)
// Or the Chroma Store
store, err = chroma.NewChroma(
   chroma.WithAddr("http://localhost:8000"),
   chroma.WithEmbedder(testEmbedder{}),
   chroma.WithCollection("unittest", nil),
)

// Add documents
err := store.AddDocuments(context.Background(), docs)

// Search for documents
docs, err := store.SimilaritySearch(context.Background(), query, 1)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VectorStore

type VectorStore interface {
	vectorstores.VectorStore
	CollectionSize() (int, error)
	CollectionName() string
	ClearCollection() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL