https://github.com/hupe1980/vecgo
🧬🔍🗄️ Unlock the power of vector indexing and search in your Go applications with the HNSW algorithm for approximate nearest neighbor search, seamlessly embedded within your application.
https://github.com/hupe1980/vecgo
ann embeddings golang hnsw vector vectorstore
Last synced: 6 months ago
JSON representation
🧬🔍🗄️ Unlock the power of vector indexing and search in your Go applications with the HNSW algorithm for approximate nearest neighbor search, seamlessly embedded within your application.
- Host: GitHub
- URL: https://github.com/hupe1980/vecgo
- Owner: hupe1980
- License: mit
- Created: 2024-03-10T07:33:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-24T14:41:04.000Z (over 1 year ago)
- Last Synced: 2025-04-16T00:17:40.481Z (6 months ago)
- Topics: ann, embeddings, golang, hnsw, vector, vectorstore
- Language: Go
- Homepage:
- Size: 91.8 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧬🔍🗄️ Vecgo

[](https://pkg.go.dev/github.com/hupe1980/vecgo)
[](https://goreportcard.com/report/github.com/hupe1980/vecgo)
[](https://opensource.org/licenses/MIT)Vecgo is a Go library designed for efficient vector indexing and searching, supporting various index types and emphasizing approximate nearest neighbor search. It provides a versatile and user-friendly interface for managing and querying vast collections of high-dimensional vectors.
:warning: This is experimental and subject to breaking changes.
## Features
- Support for multiple index types, including flat and HNSW (Hierarchical Navigable Small World) algorithms.
- Customizable options for memory usage and search performance.
- Efficient handling of high-dimensional vectors.
- Embeddable vector store for seamless integration with Go applications.## Usage
Here's a basic example demonstrating how to perform nearest neighbor search with Vecgo:
```go
package mainimport (
"fmt"
"log""github.com/hupe1980/vecgo"
)func main() {
vg := vecgo.NewHNSW[string]()
// vg := vecgo.NewFlat[string]()_, err := vg.Insert(vecgo.VectorWithData[string]{
Vector: []float32{1.0, 2.0, 2.5},
Data: "Hello World!",
})
if err != nil {
log.Fatal(err)
}k := 5
result, err := vg.KNNSearch([]float32{1.0, 2.0, 2.5}, k)
if err != nil {
log.Fatal(err)
}fmt.Println(result[0].Data)
}
```For more information on each method, please refer to the GoDoc documentation.
## Contributing
Contributions to Vecgo are welcome! Feel free to open issues for bug reports, feature requests, or submit pull requests with improvements.## License
Vecgo is licensed under the MIT License. See the LICENSE file for details.