reasonkit/engine/mod.rs
1//! # ReasonKit Engine Module
2//!
3//! High-performance async reasoning engine that orchestrates ThinkTool execution
4//! with memory integration, streaming support, and concurrent processing.
5//!
6//! ## Core Components
7//!
8//! - **ReasoningLoop**: Main async engine for structured reasoning
9//! - **ReasoningSession**: Stateful session with context accumulation
10//! - **StreamingOutput**: Real-time reasoning step streaming
11//!
12//! ## Architecture
13//!
14//! ```text
15//! +------------------+ +------------------+ +------------------+
16//! | User Prompt | --> | ReasoningLoop | --> | Decision Output |
17//! +------------------+ +------------------+ +------------------+
18//! |
19//! +-------------+-------------+
20//! | | |
21//! +----v----+ +-----v-----+ +----v----+
22//! | Memory | | ThinkTool | | Profile |
23//! | Query | | Executor | | System |
24//! +---------+ +-----------+ +---------+
25//! ```
26//!
27//! ## Usage
28//!
29//! ```rust,ignore
30//! use reasonkit::engine::{ReasoningLoop, ReasoningConfig, Profile};
31//!
32//! #[tokio::main]
33//! async fn main() -> Result<()> {
34//! let loop_engine = ReasoningLoop::builder()
35//! .with_profile(Profile::Balanced)
36//! .with_memory(memory_client)
37//! .build()?;
38//!
39//! // Streaming execution
40//! let mut stream = loop_engine.reason_stream("Should we adopt microservices?").await?;
41//! while let Some(step) = stream.next().await {
42//! println!("Step: {:?}", step);
43//! }
44//!
45//! // Blocking execution
46//! let decision = loop_engine.reason("Should we adopt microservices?").await?;
47//! println!("Decision: {}", decision.conclusion);
48//!
49//! Ok(())
50//! }
51//! ```
52
53pub mod reasoning_loop;
54
55// Re-exports for convenience
56pub use reasoning_loop::{
57 Decision, MemoryContext, Profile, ReasoningConfig, ReasoningError, ReasoningEvent,
58 ReasoningLoop, ReasoningLoopBuilder, ReasoningSession, ReasoningStep, StepKind, StreamHandle,
59 ThinkToolResult,
60};