rust-logic-graph 0.8.6

A modular reasoning graph framework for distributed logic orchestration
Documentation

๐Ÿง  Rust Logic Graph

Rust License: MIT GitHub CI

A high-performance reasoning graph framework for Rust with GRL (Grule Rule Language) support. Build complex workflows with conditional execution, topological ordering, and async processing.


โœจ Key Features

  • ๐Ÿ”ฅ GRL Support - rust-rule-engine v0.14.0 with RETE-UL algorithm (2-24x faster)
  • ๐Ÿ”„ Topological Execution - Automatic DAG-based node ordering
  • โšก Async Runtime - Built on Tokio for high concurrency
  • โšก Parallel Execution - Automatic parallel execution of independent nodes (v0.5.0)
  • ๐Ÿ’พ Caching Layer - High-performance result caching with TTL, eviction policies, and memory limits (v0.5.0)
  • ๐Ÿง  Memory Optimization - Context pooling and allocation tracking (v0.7.0)
  • ๐Ÿ› ๏ธ CLI Developer Tools - Graph validation, dry-run, profiling, and visualization (v0.5.0)
  • ๐ŸŽจ Web Graph Editor - Next.js visual editor with drag-and-drop interface (v0.8.0)
  • ๏ฟฝ YAML Configuration - Declarative graph definitions with external config files (v0.8.5)
  • ๏ฟฝ๐Ÿ“Š Multiple Node Types - RuleNode, DBNode, AINode
  • ๐Ÿ“ JSON/YAML Configuration - Simple workflow definitions
  • ๐ŸŽฏ 98% Drools Compatible - Easy migration from Java
  • ๐ŸŒŠ Streaming Processing - Stream-based execution with backpressure (v0.3.0)
  • ๐Ÿ—„๏ธ Database Integrations - PostgreSQL, MySQL, Redis, MongoDB (v0.2.0)
  • ๐Ÿค– AI/LLM Integrations - OpenAI, Claude, Ollama (v0.2.0)

๐Ÿš€ Quick Start

Installation

[dependencies]
rust-logic-graph = "0.8.5"

# With specific integrations
rust-logic-graph = { version = "0.8.5", features = ["postgres", "openai"] }

# With all integrations
rust-logic-graph = { version = "0.8.5", features = ["all-integrations"] }

Simple Example

use rust_logic_graph::{RuleEngine, GrlRule};

let grl = r#"
rule "Discount" {
    when
        cart_total > 100 && is_member == true
    then
        discount = 0.15;
}
"#;

let mut engine = RuleEngine::new();
engine.add_grl_rule(grl)?;

๐Ÿข Real-World Case Study: Purchasing Flow System

See a complete production implementation in case_study/ - A full-featured purchasing automation system built with Rust Logic Graph.

๐Ÿ“Š System Overview

Problem: Automate purchasing decisions for inventory replenishment across multiple products, warehouses, and suppliers.

Solution: Business rules in GRL decide when/how much to order. Orchestrator executes the workflows.

๐ŸŽฏ Two Architecture Implementations

1. Microservices (v4.0) - 7 services with gRPC

  • Orchestrator (port 8080) - Workflow coordination
  • OMS Service (port 50051) - Order management data
  • Inventory Service (port 50052) - Stock levels
  • Supplier Service (port 50053) - Supplier information
  • UOM Service (port 50054) - Unit conversions
  • Rule Engine (port 50055) - GRL business rules
  • PO Service (port 50056) - Purchase order management

2. Monolithic (Clean Architecture) - Single HTTP service with dynamic configuration

  • Same business logic as microservices (shared GRL rules)
  • Single process on port 8080
  • Multi-database architecture - 4 separate PostgreSQL databases (oms_db, inventory_db, supplier_db, uom_db)
  • YAML-driven workflow - Graph structure defined in purchasing_flow_graph.yaml
  • Dynamic field mapping - Config-driven data extraction from context
  • Zero hardcoded fields - All field names configurable via YAML
  • Direct in-process execution (no network calls)

๐Ÿ”ฅ GRL Business Rules (15 Rules)

rule "CalculateShortage" salience 120 no-loop {
  when
    required_qty > 0
  then
    Log("Calculating shortage...");
    shortage = required_qty - available_qty;
    Log("Shortage calculated");
}

rule "OrderMOQWhenShortageIsLess" salience 110 no-loop {
  when
    shortage > 0 && shortage < moq && is_active == true
  then
    Log("Shortage less than MOQ, ordering MOQ");
    order_qty = moq;
}

See full rules: purchasing_rules.grl

YAML Configuration (NEW in v0.8.5)

Both Monolithic and Microservices implementations support YAML-based graph configuration:

Monolithic YAML Example (purchasing_flow_graph.yaml):

