plugmem_core/lib.rs
1//! plugmem engine core.
2//!
3//! The `no_std + alloc`, single-threaded memory engine on top of
4//! [`plugmem_arena`]: the data model (facts, entities, edges,
5//! bitemporality), the indexes (BM25, temporal, graph, vectors), hybrid
6//! recall, and the snapshot/journal machinery. The core owns no I/O, no
7//! clock and no threads — timestamps arrive as parameters, bytes leave
8//! through the `Storage` trait.
9//!
10//! Design: `..05`. Implementation lands in stages 2-4; modules
11//! appear here in dependency order as those stages complete.
12
13#![no_std]
14// The engine holds zero `unsafe`: every byte-reinterpretation lives in
15// `plugmem_arena`, behind its single audited `unsafe`. Forbidding it here turns
16// "the core is UB-free" into a compile-time guarantee — which is why the MIRI
17// audit covers only the arena, not this crate's (necessarily safe) code.
18#![forbid(unsafe_code)]
19
20extern crate alloc;
21
22pub mod config;
23pub mod error;
24pub mod id;
25pub mod index;
26pub mod journal;
27pub mod memory;
28pub(crate) mod metadata;
29pub mod model;
30pub mod snapshot;
31pub mod storage;
32pub mod tokenizer;
33
34pub use config::Config;
35pub use error::Error;
36pub use id::{EntityId, FactId, NONE_U32};
37pub use memory::{
38 FactFault, FactView, LinkInput, MaintainReport, Memory, OpenReport, RecallQuery, RecallResult,
39 RecallScratch, RecalledEdge, RecalledFact, RememberInput, RememberOutcome, Similar,
40 SimilarReason, Stats,
41};
42pub use model::{
43 EdgeSlot, EntityByName, EntityRecord, FactAux, FactRecord, TemporalSlot, VALID_TO_OPEN,
44 fact_flags,
45};
46pub use storage::{MemScratch, MemStorage, Scratch, Storage};
47// The arena-layer ids that appear in model records are part of this
48// crate's public surface too.
49pub use plugmem_arena::{BlobId, TermId};