Skip to main content

Crate klieo_memory_neo4j

Crate klieo_memory_neo4j 

Source
Expand description

Neo4j-backed implementations of the memory traits in klieo_core::memory.

MemoryNeo4j::connect dials a Bolt endpoint, ensures schema constraints + indices, and returns trait-object handles ready to drop into klieo_core::AgentContext. Reach for MemoryNeo4j::new only when you need a tuned Neo4jConfig (custom max_connections, fetch_size, etc.) — see ADR-036.

§Example

use klieo_memory_neo4j::MemoryNeo4j;

async fn example() {
    let mem = MemoryNeo4j::connect(
        "bolt://127.0.0.1:7687",
        "neo4j",
        "secret",
    )
    .await
    .unwrap();
    let _ = mem;
}

§Advanced wiring — tuned Neo4jConfig

use klieo_memory_neo4j::{MemoryNeo4j, Neo4jConfig};

async fn example() {
    let cfg = Neo4jConfig::new("bolt://127.0.0.1:7687", "neo4j", "secret");
    let mem = MemoryNeo4j::new(cfg).await.unwrap();
    let _ = mem;
}

§What’s implemented

TraitModuleNotes
ShortTermMemoryshort_term(:Thread)-[:HAS_MESSAGE]->(:Message) ordered by seq.
EpisodicMemoryepisodic(:Run)-[:RECORDED]->(:Episode) ordered by seq.

LongTermMemory is intentionally not implemented here — see klieo-memory-qdrant for vector recall.

Re-exports§

pub use connection::Neo4jConfig;
pub use connection::Neo4jHandle;
pub use short_term::Neo4jShortTerm;
pub use episodic::Neo4jEpisodic;
pub use factory::MemoryNeo4j;

Modules§

connection
Connection handle + schema bootstrap.
episodic
Neo4jEpisodicEpisodicMemory over a Neo4j run/episode graph.
error
Error mapping from neo4rs::Error to klieo_core::error::MemoryError.
factory
MemoryNeo4j — convenience factory bundling all Neo4j-backed memory traits in one struct.
short_term
Neo4jShortTermShortTermMemory over a Neo4j thread/message graph.