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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! A lightweight, ergonomic framework for building AI agents in Rust.
//!
//! Machi provides the building blocks for constructing AI agents that reason,
//! use tools, and collaborate — powered by any LLM backend.
//!
//! # Core Concepts
//!
//! - **[`Agent`](agent::Agent)** — A self-contained unit with its own LLM provider,
//! instructions, tools, and optional sub-agents.
//! - **[`Runner`](agent::Runner)** — A stateless execution engine driving the
//! `ReAct` loop (think → act → observe → repeat).
//! - **[`Tool`](tool::Tool) / [`DynTool`](tool::DynTool)** — Capabilities that
//! agents can invoke (filesystem, shell, web search, or custom).
//! - **[`ChatProvider`](chat::ChatProvider)** — Trait abstracting over LLM backends
//! (`OpenAI`, Ollama, or custom).
//!
//! # Feature Flags
//!
//! | Feature | Description |
//! |---------|-------------|
//! | `openai` | `OpenAI` API backend |
//! | `ollama` | Ollama local LLM backend |
//! | `derive` | `#[tool]` proc-macro for deriving tools |
//! | `toolkit` | Built-in filesystem, shell, and web search tools |
//! | `mcp` | Model Context Protocol server integration |
//! | `a2a` | Agent-to-Agent protocol support |
//! | `wallet` | EVM wallet for blockchain interactions |
//! | `memory-sqlite` | SQLite-backed session persistence |
//! | `schema` | Structured output via JSON Schema generation |
//! | `full` | All of the above (default) |
//!
//! # Quick Start
//!
//! ```rust
//! use machi::agent::{Agent, RunConfig};
//! use machi::chat::ChatRequest;
//! use machi::message::Message;
//!
//! // Build a chat request
//! let request = ChatRequest::new("gpt-4o")
//! .system("You are a helpful assistant.")
//! .user("Hello!")
//! .temperature(0.7);
//!
//! // Configure an agent
//! let agent = Agent::new("assistant")
//! .instructions("You are a helpful assistant.")
//! .model("gpt-4o");
//!
//! // Construct messages manually
//! let msgs = vec![
//! Message::system("You are helpful."),
//! Message::user("What is Rust?"),
//! ];
//! ```
pub use ;
pub use tool;
pub use ToolError;