This repository has been archived on 2026-05-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
engram-retired/engrams/engram-reasoning/src/lib.rs
T
Will Anderson d1ec384b27 rename crates/ to engrams/, bindings/ to receptors/
- crates/ → engrams/ (Rust engrams live here)
- bindings/ → receptors/ (cross-language access points into the graph)
- Cargo.toml workspace paths updated
2026-04-29 03:27:33 -05:00

51 lines
1.8 KiB
Rust

/// Engram Reasoning Engine — graph-native inference separated from language generation.
///
/// # What this crate is
///
/// This is NOT an LLM wrapper. It is a reasoning system that traverses the Engram
/// knowledge graph to reach conclusions through evidence chains.
///
/// LLMs: input tokens → transformer → output tokens. Reasoning and generation are
/// the same process. You cannot separate them.
///
/// This engine: hypothesis → graph traversal → evidence chains → confidence-weighted
/// conclusion. Generation happens separately (a codec converts the conclusion to
/// language). The reasoning IS the traversal.
///
/// # Quick Start
///
/// ```rust,no_run
/// use engram_core::{EngramDb, Node, Edge, NodeType, MemoryTier};
/// use engram_reasoning::{ReasoningEngine, Hypothesis, HypothesisType, ReasoningConfig};
/// use std::path::Path;
/// use std::sync::{Arc, Mutex};
///
/// let db = Arc::new(Mutex::new(EngramDb::open(Path::new("/tmp/engram-reason-test")).unwrap()));
/// let config = ReasoningConfig::default();
/// let mut engine = ReasoningEngine::new(db, config);
///
/// let hypothesis = Hypothesis::new(
/// "Spreading activation improves memory retrieval",
/// vec![0.9f32, 0.1, 0.3, 0.7],
/// HypothesisType::IsTrue,
/// );
///
/// let result = engine.reason(&hypothesis).unwrap();
/// println!("Verdict: {:?}", result.conclusion.verdict);
/// println!("Confidence: {:.2}", result.confidence);
/// ```
pub mod engine;
pub mod types;
#[cfg(test)]
mod tests;
// Re-export the primary public surface
pub use engine::ReasoningEngine;
pub use types::{
CausalDirection, ChainType, Conclusion, EvidenceChain, EvidenceNode, EvidenceType,
Hypothesis, HypothesisType, InferenceEdge, InferenceEdgeType, ReasoningConfig,
ReasoningResult, Verdict,
};