Skip to main content

Crate ineru

Crate ineru 

Source
Expand description

§Ineru

Neural-inspired memory system for AIngle AI agents.

§Architecture

Ineru implements a dual-memory architecture inspired by cognitive neuroscience and modern AI memory systems:

┌─────────────────────────────────────────────────────────────┐
│                     Ineru Memory System                      │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌──────────────────┐     ┌──────────────────────────────┐ │
│  │  Short-Term      │     │  Long-Term Memory (LTM)      │ │
│  │  Memory (STM)    │     │                              │ │
│  │                  │     │  ┌────────────────────────┐  │ │
│  │  • Fast access   │ ──► │  │   Knowledge Graph      │  │ │
│  │  • Attention     │     │  │                        │  │ │
│  │  • Decay         │     │  │  Entities ──Links──►   │  │ │
│  │  • Bounded       │     │  │                        │  │ │
│  └──────────────────┘     │  └────────────────────────┘  │ │
│                           │                              │ │
│  ┌──────────────────┐     │  ┌────────────────────────┐  │ │
│  │  Consolidation   │     │  │   Semantic Index       │  │ │
│  │                  │     │  │                        │  │ │
│  │  • Importance    │     │  │  Embeddings + Search   │  │ │
│  │  • Similarity    │     │  │                        │  │ │
│  │  • Compression   │     │  └────────────────────────┘  │ │
│  └──────────────────┘     └──────────────────────────────┘ │
│                                                              │
└─────────────────────────────────────────────────────────────┘

§Usage

use ineru::{IneruMemory, MemoryConfig, MemoryEntry};

// Create memory system
let mut memory = IneruMemory::new(MemoryConfig::default());

// Store in short-term memory
let entry = MemoryEntry::new("sensor_data", json!({"temp": 23.5}));
memory.remember(entry)?;

// Query with semantic search
let results = memory.recall("temperature readings")?;

// Important memories consolidate to long-term
memory.consolidate()?;

§Features

  • Short-Term Memory (STM): Fast, volatile storage with attention-based weighting
  • Long-Term Memory (LTM): Persistent knowledge graph with semantic indexing
  • Consolidation: Automatic transfer of important memories from STM to LTM
  • Semantic Search: Query memories by meaning, not just keywords
  • IoT Optimized: Configurable memory limits for embedded devices

Re-exports§

pub use config::ConsolidationConfig;
pub use config::LtmConfig;
pub use config::MemoryConfig;
pub use config::StmConfig;
pub use consolidation::Consolidator;
pub use error::Error;
pub use error::Result;
pub use ltm::KnowledgeGraph;
pub use ltm::LongTermMemory;
pub use stm::ShortTermMemory;
pub use types::Embedding;
pub use types::Entity;
pub use types::EntityId;
pub use types::LinkType;
pub use types::MemoryEntry;
pub use types::MemoryId;
pub use types::MemoryMetadata;
pub use types::MemoryQuery;
pub use types::MemoryResult;
pub use types::Relation;
pub use types::SemanticTag;

Modules§

config
Configuration for the Ineru memory system.
consolidation
Memory Consolidation: STM → LTM Transfer
error
Error types for the Ineru memory system.
hnsw
HNSW (Hierarchical Navigable Small World) Vector Index
ltm
Long-Term Memory (LTM) with a Knowledge Graph.
stm
Short-Term Memory (STM) with attention-based weighting.
types
Core data types for the Ineru memory system.

Structs§

IneruMemory
The main interface for the Ineru memory system.
MemoryStats
Provides statistics about the state of the IneruMemory system.