$git clone https://github.com/jieyefriic/rp-engineYAML-native agent workflow execution engine, written in Rust.
| 1 | # riceprompt-engine |
| 2 | |
| 3 | YAML-native agent workflow execution engine, written in Rust. |
| 4 | |
| 5 | You describe an agent workflow as a YAML file — nodes, edges, prompts, data |
| 6 | sources, MCP tools — and the engine parses it, resolves dependencies, and |
| 7 | executes the graph: making LLM calls, running scripts, querying databases, |
| 8 | calling MCP tools, iterating over data, and orchestrating multi-agent plans. |
| 9 | |
| 10 | This engine powers **[RicePrompt](https://riceprompt.app)** — the visual |
| 11 | agent IDE where you build and run these workflows without writing YAML by hand. |
| 12 | |
| 13 | ```toml |
| 14 | [dependencies] |
| 15 | riceprompt-engine = "0.1" |
| 16 | ``` |
| 17 | |
| 18 | ## Features |
| 19 | |
| 20 | - **YAML-native** — entire workflow (graph, prompts, data sources, providers) |
| 21 | in a single declarative file. See [`docs/FLOW_SPEC.md`](docs/FLOW_SPEC.md) |
| 22 | for the authoritative spec. |
| 23 | - **Multi-provider LLM support** — OpenAI, Anthropic, Gemini, DeepSeek, Qwen, |
| 24 | Zhipu, Moonshot, MiniMax, xAI, Huoshan, and any OpenAI-compatible endpoint. |
| 25 | - **Streaming, tool calling, structured output** — first-class across providers. |
| 26 | - **Rich node types** — `generate`, `transform` (Rhai scripting), `iterator`, |
| 27 | `supervisor` (multi-agent routing), `subgraph`, `data_connector`, |
| 28 | `skill_set` (progressive-disclosure knowledge bundles), `mcp` / |
| 29 | `mcp_tools` (Model Context Protocol). |
| 30 | - **Built-in data connectors** — PostgreSQL, MySQL, MongoDB, Redis, Qdrant, |
| 31 | S3-compatible object storage, REST APIs. |
| 32 | - **Harness layer** — workflow-level instructions (CLAUDE.md-style) injected |
| 33 | into every generate node, with persistent memory support. |
| 34 | - **Self-describing results** — `ExecutionResult` can include the source YAML |
| 35 | so downstream tooling renders the topology + per-node results from one file. |
| 36 | - **Checkpoint / resume** — pause and resume long-running workflows. |
| 37 | |
| 38 | ## Quick start |
| 39 | |
| 40 | A minimal three-node workflow: |
| 41 | |
| 42 | ```yaml |
| 43 | version: "1.0" |
| 44 | name: "hello_world" |
| 45 | |
| 46 | providers: |
| 47 | openai: |
| 48 | api_key: "${OPENAI_API_KEY}" |
| 49 | |
| 50 | nodes: |
| 51 | - id: start |
| 52 | type: start |
| 53 | |
| 54 | - id: greet |
| 55 | type: generate |
| 56 | config: |
| 57 | provider: openai |
| 58 | model: gpt-4o-mini |
| 59 | template: tpl_greet |
| 60 | variables: |
| 61 | name: "start.name" |
| 62 | |
| 63 | - id: response |
| 64 | type: response |
| 65 | config: |
| 66 | output: |
| 67 | greeting: "greet.output" |
| 68 | |
| 69 | edges: |
| 70 | - from: start |
| 71 | to: greet |
| 72 | - from: greet |
| 73 | to: response |
| 74 | |
| 75 | templates: |
| 76 | tpl_greet: |
| 77 | user_prompt: "Greet {{name}} warmly in one sentence." |
| 78 | ``` |
| 79 | |
| 80 | Run it: |
| 81 | |
| 82 | ```rust |
| 83 | use riceprompt_engine::Engine; |
| 84 | use serde_json::json; |
| 85 | |
| 86 | #[tokio::main] |
| 87 | async fn main() -> anyhow::Result<()> { |
| 88 | let yaml = std::fs::read_to_string("hello.yaml")?; |
| 89 | let engine = Engine::builder().build()?; |
| 90 | let result = engine.run_yaml(&yaml, json!({ "name": "Ada" })).await?; |
| 91 | println!("{}", serde_json::to_string_pretty(&result)?); |
| 92 | Ok(()) |
| 93 | } |
| 94 | ``` |
| 95 | |
| 96 | More runnable examples live under [`examples/`](examples/). |
| 97 | |
| 98 | ## Documentation |
| 99 | |
| 100 | - [`docs/FLOW_SPEC.md`](docs/FLOW_SPEC.md) — authoritative YAML workflow spec |
| 101 | (node types, fields, providers, data sources, harness, skills, MCP). |
| 102 | - A user-facing usage guide ("skill guide") will be published separately. |
| 103 | |
| 104 | ## Related |
| 105 | |
| 106 | - **[RicePrompt](https://riceprompt.app)** — visual agent IDE built on top |
| 107 | of this engine. Design workflows in a graph editor, run them in-browser, |
| 108 | and export the same YAML this engine consumes. |
| 109 | |
| 110 | ## Project status |
| 111 | |
| 112 | `0.1.x` — the API may change between minor versions while the spec |
| 113 | stabilizes. Pin an exact version if you need stability. |
| 114 | |
| 115 | ## Contributing |
| 116 | |
| 117 | Issues and PRs welcome. Please: |
| 118 | |
| 119 | - Run `cargo fmt` and `cargo clippy --all-targets` before submitting. |
| 120 | - Add tests for new node types or provider behaviors. |
| 121 | - For changes that touch the YAML surface, update `docs/FLOW_SPEC.md` in |
| 122 | the same PR. |
| 123 | |
| 124 | ## License |
| 125 | |
| 126 | Licensed under either of |
| 127 | |
| 128 | - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or |
| 129 | <http://www.apache.org/licenses/LICENSE-2.0>) |
| 130 | - MIT license ([LICENSE-MIT](LICENSE-MIT) or |
| 131 | <http://opensource.org/licenses/MIT>) |
| 132 | |
| 133 | at your option. |
| 134 | |
| 135 | Unless you explicitly state otherwise, any contribution intentionally |
| 136 | submitt |