totalreclaw_memory/
lib.rs1pub mod backend;
22pub mod billing;
23pub mod blind;
24pub mod crypto;
25pub mod debrief;
26pub mod embedding;
27pub mod fingerprint;
28pub mod hotcache;
29pub mod lsh;
30pub mod protobuf;
31pub mod relay;
32pub mod reranker;
33pub mod search;
34pub mod setup;
35pub mod stemmer;
36pub mod store;
37pub mod userop;
38pub mod wallet;
39
40pub use backend::{MemoryCategory, MemoryEntry, TotalReclawConfig, TotalReclawMemory};
41
42pub use totalreclaw_core::claims::{
44 Claim, ClaimCategory, ClaimStatus, EntityRef, EntityType, ResolutionAction, SkipReason,
45 TIE_ZONE_SCORE_TOLERANCE, is_pinned_claim, is_pinned_json, respect_pin_in_resolution,
46};
47pub use totalreclaw_core::claims::{
50 MemoryClaimV1, MemoryEntityV1, MemorySource, MemoryScope, MemoryTypeV1,
51 MemoryVolatility, MEMORY_CLAIM_V1_SCHEMA_VERSION,
52};
53pub use totalreclaw_core::contradiction::{
54 Contradiction, ResolutionOutcome, ResolutionWeights, ScoreComponents,
55 resolve_with_candidates, resolve_pair, detect_contradictions, default_weights,
56 DEFAULT_LOWER_THRESHOLD, DEFAULT_UPPER_THRESHOLD,
57};
58pub use totalreclaw_core::decision_log::{
59 DecisionLogEntry, DECISION_LOG_MAX_LINES, CONTRADICTION_CANDIDATE_CAP,
60 find_loser_claim_in_decision_log, find_decision_for_pin,
61 build_feedback_from_decision, append_decision_entry,
62};
63pub use store::ContradictionStoreResult;
64
65#[derive(Debug, thiserror::Error)]
67pub enum Error {
68 #[error("crypto error: {0}")]
69 Crypto(String),
70
71 #[error("invalid mnemonic: {0}")]
72 InvalidMnemonic(String),
73
74 #[error("embedding error: {0}")]
75 Embedding(String),
76
77 #[error("reranker error: {0}")]
78 Reranker(String),
79
80 #[error("LSH error: {0}")]
81 Lsh(String),
82
83 #[error("IO error: {0}")]
84 Io(#[from] std::io::Error),
85
86 #[error("HTTP error: {0}")]
87 Http(String),
88
89 #[error("quota exceeded: {0}")]
90 QuotaExceeded(String),
91}
92
93impl From<totalreclaw_core::Error> for Error {
95 fn from(e: totalreclaw_core::Error) -> Self {
96 match e {
97 totalreclaw_core::Error::Crypto(msg) => Error::Crypto(msg),
98 totalreclaw_core::Error::InvalidMnemonic(msg) => Error::InvalidMnemonic(msg),
99 totalreclaw_core::Error::Lsh(msg) => Error::Lsh(msg),
100 totalreclaw_core::Error::Reranker(msg) => Error::Reranker(msg),
101 }
102 }
103}
104
105pub type Result<T> = std::result::Result<T, Error>;