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
//! # takeln
//!
//! > Typed Rust runtime for durable DAG-based agent workflows.
//!
//! `takeln` is a lightweight, production-grade execution engine for Directed Acyclic
//! Graphs (DAGs) in Rust. It provides built-in wave-based parallel scheduling,
//! robust state checkpointing, retry policies, budget enforcement, and LLM metadata
//! instrumentation.
//!
//! ## Feature Flags
//!
//! | Flag | Default | Description |
//! |------|---------|-------------|
//! | `postgres` | No | Enables [`PostgresCheckpointer`] backed by PostgreSQL via `sqlx` |
//! | `sqlite` | No | Enables [`SqliteCheckpointer`] backed by SQLite via `rusqlite` |
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use async_trait::async_trait;
//! use takeln::{Graph, Node, NodeContext, NodeOutput, GraphError, InMemoryCheckpointer};
//!
//! #[derive(Clone, serde::Serialize, serde::Deserialize, Default)]
//! struct MyState { value: String }
//!
//! struct AppendNode { suffix: String }
//!
//! #[async_trait]
//! impl Node<MyState> for AppendNode {
//! async fn call(&self, _ctx: NodeContext, mut state: MyState) -> Result<NodeOutput<MyState>, GraphError> {
//! state.value.push_str(&self.suffix);
//! Ok(NodeOutput::bare(state))
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() {
//! let mut graph = Graph::new();
//! graph.add_node("A", AppendNode { suffix: "Hello".to_string() });
//! graph.add_node("B", AppendNode { suffix: " World".to_string() });
//! graph.add_edge("A", "B");
//! graph.add_edge("B", "__END__");
//!
//! let checkpointer = InMemoryCheckpointer::new();
//! let state = graph.run("thread_1", MyState::default(), "A", &checkpointer, None).await.unwrap();
//! assert_eq!(state.value, "Hello World");
//! }
//! ```
pub use Checkpointer;
pub use ;
pub use NodeContext;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ExecutionRecord;
pub use Merge;
pub use ;
pub use ResourceLimits;
pub use InMemoryCheckpointer;
pub use PgPool;
pub use PostgresCheckpointer;
pub use SqliteCheckpointer;