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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! # cognisagent
//!
//! Batteries-included, high-level agent framework built on `cognis` and `cognisgraph`.
//! Provides zero-boilerplate agent creation with pluggable middleware and backends.
//!
//! ## Overview
//!
//! The primary entry point is [`create_deep_agent`], which constructs a compiled
//! LangGraph [`CompiledStateGraph`](cognisgraph::graph::state::CompiledStateGraph) with
//! middleware hooks around model and tool invocations.
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use cognisagent::config::DeepAgentConfig;
//! use cognisagent::create_deep_agent;
//!
//! let config = DeepAgentConfig::default();
//! let graph = create_deep_agent(config).unwrap();
//! let result = graph.invoke(serde_json::json!({"messages": []})).await.unwrap();
//! ```
//!
//! ## Middleware
//!
//! The [`middleware::Middleware`] trait provides before/after hooks for model calls
//! and tool executions. Built-in middleware:
//!
//! - [`middleware::filesystem::FilesystemMiddleware`] -- file read, write, list, glob, grep
//! - [`middleware::memory::MemoryMiddleware`] -- inject persistent memory into context
//! - [`middleware::subagent::SubAgentMiddleware`] -- isolated sub-agent delegation
//! - [`middleware::summarization::SummarizationMiddleware`] -- context window management
//! - [`middleware::skills::SkillsMiddleware`] -- custom skill loading
//! - [`middleware::patch_tool_calls::PatchToolCallsMiddleware`] -- tool call correction
//! - [`middleware::rate_limiter::RateLimiterMiddleware`] -- token bucket rate limiting
//! - [`middleware::logging::LoggingMiddleware`] -- structured logging with redaction
//! - [`middleware::context::ContextMiddleware`] -- dynamic context injection
//! - [`middleware::planning::PlanningMiddleware`] -- plan-then-execute with step tracking
//!
//! ## Tool Registry
//!
//! The [`tool_registry::ToolRegistry`] provides centralized tool management with
//! permission levels, call counting, enable/disable control, and filtering.
//!
//! ## Backends
//!
//! The [`backends::Backend`] trait abstracts session state persistence:
//!
//! - [`backends::StateBackend`] -- in-memory (default)
//! - [`backends::FilesystemBackend`] -- local disk storage
//! - [`backends::SandboxBackend`] -- isolated execution with resource limits
//!
//! ## Events
//!
//! The [`events`] module provides a typed event bus system with handlers and
//! lifecycle tracking for observing and reacting to agent execution events.
//!
//! ## Conversation
//!
//! The [`conversation`] module provides a conversation manager with context
//! windowing, message history management, and export/serialization support.
//!
//! ## Presets
//!
//! The [`presets`] module provides ready-made agent configurations via a preset
//! registry and customizer pattern for common agent types.
pub use create_deep_agent;