Hanzo Skills Reference
Hanzo Vector Go SDK
Go client library for Hanzo Vector, speaking the Qdrant gRPC protocol. The main package is `qdrant` — types, client and helpers all live there.
Overview
Go client library for Hanzo Vector, speaking the Qdrant gRPC protocol. The main package is qdrant -- all types, client, and helpers live there.
Repo
Note: the Go module path is still github.com/qdrant/go-client. That is what you put in your go.mod; github.com/hanzoai/vector-go is the repository, not the import path.
Quick reference
| Item | Value |
|---|---|
| Module | github.com/qdrant/go-client (repo: hanzoai/vector-go) |
| Package | qdrant |
| Go | 1.26+ |
| Repo | github.com/hanzoai/vector-go |
| Branch | master |
| License | Apache-2.0 |
| Protocol | gRPC |
| Default port | 6334 |
Installation
go get github.com/hanzoai/vector-goQuick start
package main
import (
"context"
"fmt"
"github.com/hanzoai/vector-go/qdrant"
)
func main() {
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
if err != nil {
panic(err)
}
defer client.Close()
ctx := context.Background()
// Create collection
client.CreateCollection(ctx, &qdrant.CreateCollection{
CollectionName: "docs",
VectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{
Size: 384,
Distance: qdrant.Distance_Cosine,
}),
})
// Upsert points
client.Upsert(ctx, &qdrant.UpsertPoints{
CollectionName: "docs",
Points: []*qdrant.PointStruct{
{
Id: qdrant.NewIDNum(1),
Vectors: qdrant.NewVectors(0.1, 0.2, 0.3),
Payload: qdrant.NewValueMap(map[string]any{"title": "hello"}),
},
},
})
// Search
results, _ := client.Query(ctx, &qdrant.QueryPoints{
CollectionName: "docs",
Query: qdrant.NewQuery(0.1, 0.2, 0.3),
WithPayload: qdrant.NewWithPayload(true),
})
fmt.Println(results)
}Key features
- Collection management (create, update, delete, list)
- Point upsert, delete, get, scroll, count
- Vector search (query) with filtering
- Payload filtering with match, range, geo conditions
- Snapshot management (create, list, delete)
- Connection pooling (configurable
PoolSize, default 3, round-robin) - TLS and API key authentication
- gRPC-based (protobuf generated types)
Client configuration
client, _ := qdrant.NewClient(&qdrant.Config{
Host: "xyz.cloud.qdrant.io",
Port: 6334,
APIKey: "<your-api-key>",
UseTLS: true,
// PoolSize: 3, // gRPC connection pool size
// TLSConfig: &tls.Config{},
// GrpcOptions: []grpc.DialOption{},
})Low-level gRPC access
// Direct gRPC service clients
collectionsClient := client.GetCollectionsClient()
pointsClient := client.GetPointsClient()
snapshotsClient := client.GetSnapshotsClient()
qdrantClient := client.GetQdrantClient()
conn := client.GetConnection() // raw *grpc.ClientConnHelper functions
qdrant.NewIDNum(42) // numeric point ID
qdrant.NewIDUUID("uuid-string") // UUID point ID
qdrant.NewVectors(0.1, 0.2, 0.3) // dense vector
qdrant.NewVectorsConfig(params) // collection vector config
qdrant.NewValueMap(map[string]any{}) // payload from map
qdrant.NewQuery(0.1, 0.2, 0.3) // search query from floats
qdrant.NewWithPayload(true) // include payload in results
qdrant.NewMatch("field", "value") // filter condition
qdrant.PtrOf(value) // generic pointer helperBuild and test
go build ./...
go test ./...
# Integration tests use testcontainers (Docker required)How is this guide?