Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/urjitbhatia/vectorstores
various vector store clients
https://github.com/urjitbhatia/vectorstores
Last synced: 6 days ago
JSON representation
various vector store clients
- Host: GitHub
- URL: https://github.com/urjitbhatia/vectorstores
- Owner: urjitbhatia
- License: mit
- Created: 2023-10-11T23:42:57.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-24T19:46:10.000Z (about 1 year ago)
- Last Synced: 2024-04-27T09:32:37.117Z (7 months ago)
- Language: Go
- Size: 165 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vector-search - Golang vector stores collection - Chroma, PGVector interfaces
README
# vectorstores
[![Go Reference](https://pkg.go.dev/badge/github.com/urjitbhatia/vectorstores.svg)](https://pkg.go.dev/github.com/urjitbhatia/vectorstores)
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
- Make sure the Postgres version you are using has the [PGVector extension supported](https://github.com/pgvector/pgvector#installation)## Usage:
```go
// 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)
```