Overview
MoonQdrant is a MoonBit client library for the Qdrant vector database.
Qdrant is one of the most widely used vector databases for RAG and vector search. The MoonBit ecosystem already had vector engines and servers, but no client for talking to a running Qdrant service — moon-qdrant fills that gap: the API is small and explicit, mapping 1:1 to Qdrant REST endpoints, with HTTP transport built on oboard/mio.
Installation
moon add yuzhiblue/moon-qdrant
Spin up a local Qdrant server with Docker:
docker run -p 6333:6333 qdrant/qdrant
Quick Start
let client = QdrantClient::new("http://localhost:6333")
// create a 4-dimension cosine collection
client.create_collection(
"demo",
CollectionConfig::new(VectorParams::new(4, Distance::Cosine)),
)
// upsert points (ids beyond 32 bits are supported)
client.upsert_points("demo", [
PointStruct::new(1, [0.1, 0.2, 0.3, 0.4], { "tag": "alpha" }),
PointStruct::new(2, [0.5, 0.6, 0.7, 0.8], { "tag": "beta" }),
])
// similarity search + conditional filtering
let hits = client.search_points("demo", [0.1, 0.2, 0.3, 0.4], limit=2)
let filtered = client.search_points(
"demo", [0.1, 0.2, 0.3, 0.4], limit=2,
filter={ "must": [{ "key": "tag", "match": { "value": "alpha" } }] },
)
Core Capabilities
- Full endpoint coverage: health check, collection management, point CRUD, search, batch operations, scroll pagination, count — 30+ REST endpoints implemented
- Named vectors: store multiple vectors per point (e.g. text / image); select the search channel via
using_vectoror aNamedVector - Advanced search: score threshold, offset pagination, HNSW tuning / exact search, batch search (one round trip), grouped search
- Query API: nearest-neighbor queries, positive/negative example recommendations (recommend), facet counting by payload field
- Typed filter DSL:
Filter::new().must(Condition::match_keyword("tag", "alpha"))— stop hand-assembling JSON - Payload management: set / overwrite / delete by keys, accelerated by payload indexes
- Cluster operations: cluster status, shard replication and replica operations, service write locks, snapshot management
- Extensible: a unified
VectorProvidertrait, ready to adapt to other vector services
Engineering Quality
- Unit tests cover models and JSON conversion; CI starts a real Qdrant container and runs integration tests asserting every client method end to end
- Ships with
REPRODUCIBILITY.mdcovering environment setup, demo replay, expected output and troubleshooting — everything reproducible
Links
- GitHub repository: https://github.com/yuzhiblue/moon-qdrant
License
Apache-2.0


