1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Prebuilt agent patterns for common LLM workflows.
//!
//! This module provides ready-to-use agent implementations that follow
//! established patterns like `ReAct` (Reason-Act). These agents handle the
//! boilerplate of graph construction, node wiring, and conditional routing,
//! allowing you to focus on configuring models and tools.
//!
//! # Available Agents
//!
//! - **`ReAct` Agent**: [`create_react_agent`] builds an agent that alternates
//! between LLM reasoning and tool execution. Use it when you want a
//! straightforward agent that can call tools and iterate.
//!
//! # State Type
//!
//! All prebuilt agents use [`MessagesState`], a simple state type with a
//! single `messages` field using reducer-based merge semantics.
//!
//! # Example
//!
//! ```ignore
//! use juncture::llm::{ChatModel, MockChatModel};
//! use juncture::prebuilt::{create_react_agent, MessagesState, ReactAgentConfig};
//! use juncture::tools::Tool;
//!
//! let model = MockChatModel::new("gpt-4").with_response("Done!");
//! let tools: Vec<Box<dyn Tool>> = vec![];
//!
//! // Basic usage
//! let agent = create_react_agent(model, tools)?;
//!
//! // With configuration
//! let model = MockChatModel::new("gpt-4").with_response("Done!");
//! let config = ReactAgentConfig {
//! system_message: Some("You are a helpful assistant.".to_string()),
//! ..Default::default()
//! };
//! let agent = create_react_agent_with_config(model, tools, config)?;
//! ```
pub use ;
pub use ;
pub use MessagesState;
pub use ;
pub use ;
// Rust guideline compliant 2026-05-19