Skip to main content

lc_agents/
lib.rs

1// lc-agents/src/lib.rs
2//! Agent system for building autonomous LLM applications.
3//!
4//! Provides core abstractions and implementations for agents.
5//!
6//! # Core Concepts
7//!
8//! - **Agent**: Responsible for planning, deciding what action to execute next.
9//! - **AgentExecutor**: Responsible for execution loop (plan -> act -> observe).
10//! - **Tool**: Callable tools that agents can invoke.
11//!
12//! # Execution Flow
13//!
14//! ```text
15//! Input question
16//!     |
17//! Agent.plan() -> AgentAction or AgentFinish
18//!     |
19//! If Action: execute tool -> get observation
20//!     |
21//! Add to intermediate_steps
22//!     |
23//! Loop until AgentFinish returned
24//! ```
25
26pub mod adapter;
27pub mod adaptive_rag;
28pub mod base;
29pub mod builder;
30pub mod crag;
31pub mod deep_research;
32pub mod function_calling;
33pub mod handoffs;
34pub mod plan_execute;
35pub mod react;
36pub mod streaming;
37pub mod types;
38
39pub use adapter::AgentRunnable;
40pub use adaptive_rag::{AdaptiveRAG, AdaptiveRAGError, AdaptiveRAGResult, RagDecision};
41pub use base::{AgentError, AgentExecutor, BaseAgent};
42pub use builder::AgentBuilder;
43pub use crag::{CRAGError, CRAGResult, CorrectiveRAGAgent};
44pub use deep_research::{Citation, DeepResearchAgent, ResearchError, ResearchReport};
45pub use function_calling::FunctionCallingAgent;
46pub use handoffs::HandoffManager;
47pub use plan_execute::{PlanExecuteAgent, PlanExecuteError};
48pub use react::ReActAgent;
49pub use streaming::StreamingFunctionCallingAgent;
50pub use types::{AgentAction, AgentFinish, AgentOutput, AgentStep, ToolInput};