nodes:
  oms_history:
    type: DBNode
    database: "oms_db"  # Multi-database routing
    query: "SELECT product_id, avg_daily_demand::float8, trend FROM oms_history WHERE product_id = $1"
  
  inventory_levels:
    type: DBNode
    database: "inventory_db"
    query: "SELECT product_id, available_qty::float8, reserved_qty::float8 FROM inventory WHERE product_id = $1"
  
  rule_engine:
    type: RuleNode
    description: "Evaluate business rules with dynamic field mapping"
    dependencies:
      - oms_history
      - inventory_levels
      - supplier_info
      - uom_conversion
    field_mappings:  # Dynamic field extraction (NEW)
      avg_daily_demand: "oms_history.avg_daily_demand"
      available_qty: "inventory_levels.available_qty"
      lead_time: "supplier_info.lead_time"
      moq: "supplier_info.moq"

  create_po:
    type: RuleNode
    dependencies:
      - rule_engine
    field_mappings:
      should_order: "rule_engine.should_order"
      recommended_qty: "rule_engine.recommended_qty"
      product_id: "supplier_info.product_id"

edges:
  - from: oms_history
    to: rule_engine
  - from: inventory_levels
    to: rule_engine
  - from: rule_engine
    to: create_po

Microservices YAML Example (purchasing_flow_graph.yaml):

nodes:
  oms_grpc:
    type: DBNode
    description: "Fetch order management data via gRPC"
  
  inventory_grpc:
    type: DBNode
    description: "Fetch inventory levels via gRPC"
  
  rule_engine_grpc:
    type: RuleNode
    description: "Evaluate business rules"
    dependencies:
      - oms_grpc
      - inventory_grpc

edges:
  - from: oms_grpc
    to: rule_engine_grpc
  - from: inventory_grpc
    to: rule_engine_grpc

Benefits:

  • โœ… 70% less code - Graph definition moves from Rust to YAML
  • โœ… No recompile - Change workflows without rebuilding
  • โœ… Dynamic field mapping - Zero hardcoded field names in Rust code
  • โœ… Multi-database routing - Each node specifies its database
  • โœ… Multiple workflows - Easy variants (urgent, standard, approval)
  • โœ… Better readability - Clear, declarative graph structure
  • โœ… Easy testing - Test with different configurations

Usage:

// Monolithic - Default config with multi-database
executor.execute("PROD-001").await?;

// Monolithic - Custom workflow
executor.execute_with_config("PROD-001", "urgent_flow.yaml").await?;

// Microservices - Default config with gRPC nodes
orchestrator.execute("PROD-001").await?;

Key Architecture Differences:

Feature Monolithic Microservices
Database Access Direct SQL queries to 4 DBs gRPC calls to services
Field Mapping YAML field_mappings config Hardcoded in gRPC nodes
Rule Engine In-process RuleEngine call gRPC to rule-engine-service
Communication Function calls gRPC (network)
Graph Executor PurchasingGraphExecutor OrchestratorExecutor
Node Types DynamicDBNode, DynamicRuleNode OmsGrpcNode, RuleEngineGrpcNode

Documentation: See YAML_CONFIGURATION_SUMMARY.md

Microservices Communication Flow

After v0.8.0 refactor, the Orchestrator now uses rust-logic-graph's Graph/Executor pattern to coordinate microservices:

  • The Orchestrator receives a purchasing request (HTTP) and creates a Graph with 6 custom gRPC Nodes.
  • Each Node wraps a gRPC call to a service: OmsGrpcNode, InventoryGrpcNode, SupplierGrpcNode, UomGrpcNode, RuleEngineGrpcNode, PoGrpcNode.
  • The Executor runs the graph in topological order:
    1. Data Collection Phase (parallel): OMS, Inventory, Supplier, UOM nodes execute simultaneously via gRPC
    2. Rule Evaluation Phase: RuleEngineGrpcNode waits for all data, then evaluates GRL rules
    3. Execution Phase: PoGrpcNode creates/sends PO based on rule decisions
  • All business logic (decision flags, calculations) comes from GRL rules. The Orchestrator is a pure executor.

Graph Topology:

OMS Node โ”€โ”€โ”€โ”€โ”
             โ”‚
Inventory โ”€โ”€โ”€โ”ผโ”€โ”€โ†’ RuleEngine Node โ”€โ”€โ†’ PO Node
             โ”‚
Supplier โ”€โ”€โ”€โ”€โ”ค
             โ”‚
UOM Node โ”€โ”€โ”€โ”€โ”˜

