A workflow engine for AI agents
Project description
Stella Workflow
A powerful, flexible workflow engine for AI agents and asynchronous task processing.
Features
- Agent-Based Architecture: Define independent agents that communicate through messages
- Asynchronous Processing: Built on Python's asyncio for efficient concurrent execution
- State Management: Track and persist agent state across executions
- Memory Storage: Store and retrieve data between agent invocations
- Conditional Execution: Control agent execution based on dynamic conditions
- Loop Processing: Process collections of items with built-in loop functionality
- Redis Integration: Use Redis as a reliable message broker and storage backend
- Extensible Design: Easily add new brokers, agents, and functionality
Installation
pip install stella-workflow
Quick Start
import asyncio
from stella_workflow.workflow import stella_agent
from stella_workflow.brokers import RedisBroker
# Create a broker
broker = RedisBroker({
"host": "localhost",
"port": 6379
})
# Define agents
@stella_agent(name="data_producer", broker=broker, topic="example_workflow")
async def data_producer():
return {"message": "Hello from producer!"}
@stella_agent(name="data_consumer", broker=broker, topic="example_workflow", depends_on=["data_producer"])
async def data_consumer(message):
producer_data = message["dependency_messages"]["data_producer"]["data"]
print(f"Received: {producer_data['message']}")
return {"status": "processed"}
async def main():
# Connect to broker
await broker.connect()
try:
# Start the workflow
await stella_agent.start_workflow()
# Wait for processing to complete
await asyncio.sleep(2)
finally:
# Clean up
await stella_agent.stop_workflow()
await broker.close()
if __name__ == "__main__":
asyncio.run(main())
Examples
The package includes several examples demonstrating different use cases:
- Document Processor: Process different document types through a workflow
- Bulk Email Processor: Send personalized emails to a list of users
- State Memory Pipeline: Collect, process, and analyze data with state tracking
- Message Flow: Create complex message flows between multiple agents
- Multiple Producers: Handle messages from multiple producer agents
Check the examples/ directory for complete implementations.
Documentation
For detailed documentation, see:
Additional documentation is coming soon!
Development
Setup
# Clone the repository
git clone https://github.com/yourusername/stella-workflow.git
cd stella-workflow
# Install dependencies
pip install poetry
poetry install
Testing
# Run all tests
poetry run pytest
# Run specific tests
poetry run pytest tests/test_workflow.py
Linting
# Run linting
poetry run ruff check .
# Run formatting
poetry run ruff format .
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stella_workflow-0.1.0.tar.gz.
File metadata
- Download URL: stella_workflow-0.1.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e395cea1a42aa853bb4dc27840e3be5794be55c0049c5b4e9b27542d17ec88ae
|
|
| MD5 |
d313493a67590f87d29942c4054bdfb7
|
|
| BLAKE2b-256 |
a6781cc74555342aaff9bdc27a006175d21e124c6eedb85ce4e08b859cca2bbe
|
Provenance
The following attestation bundles were made for stella_workflow-0.1.0.tar.gz:
Publisher:
python-publish.yml on stellaheystella/stella-workflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_workflow-0.1.0.tar.gz -
Subject digest:
e395cea1a42aa853bb4dc27840e3be5794be55c0049c5b4e9b27542d17ec88ae - Sigstore transparency entry: 179692769
- Sigstore integration time:
-
Permalink:
stellaheystella/stella-workflow@54d4475938c85301f876d8ce1659d884494c3e26 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/stellaheystella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@54d4475938c85301f876d8ce1659d884494c3e26 -
Trigger Event:
release
-
Statement type:
File details
Details for the file stella_workflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stella_workflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0086a3c449f1abdd15d7ea62307ff22177712d9c8de92b3c11a232446ba0085e
|
|
| MD5 |
cc1b90c65e432f9ecbb5de8045f83518
|
|
| BLAKE2b-256 |
813914f7374b90bc0fad34974ad4544014d80315192896bd08e521d1c719e0cc
|
Provenance
The following attestation bundles were made for stella_workflow-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on stellaheystella/stella-workflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_workflow-0.1.0-py3-none-any.whl -
Subject digest:
0086a3c449f1abdd15d7ea62307ff22177712d9c8de92b3c11a232446ba0085e - Sigstore transparency entry: 179692770
- Sigstore integration time:
-
Permalink:
stellaheystella/stella-workflow@54d4475938c85301f876d8ce1659d884494c3e26 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/stellaheystella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@54d4475938c85301f876d8ce1659d884494c3e26 -
Trigger Event:
release
-
Statement type: