Hanzo Vector Go SDK
Go client library for Hanzo Vector (Qdrant compatible). Fork of `qdrant/go-client` with module path rewritten to `github.com/hanzoai/vector-go`. Uses gRPC for communication. The main package is `qd...
Overview
Go client library for Hanzo Vector (Qdrant compatible). Fork of qdrant/go-client with module path rewritten to github.com/hanzoai/vector-go. Uses gRPC for communication. The main package is qdrant -- all types, client, and helpers live there.
OSS Base
Fork of go-client (qdrant/go-client). Repo: hanzoai/vector-go, branch: master.
Quick reference
| Item | Value |
|---|---|
| Module | github.com/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?
Last updated on
Hanzo Vector - High-Performance Vector Search Engine
Hanzo Vector is a high-performance vector search engine for the Hanzo AI platform. It is a full fork of Qdrant v1.17.0, written in Rust, providing dense and sparse vector similarity search with fil...
Hanzo Charts
Hanzo Charts is the official Helm chart repository for all Hanzo services and infrastructure. Contains 16 charts covering core services (IAM, KMS, Gateway), AI services (Cloud, Agents, LLM), platfo...