Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - 2025-06-24

### Added
- Loop flow support for iterative workflow patterns with self-routing capabilities
- New cookbook directory with production-ready examples and real-world solutions
- Enhanced feature configuration system with better granularity and modularity
- Async workflow support as optional feature for better compile-time optimization
- New convenience feature combinations: `minimal`, `basic`, `standard`, and `full`

### Changed
- **BREAKING**: Restructured project organization - moved complex examples to `cookbook/`
- **BREAKING**: Made async support optional with dedicated `async` feature flag
- **BREAKING**: Changed default features to `basic` (storage-memory only) for better UX
- Enhanced storage backend feature organization with individual feature flags
- Improved example structure with separate simple examples and production cookbook
- Better separation between sync and async APIs for reduced compilation overhead

### Fixed
- Improved compile-time dependency management with optional features
- Better feature gate organization for optional dependencies
- Reduced binary size for applications not using all features

## [0.4.0] - 2025-06-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Add to your `Cargo.toml`:

```toml
[dependencies]
cosmoflow = { version = "0.4.0", features = ["storage-memory"] }
cosmoflow = { version = "0.5.0", features = ["storage-memory"] }
```

Create your first workflow:
Expand Down
2 changes: 1 addition & 1 deletion cosmoflow/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cosmoflow"
version = "0.4.0"
version = "0.5.0"
edition = "2024"
authors = ["echozyr2001 <echo.zyr.2001@gmail.com>"]
description = "CosmoFlow - A type-safe workflow engine for Rust, inspired by PocketFlow and optimized for LLM applications"
Expand Down
2 changes: 1 addition & 1 deletion cosmoflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Add to your `Cargo.toml`:

```toml
[dependencies]
cosmoflow = { version = "0.4.0", features = ["storage-memory"] }
cosmoflow = { version = "0.5.0", features = ["storage-memory"] }
```

Create your first workflow:
Expand Down
73 changes: 39 additions & 34 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,89 @@ This guide covers CosmoFlow's feature system and configuration options.
### Minimal Configuration
```toml
[dependencies]
cosmoflow = { version = "0.4.0", default-features = false, features = ["minimal"] }
cosmoflow = { version = "0.5.0", default-features = false, features = ["minimal"] }
```
- **Features**: None (truly minimal)
- **Features**: Core engine only
- **Storage**: No storage backends enabled
- **Built-ins**: No built-in nodes
- **Async**: No async support
- **Use case**: When you want to implement everything yourself or use as a core library

### Basic Configuration
### Basic Configuration (Default)
```toml
[dependencies]
cosmoflow = { version = "0.4.0", default-features = false, features = ["basic"] }
cosmoflow = { version = "0.5.0", features = ["basic"] }
# or simply
cosmoflow = "0.5.0"
```
- **Features**: Memory storage only
- **Storage**: In-memory storage backend
- **Built-ins**: No built-in nodes
- **Use case**: Simple workflows that don't need persistence
- **Async**: No async support
- **Use case**: Simple workflows that don't need persistence or async

### Standard Configuration (Recommended)
```toml
[dependencies]
cosmoflow = { version = "0.4.0", default-features = false, features = ["standard"] }
cosmoflow = { version = "0.5.0", features = ["standard"] }
```
- **Features**: Memory storage + built-in nodes
- **Features**: Memory storage + async support
- **Storage**: In-memory storage backend
- **Built-ins**: All built-in node types
- **Use case**: Most applications that need quick setup and common functionality
- **Async**: Full async/await support
- **Use case**: Most applications that need async workflows

### Full Configuration
```toml
[dependencies]
cosmoflow = { version = "0.4.0", default-features = false, features = ["full"] }
cosmoflow = { version = "0.5.0", features = ["full"] }
```
- **Features**: All storage backends + built-in nodes
- **Storage**: Memory and file-based storage
- **Built-ins**: All built-in node types
- **Features**: All storage backends + async support
- **Storage**: Memory, file, and Redis storage
- **Async**: Full async/await support
- **Use case**: Applications that need all features and flexibility

## 🧩 Individual Features

### Storage Backend Features
- `storage-memory`: Enable in-memory storage (fast, non-persistent)
- `storage-file`: Enable file-based storage (persistent, disk-based)
- `storage-redis`: Enable Redis storage (distributed, persistent)
- `storage-full`: Enable all storage backends

### Functionality Features
- `builtin`: Enable built-in node types (SetValue, GetValue, Delay, Log)
- `builtin-full`: Enable all built-in functionality
### Core Features
- `async`: Enable async/await support with tokio integration

## 🛠️ Custom Combinations

You can mix and match features for your specific needs:

```toml
# Memory storage + built-ins
cosmoflow = { version = "0.4.0", default-features = false, features = ["storage-memory", "builtin"] }
# Memory storage + async
cosmoflow = { version = "0.5.0", default-features = false, features = ["storage-memory", "async"] }

# File storage only
cosmoflow = { version = "0.4.0", default-features = false, features = ["storage-file"] }
cosmoflow = { version = "0.5.0", default-features = false, features = ["storage-file"] }

# Both storage backends, no built-ins
cosmoflow = { version = "0.4.0", default-features = false, features = ["storage-full"] }
# All storage backends with async
cosmoflow = { version = "0.5.0", default-features = false, features = ["storage-full", "async"] }

# Redis storage with async
cosmoflow = { version = "0.5.0", default-features = false, features = ["storage-redis", "async"] }
```

## 📊 Feature Comparison

| Configuration | Binary Size | Compile Time | Memory Storage | File Storage | Built-ins | Best For |
|---------------|-------------|--------------|----------------|--------------|-----------|----------|
| minimal | Smallest | Fastest | ❌ | ❌ | ❌ | Core library usage |
| basic | Small | Fast | ✅ | ❌ | ❌ | Simple workflows |
| standard | Medium | Medium | ✅ | ❌ | | Most applications |
| full | Largest | Slowest | ✅ | ✅ | ✅ | Feature-rich apps |
| Configuration | Binary Size | Compile Time | Memory Storage | File Storage | Redis Storage | Async | Best For |
|---------------|-------------|--------------|----------------|--------------|---------------|-------|----------|
| minimal | Smallest | Fastest | ❌ | ❌ | ❌ | ❌ | Core library usage |
| basic | Small | Fast | ✅ | ❌ | ❌ | ❌ | Simple sync workflows |
| standard | Medium | Medium | ✅ | ❌ | | ✅ | Most applications |
| full | Largest | Slowest | ✅ | ✅ | ✅ | ✅ | Feature-rich apps |

## 🚀 Migration Guide

If you're currently using CosmoFlow with all features, you can:
If you're upgrading from an earlier version:

1. **Keep current behavior**: Use `features = ["full"]`
2. **Optimize for your use case**: Choose `standard` for most apps
3. **Minimize dependencies**: Use `basic` or `minimal` for specific needs
1. **Keep current behavior**: Use `features = ["full"]` for maximum compatibility
2. **Optimize for your use case**: Choose `standard` for most async apps
3. **Minimize dependencies**: Use `basic` for simple sync workflows or `minimal` for core usage

The default configuration is now empty (`default = []`), so you must explicitly choose features when adding CosmoFlow as a dependency.
The default configuration is now `basic` (memory storage only), which provides a good balance of functionality and minimal dependencies.
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add CosmoFlow to your `Cargo.toml`:

```toml
[dependencies]
cosmoflow = { version = "0.4.0", features = ["standard"] }
cosmoflow = { version = "0.5.0", features = ["standard"] }
tokio = { version = "1.0", features = ["full"] }
```

Expand Down