Benefits of Graph/Executor Pattern:

  • โœ… Declarative: Define workflow as nodes + edges instead of imperative code
  • โœ… Parallel Execution: Data nodes run concurrently automatically
  • โœ… Type Safety: Custom Node implementations with Rust's type system
  • โœ… Testable: Each node can be tested in isolation
  • โœ… Consistent: Same pattern used in monolithic and microservices
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         CLIENT (HTTP REST)                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚ POST /purchasing/flow
                                 โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚            Orchestrator Service (Port 8080)                โ”‚
        โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
        โ”‚  โ”‚          rust-logic-graph Graph Executor            โ”‚   โ”‚
        โ”‚  โ”‚                                                     โ”‚   โ”‚
        โ”‚  โ”‚  Creates Graph with 6 gRPC Nodes:                   โ”‚   โ”‚
        โ”‚  โ”‚  โ€ข OmsGrpcNode      โ†’ gRPC to OMS :50051            โ”‚   โ”‚
        โ”‚  โ”‚  โ€ข InventoryGrpcNode โ†’ gRPC to Inventory :50052     โ”‚   โ”‚
        โ”‚  โ”‚  โ€ข SupplierGrpcNode โ†’ gRPC to Supplier :50053       โ”‚   โ”‚
        โ”‚  โ”‚  โ€ข UomGrpcNode      โ†’ gRPC to UOM :50054            โ”‚   โ”‚
        โ”‚  โ”‚  โ€ข RuleEngineGrpcNode โ†’ gRPC to Rules :50055        โ”‚   โ”‚
        โ”‚  โ”‚  โ€ข PoGrpcNode       โ†’ gRPC to PO :50056             โ”‚   โ”‚
        โ”‚  โ”‚                                                     โ”‚   โ”‚
        โ”‚  โ”‚  Graph Topology:                                    โ”‚   โ”‚
        โ”‚  โ”‚  OMS โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                       โ”‚   โ”‚
        โ”‚  โ”‚  Inventory โ”€โ”ผโ”€โ†’ RuleEngine โ”€โ”€โ†’ PO                   โ”‚   โ”‚
        โ”‚  โ”‚  Supplier โ”€โ”€โ”ค                                       โ”‚   โ”‚
        โ”‚  โ”‚  UOM โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                       โ”‚   โ”‚
        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ (Parallel)  โ”‚  (Parallel)      โ”‚   (Parallel)   โ”‚  (Parallel)  โ”‚
   โ–ผ             โ–ผ                  โ–ผ                โ–ผ              โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
โ”‚OMS :50051โ”‚  โ”‚Inventory   โ”‚  โ”‚Supplier     โ”‚  โ”‚UOM :50054 โ”‚        โ”‚
โ”‚          โ”‚  โ”‚:50052      โ”‚  โ”‚:50053       โ”‚  โ”‚           โ”‚        โ”‚
โ”‚โ€ข History โ”‚  โ”‚โ€ข Levels    โ”‚  โ”‚โ€ข Pricing    โ”‚  โ”‚โ€ข Convert  โ”‚        โ”‚
โ”‚โ€ข Demand  โ”‚  โ”‚โ€ข Available โ”‚  โ”‚โ€ข Lead Time  โ”‚  โ”‚โ€ข Factors  โ”‚        โ”‚
โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
     โ”‚              โ”‚                โ”‚               โ”‚              โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚
                          โ”‚                                         โ”‚
                          โ”‚ Data stored in Graph Context            โ”‚
                          โ–ผ                                         โ”‚
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                              โ”‚
                   โ”‚ Rule Engine     โ”‚ (Port 50055 - gRPC)          โ”‚
                   โ”‚     :50055      โ”‚                              โ”‚
                   โ”‚                 โ”‚                              โ”‚
                   โ”‚ โ€ข GRL Rules     โ”‚ โ€ข Evaluates 15 rules         โ”‚
                   โ”‚ โ€ข Calculations  โ”‚ โ€ข Returns decision flags     โ”‚
                   โ”‚ โ€ข Decision Flagsโ”‚ โ€ข NO side effects            โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                              โ”‚
                            โ”‚                                       โ”‚
                            โ”‚ Flags stored in Graph Context         โ”‚
                            โ–ผ                                       โ”‚
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                              โ”‚
                   โ”‚ PO Service      โ”‚ (Port 50056 - gRPC)          โ”‚
                   โ”‚    :50056       โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚                 โ”‚
                   โ”‚ โ€ข Create PO     โ”‚ โ€ข Reads flags from context
                   โ”‚ โ€ข Send to       โ”‚ โ€ข Executes based on rules
                   โ”‚   Supplier      โ”‚ โ€ข Email/API delivery
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Note: The Rule Engine service returns decision flags and calculations to the Graph Context. The PoGrpcNode then reads these flags from the context to determine whether to create/send the PO.

Where rust-logic-graph is Used

