| Crates.io | weavegraph |
| lib.rs | weavegraph |
| version | 0.1.3 |
| created_at | 2025-10-01 23:35:19.053224+00 |
| updated_at | 2026-01-16 23:00:03.711539+00 |
| description | Graph-driven, concurrent agent workflow framework with versioned state, deterministic barrier merges, and rich diagnostics. |
| homepage | https://github.com/Idleness76/weavegraph |
| repository | https://github.com/Idleness76/weavegraph |
| max_upload_size | |
| id | 1863647 |
| size | 1,079,917 |
Graph-driven, concurrent agent workflow framework for Rust.
EARLY BETA
This framework is in active development (v0.1.x). APIs are evolving rapidly, and breaking changes will happen between minor versions.
The core architecture is solid, but expect rough edges, API churn, and occasional surprises. Pin exact versions if stability matters.
Use in production at your own risk—or better yet, help us shape the future by reporting issues and suggesting improvements.
Weavegraph lets you build robust, concurrent, stateful workflows using a graph-based execution model. Ideal for AI agents, data pipelines, and any application needing versioned state and rich diagnostics.
Add to your Cargo.toml:
[dependencies]
weavegraph = "0.1"
use weavegraph::{
graphs::GraphBuilder,
message::Message,
node::{Node, NodeContext, NodePartial},
state::VersionedState,
};
use async_trait::async_trait;
struct HelloNode;
#[async_trait]
impl Node for HelloNode {
async fn run(
&self,
_snapshot: weavegraph::state::StateSnapshot,
_ctx: NodeContext,
) -> Result<NodePartial, weavegraph::node::NodeError> {
Ok(NodePartial::new().with_messages(vec![Message::assistant("Hello, world!")]))
}
}
#[tokio::main]
async fn main() -> miette::Result<()> {
use weavegraph::types::NodeKind;
let app = GraphBuilder::new()
.add_node(NodeKind::Custom("hello".into()), HelloNode)
.add_edge(NodeKind::Start, NodeKind::Custom("hello".into()))
.add_edge(NodeKind::Custom("hello".into()), NodeKind::End)
.compile()?;
let state = VersionedState::new_with_user_message("Hi!");
let result = app.invoke(state).await?;
for message in result.messages.snapshot() {
println!("{}: {}", message.role, message.content);
}
Ok(())
}
NOTE:
NodeKind::StartandNodeKind::Endare virtual structural endpoints.
You never register them withadd_node; attempts to do so are ignored with a warning.
For testing and ephemeral workflows use the InMemory checkpointer:
// After compiling the graph into an `App`:
let runner = AppRunner::new(app, CheckpointerType::InMemory).await; // In-memory state
Run the comprehensive test suite:
# All tests with output
cargo test --all -- --nocapture
# Specific test categories
cargo test schedulers:: -- --nocapture
cargo test channels:: -- --nocapture
cargo test integration:: -- --nocapture
Property-based testing with proptest ensures correctness across edge cases.
We welcome contributions! See CONTRIBUTING.md.
MIT — see LICENSE.