1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! # entelix-memory-qdrant
//!
//! Concrete [`entelix_memory::VectorStore`] implementation backed by
//! the qdrant 1.5+ gRPC API.
//!
//! Companion to the trait-only [`entelix_memory`] crate:
//! vendor-SDK dependencies (`qdrant-client` plus its tonic / prost
//! transitive tree) live here so users who plug their own
//! `VectorStore` pay nothing in compile time.
//!
//! ## One-call setup
//!
//! ```ignore
//! use entelix_memory_qdrant::{DistanceMetric, QdrantVectorStore};
//!
//! let store = QdrantVectorStore::builder("memories", 1536)
//! .with_url("http://localhost:6334")
//! .with_distance(DistanceMetric::Cosine)
//! .build()
//! .await?;
//! ```
//!
//! ## Multi-tenancy
//!
//! Single-collection design (qdrant official multi-tenancy
//! guidance): every read / write / count / list rides a `must`
//! anchor on the rendered [`entelix_memory::Namespace`]. Two
//! tenants sharing the same operator-facing `doc_id` are stored as
//! distinct points without coordination — the qdrant `PointId` is
//! a deterministic UUID v5 of `(namespace_key, doc_id)`. The
//! original `doc_id` survives in the payload for round-trip.
//!
//! ## Schema-as-code escape hatch
//!
//! Operators that provision the qdrant collection externally
//! (helm chart, Terraform, qdrant Cloud console) call
//! [`QdrantVectorStoreBuilder::with_existing_collection`] — the
//! builder skips both collection creation and payload-index
//! provisioning and trusts the operator to have stamped them.
// `qdrant`, `Postgres`, etc. ride through doc strings as vendor names
// (not code identifiers); backticking each occurrence is noise.
// `Err`-variant size is large because `QdrantStoreError::Sqlx` boxes
// the upstream chain — that's the point of `#[from]` and we accept
// the heap-shaped Result on these cold paths.
// `pub(crate)` items inside private modules are the canonical
// crate-internal helper pattern.
pub use ;
pub use ;
pub use ;