Monolithic App (case_study/monolithic/):

  • Uses Graph, Executor, and custom Node implementations
  • Multi-database architecture: 4 separate PostgreSQL databases (oms_db, inventory_db, supplier_db, uom_db)
  • Dynamic field mapping: YAML-configured field extraction with zero hardcoded field names
  • Config-driven nodes: DynamicDBNode and DynamicRuleNode read behavior from YAML
  • Database routing via database field in YAML (e.g., database: "oms_db")
  • Field mappings via field_mappings in YAML (e.g., avg_daily_demand: "oms_history.avg_daily_demand")
  • RuleEngineService accepts HashMap<String, Value> for complete flexibility
  • Graph structure defined in purchasing_flow_graph.yaml
  • Single process, no network calls

Orchestrator Microservice (case_study/microservices/services/orchestrator-service/):

  • Uses Graph, Executor, and custom gRPC Node implementations
  • 6 gRPC nodes make network calls to remote services
  • Same graph topology as monolithic
  • Distributed across multiple processes

Rule Engine Service (case_study/microservices/services/rule-engine-service/):

  • Uses RuleEngine for GRL evaluation
  • Exposed via gRPC endpoint
  • Stateless service (no graph execution)

Other Microservices (OMS, Inventory, Supplier, UOM, PO):

  • Standard gRPC services with database access
  • Do NOT use rust-logic-graph directly
  • Called by Orchestrator's Graph Executor

Architecture Highlights:

Monolithic Clean Architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   HTTP REST API (Port 8080)                             โ”‚
โ”‚                 POST /purchasing/flow {product_id}                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚         PurchasingGraphExecutor (Clean Architecture)          โ”‚
        โ”‚                                                               โ”‚
        โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
        โ”‚  โ”‚       rust-logic-graph Graph/Executor Engine           โ”‚  โ”‚
        โ”‚  โ”‚                                                        โ”‚  โ”‚
        โ”‚  โ”‚  1. Load purchasing_flow_graph.yaml                    โ”‚  โ”‚
        โ”‚  โ”‚  2. Parse nodes + edges + field_mappings               โ”‚  โ”‚
        โ”‚  โ”‚  3. Create DynamicDBNode per database config           โ”‚  โ”‚
        โ”‚  โ”‚  4. Create DynamicRuleNode with field mappings         โ”‚  โ”‚
        โ”‚  โ”‚  5. Execute graph in topological order                 โ”‚  โ”‚
        โ”‚  โ”‚                                                        โ”‚  โ”‚
        โ”‚  โ”‚  Graph Topology:                                       โ”‚  โ”‚
        โ”‚  โ”‚  oms_history โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚  โ”‚
        โ”‚  โ”‚  inventory_levels โ”€โ”€โ”€โ”ผโ”€โ”€โ†’ rule_engine โ”€โ”€โ†’ create_po    โ”‚  โ”‚
        โ”‚  โ”‚  supplier_info โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                                 โ”‚  โ”‚
        โ”‚  โ”‚  uom_conversion โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚  โ”‚
        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ (Parallel DBs)   โ”‚  (Parallel DBs)  โ”‚  (Parallel DBs)  โ”‚ (Parallel)
    โ–ผ                  โ–ผ                  โ–ผ                  โ–ผ          โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  oms_db      โ”‚  โ”‚ inventory_db โ”‚  โ”‚ supplier_db  โ”‚  โ”‚   uom_db     โ”‚ โ”‚
