heyq02/moomem/src does not have a README file
pub(open) trait Clock {
fn now_ms(self : Self) -> Int64
}pub(open) trait ConflictJudge {
fn judge(self : Self, new_fact : ExtractedFact, candidates : Array[MemoryEntry]) -> Result[Array[ConflictVerdict], MoomemError]
}pub(open) trait Embedder {
fn embed(self : Self, texts : Array[String]) -> Result[Array[Array[Double]], MoomemError]
fn dim(self : Self) -> Int
}pub(open) trait Extractor {
fn extract(self : Self, user_id : String, text : String) -> Result[Array[ExtractedFact], MoomemError]
fn mode(self : Self) -> String
}pub(open) trait PersistenceBackend {
fn load(self : Self) -> Result[String?, MoomemError]
fn save(self : Self, snapshot : String) -> Result[Unit, MoomemError]
}pub(all) suberror MoomemError {
InvalidUserId(String)
StoreCorrupted(String)
IoFailure(String)
ExtractionFailure(String)
EmbeddingFailure(String)
BackendUnsupported(String)
InvalidOperation(String)
}impl Show for MoomemErrorpub struct AddSummary {
extracted : Int
inserted : Int
duplicates : Int
superseded : Int
degraded : Bool
notes : Array[String]
}impl Show for AddSummarypub(all) struct Config {
embedder : &Embedder?
extractor : &Extractor?
judge : &ConflictJudge?
persistence : &PersistenceBackend?
clock : &Clock?
dim : Int
rrf_k : Int
recall_candidates : Int
supersede_threshold : Double
conflict_candidates : Int
coexist_band : Double
backfill : RecallBackfill
fusion_policy : FusionPolicy
lexical_floor : Double
lexical_gap : Double
vector_weight_when_lexical : Double
vector_weight_when_semantic : Double
}impl Show for ConflictDecisiontype DedupIndeximpl Show for EntryStatuspub(all) struct ExtractedFact {
content : String
kind : EntryKind
source_span : String?
degraded : Bool
degrade_reason : String?
}impl Show for ExtractedFactpub(all) enum ForgetTarget {
ById(String)
All
}impl Show for ForgetTargetpub struct FsBackend {
base_dir : String
slot : Int
}impl PersistenceBackend for FsBackendpub(all) enum FusionPolicy {
EqualRrf
AdaptiveLexical
}impl Show for FusionPolicypub struct HashingEmbedder {
dim : Int
}impl Embedder for HashingEmbedderfn embed(self : HashingEmbedder, texts : Array[String]) -> Result[Array[Array[Double]], MoomemError]fn HashingEmbedder::embed(self : HashingEmbedder, texts : Array[String]) -> Result[Array[Array[Double]], MoomemError]type KeywordIndexpub struct LogicalClock {
current : Int64
}impl Clock for LogicalClockpub struct MemoryBackend {
snapshot : String?
simulate_partial_write : Int?
fail_next_save : Bool
bytes_written : Int64
}impl PersistenceBackend for MemoryBackendimpl Show for MemoryEntrypub struct MemoryStore {
path : String
embedder : &Embedder
extractor : &Extractor
judge : &ConflictJudge
persistence : &PersistenceBackend
clock : &Clock
dim : Int
rrf_k : Int
recall_candidates : Int
supersede_threshold : Double
conflict_candidates : Int
coexist_band : Double
backfill : RecallBackfill
fusion_policy : FusionPolicy
lexical_floor : Double
lexical_gap : Double
vector_weight_when_lexical : Double
vector_weight_when_semantic : Double
entries : Map[String, MemoryEntry]
by_user : Map[String, Array[String]]
clock_high : Int64
next_seq : Int
gen : Int
truncated_recovered : Int
extraction_failures : Int
last_write_at : Int64
ever_flushed : Bool
snapshot_bytes : Int64
closed : Bool
// private fields
}fn MemoryStore::add(self : MemoryStore, user_id : String, text : String) -> Result[AddSummary, MoomemError]fn MemoryStore::forget(self : MemoryStore, user_id : String, target : ForgetTarget) -> Result[Int, MoomemError]fn MemoryStore::list_entries(self : MemoryStore, user_id : String) -> Result[Array[MemoryEntry], MoomemError]fn MemoryStore::recall(self : MemoryStore, user_id : String, query : String, top_k? : Int) -> Result[Array[MemoryEntry], MoomemError]pub struct RawExtractor {
}impl Extractor for RawExtractorfn extract(_ : RawExtractor, _ : String, text : String) -> Result[Array[ExtractedFact], MoomemError]fn RawExtractor::extract(_ : RawExtractor, _ : String, text : String) -> Result[Array[ExtractedFact], MoomemError]pub(all) enum RecallBackfill {
NoBackfill
BackfillRecency
}impl Show for RecallBackfillimpl ConflictJudge for SimilarityJudgefn judge(self : SimilarityJudge, new_fact : ExtractedFact, candidates : Array[MemoryEntry]) -> Result[Array[ConflictVerdict], MoomemError]fn SimilarityJudge::judge(self : SimilarityJudge, new_fact : ExtractedFact, candidates : Array[MemoryEntry]) -> Result[Array[ConflictVerdict], MoomemError]fn SimilarityJudge::new(threshold : Double, embedder : &Embedder, coexist_band? : Double) -> SimilarityJudgepub struct StoreStats {
total : Int
active : Int
superseded : Int
deleted : Int
unstructured : Int
bytes_on_disk : Int64
last_write_at : Int64?
truncated_recovered : Int
extractor_mode : String
}impl Show for StoreStatstype VectorIndexlet COEXIST_BAND : Doublelet DEFAULT_LEXICAL_FLOOR : Doublelet DEFAULT_VECTOR_WEIGHT_LEXICAL : Doublelet DEFAULT_VECTOR_WEIGHT_SEMANTIC : Doublelet MOOMEM_VERSION : String