Skip to main content

klieo_memory_neo4j/
lib.rs

1#![deny(missing_docs)]
2#![deny(rust_2018_idioms)]
3#![deny(rustdoc::broken_intra_doc_links)]
4
5//! Neo4j-backed implementations of the memory traits in
6//! [`klieo_core::memory`].
7//!
8//! `MemoryNeo4j::connect` dials a Bolt endpoint, ensures schema
9//! constraints + indices, and returns trait-object handles ready to
10//! drop into [`klieo_core::AgentContext`]. Reach for
11//! [`MemoryNeo4j::new`] only when you need a tuned [`Neo4jConfig`]
12//! (custom `max_connections`, `fetch_size`, etc.) — see ADR-036.
13//!
14//! # Example
15//!
16//! ```no_run
17//! use klieo_memory_neo4j::MemoryNeo4j;
18//!
19//! async fn example() {
20//!     let mem = MemoryNeo4j::connect(
21//!         "bolt://127.0.0.1:7687",
22//!         "neo4j",
23//!         "secret",
24//!     )
25//!     .await
26//!     .unwrap();
27//!     let _ = mem;
28//! }
29//! ```
30//!
31//! # Advanced wiring — tuned `Neo4jConfig`
32//!
33//! ```no_run
34//! use klieo_memory_neo4j::{MemoryNeo4j, Neo4jConfig};
35//!
36//! async fn example() {
37//!     let cfg = Neo4jConfig::new("bolt://127.0.0.1:7687", "neo4j", "secret");
38//!     let mem = MemoryNeo4j::new(cfg).await.unwrap();
39//!     let _ = mem;
40//! }
41//! ```
42//!
43//! # What's implemented
44//!
45//! | Trait | Module | Notes |
46//! |-------|--------|-------|
47//! | `ShortTermMemory` | `short_term` | `(:Thread)-[:HAS_MESSAGE]->(:Message)` ordered by `seq`. |
48//! | `EpisodicMemory`  | `episodic`   | `(:Run)-[:RECORDED]->(:Episode)` ordered by `seq`. |
49//!
50//! `LongTermMemory` is intentionally not implemented here — see
51//! `klieo-memory-qdrant` for vector recall.
52
53pub mod connection;
54pub use connection::{Neo4jConfig, Neo4jHandle};
55
56pub mod error;
57
58pub mod short_term;
59pub use short_term::Neo4jShortTerm;
60
61pub mod episodic;
62pub use episodic::Neo4jEpisodic;
63
64pub mod factory;
65pub use factory::MemoryNeo4j;