โ”‚ PostgreSQL   โ”‚  โ”‚ PostgreSQL   โ”‚  โ”‚ PostgreSQL   โ”‚  โ”‚ PostgreSQL   โ”‚ โ”‚
โ”‚              โ”‚  โ”‚              โ”‚  โ”‚              โ”‚  โ”‚              โ”‚ โ”‚
โ”‚ โ€ข history    โ”‚  โ”‚ โ€ข levels     โ”‚  โ”‚ โ€ข info       โ”‚  โ”‚ โ€ข conversion โ”‚ โ”‚
โ”‚ โ€ข demand     โ”‚  โ”‚ โ€ข available  โ”‚  โ”‚ โ€ข pricing    โ”‚  โ”‚ โ€ข factors    โ”‚ โ”‚
โ”‚ โ€ข trends     โ”‚  โ”‚ โ€ข reserved   โ”‚  โ”‚ โ€ข lead_time  โ”‚  โ”‚              โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
       โ”‚                 โ”‚                 โ”‚                 โ”‚         โ”‚
       โ”‚ Query with      โ”‚ Query with      โ”‚ Query with      โ”‚ Query   โ”‚
       โ”‚ database:"oms"  โ”‚ database:"inv"  โ”‚ database:"sup"  โ”‚ with DB โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                         Data stored in Graph Context
                         with path notation (e.g., "oms_history.avg_daily_demand")
                                    โ”‚
                                    โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚        DynamicRuleNode (rule_engine)     โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  YAML field_mappings config:             โ”‚
                  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
                  โ”‚  โ”‚ avg_daily_demand:                  โ”‚  โ”‚
                  โ”‚  โ”‚   "oms_history.avg_daily_demand"   โ”‚  โ”‚
                  โ”‚  โ”‚ available_qty:                     โ”‚  โ”‚
                  โ”‚  โ”‚   "inventory_levels.available_qty" โ”‚  โ”‚
                  โ”‚  โ”‚ lead_time:                         โ”‚  โ”‚
                  โ”‚  โ”‚   "supplier_info.lead_time"        โ”‚  โ”‚
                  โ”‚  โ”‚ ... (9 total mappings)             โ”‚  โ”‚
                  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  extract_rule_inputs() loop:             โ”‚
                  โ”‚  โ€ข Reads field_mappings from YAML        โ”‚
                  โ”‚  โ€ข Uses get_value_by_path() for parsing  โ”‚
                  โ”‚  โ€ข Returns HashMap<String, Value>        โ”‚
                  โ”‚  โ€ข ZERO hardcoded field names!           โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚      RuleEngineService (In-Process)      โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  evaluate(HashMap<String, Value>)        โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  โ€ข Loads purchasing_rules.grl            โ”‚
                  โ”‚  โ€ข 15 business rules (GRL)               โ”‚
                  โ”‚  โ€ข Accepts dynamic HashMap input         โ”‚
                  โ”‚  โ€ข No struct, no hardcoded fields        โ”‚
                  โ”‚  โ€ข Pure functional evaluation            โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  Rules calculate:                        โ”‚
                  โ”‚  โœ“ shortage = required_qty - available   โ”‚
                  โ”‚  โœ“ order_qty (respects MOQ)              โ”‚
                  โ”‚  โœ“ total_amount with discounts           โ”‚
                  โ”‚  โœ“ requires_approval flag                โ”‚
                  โ”‚  โœ“ should_create_po flag                 โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                      Decision flags returned to Context
                                 โ”‚
                                 โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚    DynamicRuleNode (create_po)           โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  YAML field_mappings config:             โ”‚
                  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
                  โ”‚  โ”‚ should_order:                      โ”‚  โ”‚
                  โ”‚  โ”‚   "rule_engine.should_order"       โ”‚  โ”‚
                  โ”‚  โ”‚ recommended_qty:                   โ”‚  โ”‚
                  โ”‚  โ”‚   "rule_engine.recommended_qty"    โ”‚  โ”‚
                  โ”‚  โ”‚ product_id:                        โ”‚  โ”‚
                  โ”‚  โ”‚   "supplier_info.product_id"       โ”‚  โ”‚
                  โ”‚  โ”‚ ... (6 total mappings)             โ”‚  โ”‚
                  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                  โ”‚                                          โ”‚
                  โ”‚  โ€ข Reads rule_engine output from context โ”‚
                  โ”‚  โ€ข Dynamic field extraction via YAML     โ”‚
                  โ”‚  โ€ข Creates PO if should_order == true    โ”‚
                  โ”‚  โ€ข Returns PO JSON or null               โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Design Principles:

  1. Multi-Database Routing - Each node specifies its database in YAML:

    oms_history:
      database: "oms_db"  # Routes to oms_db pool
    
  2. Dynamic Field Mapping - Zero hardcoded fields in Rust code:

    field_mappings:
      avg_daily_demand: "oms_history.avg_daily_demand"
    
    // Code is 100% generic
    for (key, path) in &self.field_mappings {
        inputs.insert(key.clone(), get_value_by_path(ctx, path));
    }
    
  3. Config-Driven Execution - Graph structure in YAML, not Rust:

    executor.execute_with_config("PROD-001", "purchasing_flow_graph.yaml")?;
    
  4. HashMap-Based RuleEngine - Accepts any fields:

    pub fn evaluate(&mut self, inputs: HashMap<String, Value>) -> Result<Output>
    

Microservices Communication Flow

  1. Multi-Database Routing (graph_executor.rs):
// YAML config specifies database per node
oms_history:
  database: "oms_db"
  query: "SELECT ..."

// Executor routes to correct pool
let pool = self.get_pool(node_config.database.as_deref());
  1. Dynamic Field Mapping (graph_executor.rs):
// YAML config defines field mappings
field_mappings:
  avg_daily_demand: "oms_history.avg_daily_demand"
  available_qty: "inventory_levels.available_qty"

// Code extracts dynamically (zero hardcoding)
fn extract_inputs(&self, ctx: &Context) -> HashMap<String, Value> {
    for (key, path) in &self.field_mappings {
        if let Some(value) = self.get_value_by_path(ctx, path) {
            inputs.insert(key.clone(), value);
        }
    }
}
  1. Config-Driven RuleEngine (rule_service.rs):
