English rewrite of xb/doc/QDRANT_ADVANCED_API.md. It documents how xb unifies Recommend, Discover, and Scroll workflows under JsonOfSelect().
| API | When to use | Builder entry |
|---|---|---|
| Recommend | Rerank positive vs negative feedback | NewQdrantBuilder().Recommend(func(*RecommendBuilder)).Build() |
| Discover | Explore content around a context vector | NewQdrantBuilder().Discover(func(*DiscoverBuilder)).Build() |
| Scroll | Paginate extremely large collections | NewQdrantBuilder().ScrollID(string).Build() |
Each API config attaches to the same builder. JsonOfSelect() inspects the state and emits the proper JSON schema automatically.
json, _ := xb.Of(&FeedVector{}).
Custom(
xb.NewQdrantBuilder().
Recommend(func(rb *xb.RecommendBuilder) {
rb.Positive(501, 502).
Negative(999).
Limit(40).
WithPayloadSelector(map[string]any{
"include": []string{"id", "title"},
})
}).
Build()
).
Build().
JsonOfSelect()
positive / negative fields.Limit, WithPayloadSelector, WithScoreThreshold, and diversity helpers are available.json, _ := xb.Of(&ArticleVector{}).
Custom(
xb.NewQdrantBuilder().
Discover(func(db *xb.DiscoverBuilder) {
db.TargetVector("topic_vec", queryVec).
Strategy("best_score").
Filter(func(f *xb.QFilterBuilder) {
f.MustEq("region", "us")
})
}).
Build()
).
Build().
JsonOfSelect()
WithPayloadSelector, diversity, and metadata injection.json, _ := xb.Of(&FeedVector{}).
Custom(
xb.NewQdrantBuilder().
Scroll(func(sb *xb.ScrollBuilder) {
sb.PayloadSelector([]string{"id", "tags"}).
Limit(100).
OffsetID("9012:5")
})
).
Build().
JsonOfSelect()
OffsetID to resume from the last record.Eq, In, or Meta for multi-tenant traversal.JsonOfSelect() and compare JSON snapshots.Custom returns meaningful errors if both Recommend and Discover are configured simultaneously (xb picks the first match).doc/en/QDRANT_GUIDE.mddoc/en/VECTOR_GUIDE.mddoc/en/AI_APPLICATION.md