Skip to main content
Install the ZEN Engine and evaluate your first decision in Python.

Installation

Basic usage

Loader

The loader pattern enables dynamic decision loading from any storage backend. Combined with ZenDecisionContent for pre-compilation, this provides optimal performance for multi-decision applications.

File system

AWS S3

Azure Blob Storage

Google Cloud Storage

Async support

Use async_evaluate for non-blocking evaluation:

Error handling

Tracing

Enable tracing to inspect decision execution:

Expression utilities

Evaluate ZEN expressions outside of a decision context:
Compile expressions for repeated evaluation:

Spark integration

For distributed processing at scale, see PySpark and AWS Glue.

Best practices

Use ZenDecisionContent for caching. Pre-compiling decisions avoids repeated parsing overhead. Cache compiled content in a dict keyed by decision name. Initialize the engine once. Create a single ZenEngine instance at application startup and reuse it for all evaluations. Implement a loader for dynamic decisions. The loader pattern centralizes decision loading logic and enables caching at the source. Use async evaluation for concurrent workloads. When evaluating multiple decisions, use async_evaluate with asyncio.gather for better throughput.