// Accepts HashMap instead of struct - 100% flexible
pub fn evaluate(&mut self, inputs: HashMap<String, Value>) -> Result<Output> {
    // Uses any fields present in HashMap
    // No hardcoded field requirements
}

Web Graph Editor (NEW in v0.8.0)

๐ŸŒ Online Editor: https://logic-graph-editor.amalthea.cloud/

Try the visual graph editor online - no installation required! Create workflows, define rules, and visualize your logic graphs with drag-and-drop.

CLI Tools (v0.5.0)

# Build the CLI tool
cargo build --release --bin rlg

# Validate a graph
./target/release/rlg validate --file examples/sample_graph.json

# Visualize graph structure
./target/release/rlg visualize --file examples/sample_graph.json --details

# Profile performance
./target/release/rlg profile --file examples/sample_graph.json --iterations 100

# Dry-run without execution
./target/release/rlg dry-run --file examples/sample_graph.json --verbose

Full CLI Documentation โ†’

Run Examples

# Basic workflow
cargo run --example simple_flow

# GRL rules
cargo run --example grl_rules

# Advanced integration
cargo run --example grl_graph_flow


๐Ÿ“š Documentation

Document Description
๐Ÿข Case Study: Purchasing Flow Real production system with microservices & monolithic implementations
๐Ÿ“‹ YAML Configuration Guide Declarative graph configuration with YAML (NEW in v0.8.5)
Graph Editor Guide Visual web-based graph editor with Next.js (NEW in v0.8.0)
Memory Optimization Guide Context pooling and allocation tracking (v0.7.0)
CLI Tool Guide Developer tools for validation, profiling, and visualization (v0.5.0)
Cache Guide Caching layer with TTL and eviction policies (v0.5.0)
Migration Guide Upgrade guide to v0.14.0 with RETE-UL (v0.5.0)
Integrations Guide Database & AI integrations (v0.2.0)
GRL Guide Complete GRL syntax and examples
Use Cases 33+ real-world applications
Extending Create custom nodes and integrations
Implementation Technical details

๐ŸŽฏ Use Cases

Rust Logic Graph powers applications in:

  • ๐Ÿ’ฐ Finance - Loan approval, fraud detection, risk assessment
  • ๐Ÿ›’ E-commerce - Dynamic pricing, recommendations, fulfillment
  • ๐Ÿฅ Healthcare - Patient triage, clinical decisions, monitoring
  • ๐Ÿญ Manufacturing - Predictive maintenance, QC automation
  • ๐Ÿ›ก๏ธ Insurance - Claims processing, underwriting
  • ๐Ÿ“Š Marketing - Lead scoring, campaign optimization
  • โš–๏ธ Compliance - AML monitoring, GDPR automation

View all 33+ use cases โ†’


๐Ÿ—๏ธ Architecture

Rust Logic Graph architecture diagram


๐Ÿ”ฅ GRL Example

rule "HighValueLoan" salience 100 {
    when
        loan_amount > 100000 &&
        credit_score < 750
    then
        requires_manual_review = true;
        approval_tier = "senior";
}

rule "AutoApproval" salience 50 {
    when
        credit_score >= 700 &&
        income >= loan_amount * 3 &&
        debt_ratio < 0.4
    then
        auto_approve = true;
        interest_rate = 3.5;
}

Learn more about GRL โ†’


๐Ÿ“Š Performance

  • RETE-UL Algorithm: Advanced pattern matching with unlinking (v0.14.0)
  • 2-24x Faster: Than v0.10 at 50+ rules
  • 98% Drools Compatible: Easy migration path
  • Async by Default: High concurrency support
  • Parallel Execution: Automatic layer-based parallelism
  • Smart Caching: Result caching with TTL and eviction policies

๐Ÿงช Testing & CLI Tools

# Run all tests
cargo test

# Build CLI tool
cargo build --release --bin rlg

# Validate graph
./target/release/rlg validate --file examples/sample_graph.json

# Visualize graph structure
./target/release/rlg visualize --file examples/sample_graph.json

# Profile performance
./target/release/rlg profile --file examples/sample_graph.json --iterations 100

# Dry-run execution
./target/release/rlg dry-run --file examples/sample_graph.json --verbose

Test Results: โœ… 32/32 tests passing

Learn more about CLI tools โ†’


๐Ÿ“ฆ Project Status

Version: 0.8.5 (Latest) Status: Production-ready with YAML configuration, web graph editor, and real-world case study

