xb

Qdrant Builder Usage (English)

This document describes how to use QdrantBuilder for advanced tuning configuration.


QdrantBuilder entrypoint

xb.Of(&CodeVector{}).
    Custom(
        xb.NewQdrantBuilder().
            HnswEf(512).
            ScoreThreshold(0.85).
            WithVector(false).
            Build(),
    ).
    Build()

QdrantBuilder provides a fluent API to configure advanced Qdrant parameters.


Available options

These options can be combined via method chaining.


Complete examples

// Basic usage
json, _ := xb.Of(&CodeVector{}).
    Custom(
        xb.NewQdrantBuilder().
            HnswEf(512).
            ScoreThreshold(0.85).
            WithVector(false).
            Build(),
    ).
    Eq("language", "golang").
    VectorSearch("embedding", queryVector, 10).
    Build().
    JsonOfSelect()

// Combined with advanced APIs
custom := xb.NewQdrantBuilder().
    HnswEf(256).
    ScoreThreshold(0.8).
    Build()

custom = custom.Recommend(func(rb *xb.RecommendBuilder) {
    rb.Positive(101, 102).Negative(203).Limit(20)
})

json, _ := xb.Of(&CodeVector{}).
    Custom(custom).
    Build().
    JsonOfSelect()