Skip to main content

traitclaw_strategies/
lib.rs

1//! # TraitClaw Strategies
2//!
3//! Built-in reasoning strategies for the TraitClaw AI agent framework.
4//!
5//! This crate provides three reasoning strategies that implement the
6//! [`AgentStrategy`](traitclaw_core::AgentStrategy) trait:
7//!
8//! - **ReAct** (`react` feature): Think→Act→Observe reasoning loops with tool use
9//! - **Chain-of-Thought** (`cot` feature): Structured step-by-step reasoning
10//! - **MCTS** (`mcts` feature): Monte Carlo Tree Search with parallel branch evaluation
11//!
12//! All strategies are enabled by default. Use `default-features = false` to
13//! selectively enable only the strategies you need.
14//!
15//! # Feature Flags
16//!
17//! | Feature | Description |
18//! |---------|-------------|
19//! | `react` | ReAct reasoning strategy (Think→Act→Observe) |
20//! | `cot`   | Chain-of-Thought reasoning strategy |
21//! | `mcts`  | Monte Carlo Tree Search strategy |
22
23#![deny(missing_docs)]
24#![allow(clippy::redundant_closure)]
25
26pub mod common;
27pub mod streaming;
28
29#[cfg(feature = "react")]
30pub mod react;
31
32#[cfg(feature = "mcts")]
33pub mod mcts;
34
35#[cfg(feature = "cot")]
36pub mod cot;
37
38// Top-level re-exports for convenience
39pub use common::ThoughtStep;
40pub use streaming::StrategyEvent;
41
42#[cfg(feature = "react")]
43pub use react::ReActStrategy;
44
45#[cfg(feature = "cot")]
46pub use cot::ChainOfThoughtStrategy;
47
48#[cfg(feature = "mcts")]
49pub use mcts::MctsStrategy;