-
-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Welcome to the Rust Rule Engine documentation wiki! This is your complete guide to building powerful rule-based systems.
Start here to get up and running quickly:
-
Getting Started β START HERE
- 5-minute quick start
- Installation guide
- Your first rule
- Common patterns
-
- Choose your engine (Native, RETE-UL, Parallel)
- Performance benchmarks
- Decision matrix
- When to use each
-
- Complete rule language reference
- Conditions (WHEN clause)
- Actions (THEN clause)
- Advanced examples
Build sophisticated systems:
-
Advanced Patterns & Techniques
- Multi-stage workflows
- Finite state machines
- Complex aggregations
- Rule composition
- 10 advanced patterns
-
- Architecture setup
- Database integration
- Caching layer
- Docker deployment
- Monitoring & observability
- Scaling strategies
- Security considerations
Fix problems and optimize:
-
Troubleshooting & FAQ
- Common issues & solutions
- Performance tips
- Memory management
- Debug checklist
- Frequently asked questions
Building a Business Rules Engine? β Getting Started β GRL Syntax Guide β Advanced Patterns
Need High Performance? β Engine Comparison β Performance Tuning
Deploying to Production? β Production Deployment β Monitoring
Debugging Issues? β Troubleshooting & FAQ
Learning Advanced Topics? β Advanced Patterns β Production Deployment
Perfect for learning the basics:
- Getting Started - 10 min
- Engine Comparison - 15 min
- GRL Syntax Guide - 45 min
- Run examples from repository
Result: Can write simple rules and understand engines
Build real applications:
- Complete Path 1
- Advanced Patterns - 45 min
- Production Deployment - 60 min
- Set up local development environment
Result: Can build production-ready systems
Master the system:
- Complete Path 2
- Study all 60+ examples
- Deep dive into each engine
- Performance optimization
- Deploy to production
Result: Can architect complex rule systems
| Engine | Best For | Speed | Learn Time |
|---|---|---|---|
| Native | Simple rules, plugins | Good | 10 min |
| RETE-UL | 50-1000 rules | Excellent | 30 min |
| Parallel | Batch processing | Best | 45 min |
| Backward Chain | Goal reasoning | Medium | 1 hour |
A rule has three parts:
rule "RuleName" salience 100 no-loop {
when // Conditions
status == "active"
then // Actions
result = calculate(amount);
}
- Match - Find facts matching conditions
- Fire - Execute actions
- Update - Update working memory
- Repeat - Continue until no new matches
β
Plugin system (44+ actions)
β
Custom functions
β
GRL support
β
Template system
β
Simple API
β
High performance (10-100x faster)
β
Pattern matching
β
Incremental updates
β
Memory efficiency
β
Memoization
β Multi-field collections β Expression evaluation β Accumulate functions β Backward chaining with Disjunction (OR) β Truth maintenance system β Proof explanations with export
rule "VIPDiscount" {
when
customer.tier == "vip" &&
order.amount > 500
then
order.discount = order.amount * 0.25;
}
Multi-stage workflow checking income, credit score, and risk.
See detailed example β
Real-time detection of suspicious transactions.
See detailed example β
Alert on sensor readings exceeding thresholds.
See detailed example β
- Rust 1.70+
- Cargo package manager
# Create new project
cargo new my-rules-app
cd my-rules-app
# Add dependency
cargo add rust-rule-enginecargo run- π GitHub Repository
- π¦ Crates.io
- π API Documentation
- 60+ working examples in
examples/directory - Real-world use cases
- Performance demonstrations
- Integration patterns
- π¬ GitHub Discussions
- π Bug Reports
- π§ Contact: ttvuhm@gmail.com
- Introduction to Rule Engines (coming soon)
- RETE-UL Performance Deep Dive (coming soon)
- Production Deployment Walkthrough (coming soon)
After studying this wiki, you'll be able to:
- β Choose appropriate engine for your use case
- β Write complex GRL rules
- β Debug rule execution
- β Optimize for performance
- β Deploy to production
- β Handle edge cases
- β Build sophisticated workflows
- β Scale to thousands of rules
- Read Getting Started
- Run first example
- Modify and experiment
- Read Engine Comparison
- Study GRL Syntax Guide
- Review Advanced Patterns
- Run and modify examples
- Complete Option 2
- Study Production Deployment
- Set up development environment
- Write and test your rules
- Deploy locally with Docker
Home (You are here)
βββ Getting Started
βββ Engine Comparison & Selection
βββ GRL Syntax Guide
βββ Advanced Patterns & Techniques
βββ Production Deployment
βββ Troubleshooting & FAQ
| Task | Reference |
|---|---|
| Write first rule | Getting Started |
| Choose engine | Engine Comparison |
| Learn GRL syntax | GRL Syntax Guide |
| Build workflows | Advanced Patterns |
| Deploy to prod | Production Deployment |
| Fix problems | Troubleshooting & FAQ |
Ready to get started?
β Go to Getting Started Guide β
Last Updated: December 10, 2025 Version: 1.10.1 Status: Production Ready
Rust Rule Engine Β· Documentation Wiki
Copyright: Β© 2025 Ton That Vu
Version: 1.0.4
Crates.io: https://crates.io/crates/rust-rule-engine
Repository: https://github.com/KSD-CO/rust-rule-engine
Contact: ttvuhm@gmail.com
Community: Discussions Β· Issues
To edit this footer, modify the _Footer.md file in the wiki repository or use the GitHub Wiki web editor.
Notes:
- Use wiki-style links (no
.mdextension) for internal pages, e.g.[Getting Started](01-Getting-Started). - You can add logos, badges, or project-level information here.
- Home: Home
- Getting Started: Getting Started
- Engine Comparison: Engine Comparison & Selection
- GRL Syntax: GRL Syntax Guide
- Advanced Patterns: Advanced Patterns & Techniques
- Production & Deployment: Production Deployment
- Troubleshooting: Troubleshooting & FAQ
- Edit this
_Sidebar.mdfile in the wiki repository (or use the GitHub Wiki web editor). - Use wiki-style links (no
.mdextension), e.g.[Getting Started](01-Getting-Started). - To link to a section/anchor: use
[#Section-Name]appended to the page name, example:[See Installation](01-Getting-Started#Installation)
- Save and push; the wiki will show the sidebar automatically.
Notes:
- Keep entries ordered as you want them to appear.
- You can add nested lists for subsections.
- If you prefer a non-numbered menu, rename files and update links accordingly.