Skip to content

bkataru/PocketFlow-Zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Zig implementation of PocketFlow, a minimalist flow-based programming framework.

Overview

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

Features

  • exploits comptime well?
  • multithreaded?
  • uses state machines?

Quick Start

0. Setup

1. Define Custom States

2. Implement Nodes

3. Build Flows

4. Batch Processing

Advanced Usage

Custom State Management

Define your own states to control flow transitions:

Complex Flow Construction

Build complex workflows with multiple nodes and state transitions:

Examples

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

Development

Building the Project

Running Tests

Contributing

Contributions are welcome! We're particularly looking for volunteers to:

  1. 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.
  1. Add more comprehensive test coverage, including edge cases and error handling.
  2. Improve documentation and provide more complex examples (e.g., LLM integration stubs).
  3. Refine the API for better Zig idiomatic usage if applicable.

Please feel free to submit pull requests or open issues for discussion.

License

MIT License