Skip to main content

Crate alaya

Crate alaya 

Source
Expand description

§Alaya

A neuroscience and Buddhist psychology-inspired memory engine for conversational AI agents.

Alaya (Sanskrit: alaya-vijnana, “storehouse consciousness”) provides three memory stores, a Hebbian graph overlay, hybrid retrieval with spreading activation, and adaptive lifecycle processes — all without coupling to any specific LLM or agent framework.

§Quick Start

use alaya::{AlayaStore, NewEpisode, Role, EpisodeContext, Query};

let store = AlayaStore::open_in_memory().unwrap();

// Store an episode
store.store_episode(&NewEpisode {
    content: "Rust has zero-cost abstractions.".to_string(),
    role: Role::User,
    session_id: "session-1".to_string(),
    timestamp: 1700000000,
    context: EpisodeContext::default(),
    embedding: None,
}).unwrap();

// Query memories
let results = store.query(&Query::simple("Rust")).unwrap();
assert!(!results.is_empty());

Structs§

AlayaStore
The main entry point. Owns a SQLite connection and exposes the full store / query / lifecycle API.
Category
CategoryId
ConsolidationReport
Episode
EpisodeContext
EpisodeId
ForgettingReport
Impression
ImpressionId
Interaction
Input to the perfuming process. The agent constructs this from whatever interaction format it uses (Signal message, Discord message, HTTP request, etc.)
KnowledgeFilter
Link
LinkId
MemoryStatus
NewEpisode
NewImpression
NewSemanticNode
NoOpProvider
A no-op provider for when no LLM is available. Consolidation and perfuming simply skip the LLM-dependent steps.
NodeId
NodeStrength
PerfumingReport
Preference
PreferenceId
PurgeReport
Query
QueryContext
ScoredMemory
SemanticNode
TransformationReport

Enums§

AlayaError
LinkType
NodeRef
PurgeFilter
Role
SemanticType

Traits§

ConsolidationProvider
The agent provides this trait to support intelligent consolidation. Alaya never calls an LLM directly — the agent owns the LLM connection.

Type Aliases§

Result