Skip to main content

klieo_memory_qdrant/
lib.rs

1#![deny(missing_docs)]
2#![deny(rust_2018_idioms)]
3#![deny(rustdoc::broken_intra_doc_links)]
4
5//! Qdrant-backed implementation of `klieo_core::memory::LongTermMemory`.
6//!
7//! `MemoryQdrant::connect(url)` is the capability-shaped default —
8//! connects to a Qdrant gRPC URL, ensures the per-scope collection
9//! exists with the embedder's vector dimension, and returns an
10//! `Arc<dyn LongTermMemory>` ready to drop into
11//! `klieo_core::AgentContext`. Defaults to [`DummyEmbedder`] and a
12//! standard [`QdrantConfig`].
13//!
14//! For a custom [`QdrantConfig`] (API key, collection prefix,
15//! plaintext-remote opt-in) or a real [`Embedder`], reach for
16//! [`MemoryQdrant::new`] directly.
17//!
18//! # Quickstart
19//!
20//! ```no_run
21//! use klieo_memory_qdrant::MemoryQdrant;
22//!
23//! async fn example() {
24//!     let mem = MemoryQdrant::connect("http://127.0.0.1:6334").await.unwrap();
25//!     let _ = mem.long_term;
26//! }
27//! ```
28//!
29//! # Advanced wiring — custom config + embedder
30//!
31//! ```no_run
32//! use klieo_memory_qdrant::{MemoryQdrant, QdrantConfig, DummyEmbedder};
33//! use std::sync::Arc;
34//!
35//! async fn example() {
36//!     let cfg = QdrantConfig::new("http://qdrant.internal:6334")
37//!         .with_api_key("supersecret")
38//!         .with_collection_prefix("triage");
39//!     let mem = MemoryQdrant::new(cfg, Arc::new(DummyEmbedder)).await.unwrap();
40//!     let _ = mem.long_term;
41//! }
42//! ```
43//!
44//! # What's implemented
45//!
46//! Only `LongTermMemory`. `ShortTermMemory` and `EpisodicMemory` are
47//! not Qdrant-shaped — see `klieo-memory-sqlite` and
48//! `klieo-memory-neo4j` for those.
49
50pub mod embedder;
51pub use embedder::{DummyEmbedder, Embedder};
52
53#[cfg(any(test, feature = "test-utils"))]
54pub use embedder::FakeEmbedder;
55
56pub mod client;
57pub use client::QdrantConfig;
58
59pub mod error;
60
61pub mod long_term;
62pub use long_term::QdrantLongTerm;
63
64pub mod factory;
65pub use factory::MemoryQdrant;