What's Working

  • โœ… Core graph execution engine
  • โœ… RETE-UL algorithm (v0.14.0) - 2-24x faster
  • โœ… Three node types (Rule, DB, AI)
  • โœ… Topological sorting
  • โœ… Async execution
  • โœ… JSON I/O
  • โœ… Database integrations (PostgreSQL, MySQL, Redis, MongoDB)
  • โœ… AI integrations (OpenAI, Claude, Ollama)
  • โœ… Streaming processing with backpressure and chunking
  • โœ… Parallel execution with automatic layer detection
  • โœ… Caching layer with TTL, eviction policies, memory limits (v0.5.0)
  • โœ… Memory optimization with context pooling (v0.7.0)
  • โœ… CLI Developer Tools - validate, profile, visualize, dry-run (v0.5.0)
  • โœ… Web Graph Editor - Next.js visual editor with drag-and-drop (v0.8.0)
  • โœ… Production Case Study - Purchasing flow with microservices & monolithic (v0.8.0)
  • โœ… YAML Configuration - Declarative graph definitions (v0.8.5)
  • โœ… Stream operators (map, filter, fold)
  • โœ… Comprehensive documentation

Roadmap

  • Streaming processing (v0.3.0) - COMPLETED โœ…
  • Parallel node execution (v0.4.0) - COMPLETED โœ…
  • Caching layer (v0.5.0) - COMPLETED โœ…
  • CLI Developer Tools (v0.5.0) - COMPLETED โœ…
  • RETE-UL upgrade (v0.5.0) - COMPLETED โœ…
  • Memory Optimization (v0.7.0) - COMPLETED โœ…
  • Web Graph Editor (v0.8.0) - COMPLETED โœ…
  • Production Case Study (v0.8.0) - COMPLETED โœ…
  • YAML Configuration (v0.8.5) - COMPLETED โœ…
  • GraphQL API (v0.9.0)
  • Production release (v1.0.0)

See ROADMAP.md for details


๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create your feature branch
  3. Write tests for new features
  4. Submit a pull request

๐Ÿ“– Examples

Example Description Lines
simple_flow.rs Basic 3-node pipeline 36
advanced_flow.rs Complex 6-node workflow 120
grl_rules.rs GRL rule examples 110
grl_graph_flow.rs GRL + Graph integration 140
postgres_flow.rs PostgreSQL integration 100
openai_flow.rs OpenAI GPT integration 150
streaming_flow.rs Streaming with backpressure 200
parallel_execution.rs Parallel node execution 250

CLI Tool Examples (v0.5.0)

File Description
examples/sample_graph.json Linear workflow with 5 nodes
examples/cyclic_graph.json Graph with cycle for testing
examples/sample_context.json Sample input data

See CLI_TOOL.md for usage examples


๐ŸŒŸ Why Rust Logic Graph?

vs. Traditional Rule Engines

  • โœ… Async by default - No blocking I/O
  • โœ… Type safety - Rust's type system
  • โœ… Modern syntax - GRL support
  • โœ… Graph-based - Complex workflows

vs. Workflow Engines

  • โœ… Embedded - No external services
  • โœ… Fast - Compiled Rust code
  • โœ… Flexible - Custom nodes
  • โœ… Rule-based - Business logic in rules

๐Ÿ“ Changelog

v0.8.5 (2025-11-20) - YAML Configuration Release

New Features:

  • ๐Ÿ“‹ YAML Configuration Support - Declarative graph definitions
    • Load graph structure from YAML files instead of hardcoded
    • GraphConfig module for parsing YAML configurations
    • Support for both JSON and YAML formats
    • 70% code reduction in graph executors
    • See YAML Configuration Guide
  • ๐Ÿ”ง Enhanced Graph Executor API
    • execute() - Use default configuration
    • execute_with_config(config_path) - Load custom YAML config
    • Dynamic node registration from config
  • ๐Ÿ“ Multiple Workflow Support
    • Standard flow (full process)
    • Simplified flow (skip optional steps)
    • Urgent flow (fast-track)
    • Easy to create custom workflows
  • ๐Ÿ—๏ธ Monolithic Clean Architecture (NEW)
    • Multi-database architecture with 4 PostgreSQL databases
    • Dynamic field mapping via YAML configuration
    • Zero hardcoded field names in code
    • Database routing per node via config
    • field_mappings for flexible data extraction
    • RuleEngineService accepts HashMap<String, Value>
    • Config-driven DynamicDBNode and DynamicRuleNode
  • ๐Ÿ“š Comprehensive Documentation
    • YAML configuration guide with examples
    • Before/After comparison showing improvements
    • Multiple workflow examples
    • Integration guides for both architectures
    • Clean architecture patterns documentation

Improvements:

  • Monolithic and Microservices both support YAML configs
  • Reduced boilerplate code by 70% in executors
  • Better separation of concerns (config vs. code)
  • Easier testing with multiple configurations
  • No recompilation needed for workflow changes
  • Complete flexibility in field naming and mapping

