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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Vector storage and semantic search contract.
//!
//! [`VectorStore`] exposes embedding and semantic search operations (cosine
//! similarity). Designed to be consumed by search pipelines without depending
//! on `gradatum-index`.
//!
//! ## Future evolution
//!
//! The names `insert_note_embedding` / `search_semantic` may converge toward
//! `upsert` / `search` with `VectorMeta` / `VectorMatch` when migrating to ANN
//! (sqlite-vec). `GradatumError` may converge toward a dedicated `StoreError`.
use async_trait;
use crateGradatumError;
use crateNoteId;
/// Async, thread-safe vector storage and semantic search contract.
///
/// Implemented by `gradatum-index::SqliteIndex` (raw cosine over f32 BLOBs).
/// New implementations can substitute ANN backends (sqlite-vec, hnswlib) without
/// modifying consumers.
///
/// ## Stability
///
/// This trait's API may change before v1.0.0. Method names
/// `insert_note_embedding`/`search_semantic` may converge toward `upsert`/`search`
/// with `VectorMeta`/`VectorMatch` when switching to ANN.
///
/// ## Connection contention
///
/// Currently shares a single `Arc<Mutex<Connection>>` with `DocumentStore` and
/// `IndexStore`. Physical connection separation is planned for a future release.
// `#[stability::unstable]` deferred — requires `[features] unstable-storage-traits = []`
// in gradatum-core/Cargo.toml + opt-in from all workspace consumers.
// The stability macro does not prevent compilation (no E0365); without the declared
// feature it would emit a deprecated warning on every consumer.