# agentlib-reasoning
A collection of sophisticated reasoning engines that define how an agent processes information and arrives at an answer.
## Included Engines
- **ReactEngine**: Implements the "Reasoning and Acting" loop, allowing agents to interleave thought processes with tool usage.
- **ChainOfThoughtEngine (CoT)**: Forces the model to generate a sequence of internal thoughts before the final response.
- **ReflectEngine**: A multi-pass engine that generates an initial answer, critiques it, and then revises it.
- **PlannerEngine**: Breaks the user request into a sequence of atomic sub-tasks (a plan) and executes them sequentially.
- **AutonomousEngine**: An open-ended loop where the agent continues to work until it explicitly calls a "finish" tool.
## Usage
```rust
use agentlib_reasoning::ReactEngine;
use std::sync::Arc;
let agent = agent.engine(Arc::new(ReactEngine::default()));
```
## Designing Processes
All engines implement the `ReasoningEngine` trait and are fully compatible with the `agentlib-core` runtime. Each step taken by an engine is recorded as a `ReasoningStep` for full observability.