A Zig implementation of PocketFlow, a minimalist flow-based programming framework.
mention how it's a port of the original python package, but how it differs from that having been written/ported to zig due to zig's unique capabilities
- exploits comptime well?
- multithreaded?
- uses state machines?
Define your own states to control flow transitions:
Build complex workflows with multiple nodes and state transitions:
Check out the examples/ directory for more detailed examples:
- basic.zig: Basic flow with custom states
- text2sql: Text-to-SQL workflow example
- pocketflow-zig-rag: Retrieval-Augmented Generation (RAG) workflow example
Contributions are welcome! We're particularly looking for volunteers to:
- Implement asynchronous operation support
- e.g., using one or more of state machines, event loops (io_uring, libuv, etc.), and the new Zig 0.15.1 Async I/O interface.
- Add more comprehensive test coverage, including edge cases and error handling.
- Improve documentation and provide more complex examples (e.g., LLM integration stubs).
- Refine the API for better Zig idiomatic usage if applicable.
Please feel free to submit pull requests or open issues for discussion.