Examples:

# Monolithic with multi-database
nodes:
  oms_history:
    database: "oms_db"
    query: "SELECT ..."
  rule_engine:
    field_mappings:
      avg_daily_demand: "oms_history.avg_daily_demand"
// Dynamic field extraction (no hardcoding)
let inputs = self.extract_rule_inputs(ctx);
rule_service.evaluate(inputs)?;  // HashMap<String, Value>

Compatibility:

  • All tests passing
  • API backward compatible
  • Existing hardcoded graphs still work

v0.8.0 (2025-11-20) - Web Editor & Production Case Study Release

New Features:

  • ๐ŸŽจ Web Graph Editor - Next.js visual editor with drag-and-drop
  • ๐Ÿข Production Case Study - Complete purchasing flow system
    • Microservices architecture (7 services with gRPC)
    • Monolithic architecture (single HTTP service)
    • 15 GRL business rules for purchasing decisions
    • Kubernetes deployment manifests
    • Docker Compose for local development
    • Shared GRL rules proving portability
    • See Case Study Documentation

Improvements:

  • Updated README with case study section
  • Added online graph editor link
  • Comprehensive production examples

Compatibility:

  • All tests passing
  • API backward compatible

v0.5.0 (2025-11-06) - Performance & Developer Tools Release

Breaking Changes:

  • โšก Upgraded rust-rule-engine from v0.10 โ†’ v0.14.0
    • Now uses RETE-UL algorithm (2-24x faster)
    • Better memory efficiency
    • Improved conflict resolution
    • See Migration Guide

New Features:

  • ๐Ÿ› ๏ธ CLI Developer Tools (rlg binary)
    • Graph validation with comprehensive checks
    • Dry-run execution mode
    • Performance profiling with statistics
    • ASCII graph visualization
    • See CLI Tool Guide
  • ๐Ÿ’พ Caching Layer - High-performance result caching
    • TTL-based expiration
    • Multiple eviction policies (LRU, LFU, FIFO)
    • Memory limits and statistics
    • See Cache Guide
  • โšก Parallel Node Execution - Automatic detection and parallel execution
    • Layer detection algorithm using topological sort
    • Concurrent execution within layers
    • Parallelism analysis and statistics
  • ๐Ÿ“Š ParallelExecutor - New executor with parallel capabilities
  • ๐Ÿ“ New Examples - CLI examples and test graphs
  • โœ… 32 Tests - Comprehensive test coverage

Improvements:

  • Updated documentation with CLI tools, caching, and migration guides
  • Performance benchmarking utilities
  • Example graph files for testing

Compatibility:

  • All 32 tests passing
  • API is backward compatible (100%)
  • Performance: 2-24x faster rule matching

v0.3.0 (2025-11-03) - Streaming & Performance Release

New Features:

  • ๐ŸŒŠ Streaming Processing - Stream-based node execution
    • Backpressure handling with bounded channels
    • Large dataset support with chunking
    • Stream operators (map, filter, fold, async map)
  • ๐Ÿ“ New Example - streaming_flow.rs with 6 demonstrations
  • โœ… 8 New Tests - Streaming module testing

Performance:

  • Processed 10,000 items in chunks
  • ~432 items/sec throughput with backpressure

v0.2.0 (2025-11-02) - Integrations Release

New Features:

  • ๐Ÿ—„๏ธ Database Integrations - PostgreSQL, MySQL, Redis, MongoDB
  • ๐Ÿค– AI/LLM Integrations - OpenAI GPT-4, Claude 3.5, Ollama
  • ๐Ÿ“ Integration Examples - postgres_flow.rs, openai_flow.rs
  • ๐Ÿ“š INTEGRATIONS.md - Comprehensive integration guide
  • ๐ŸŽ›๏ธ Feature Flags - Optional dependencies for integrations

v0.1.0 (2025-11-01) - Initial Release

Core Features:

  • ๐Ÿง  Core graph execution engine
  • ๐Ÿ”ฅ GRL (Grule Rule Language) integration
  • ๐Ÿ”„ Topological sorting
  • โšก Async execution with Tokio
  • ๐Ÿ“Š Three node types (Rule, DB, AI)
  • ๐Ÿ“ JSON I/O for graphs
  • ๐Ÿ“š 4 working examples
  • โœ… 6/6 tests passing

๐Ÿ“„ License

MIT License - see LICENSE for details.


๐Ÿ”— Links


๐Ÿ‘ฅ Authors

James Vu - Initial work


๐Ÿ™ Acknowledgments

Built with:


โญ Star us on GitHub if you find this useful! โญ

Documentation โ€ข Examples โ€ข Use Cases โ€ข YAML Config Guide