|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: "PocketFlow" |
| 4 | +nav_order: 10 |
| 5 | +has_children: true |
| 6 | +--- |
| 7 | + |
1 | 8 | # Tutorial: PocketFlow |
2 | 9 |
|
3 | | -PocketFlow is a *Python framework* for building modular workflows and AI agents. |
| 10 | +> This tutorial is AI-generated! To learn more, check out [AI Codebase Knowledge Builder](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge) |
| 11 | +
|
| 12 | +PocketFlow<sup>[View Repo](https://github.com/The-Pocket/PocketFlow)</sup> is a *Python framework* for building modular workflows and AI agents. |
4 | 13 | It allows you to define complex processes by connecting individual **Nodes**, which represent *atomic tasks* like calling an LLM or searching the web. |
5 | 14 | A **Flow** then *orchestrates* these Nodes, guiding the execution sequence based on **Actions** (string identifiers) returned by each Node. |
6 | 15 | Data is passed between Nodes and managed throughout the workflow execution via a **Shared State** (a Python dictionary). |
7 | 16 | PocketFlow also offers advanced features like **Batch Processing** for efficiently handling collections of items, and **Asynchronous Processing** for non-blocking operations crucial for I/O-bound tasks. |
8 | 17 | Additionally, it demonstrates an **A2A (Agent-to-Agent) Communication Framework** to wrap PocketFlow agents, enabling them to communicate with other systems using a standardized JSON-RPC protocol. |
9 | 18 |
|
10 | | - |
11 | | -**Source Repository:** [https://github.com/The-Pocket/PocketFlow](https://github.com/The-Pocket/PocketFlow) |
12 | | - |
13 | 19 | ```mermaid |
14 | 20 | flowchart TD |
15 | 21 | A0["Node (`BaseNode`, `Node`, `AsyncNode`) |
@@ -38,24 +44,6 @@ flowchart TD |
38 | 44 | A6 -- "Initializes Shared State" --> A2 |
39 | 45 | ``` |
40 | 46 |
|
41 | | -## Chapters |
42 | | - |
43 | | -1. [Shared State (`shared` dictionary) |
44 | | -](01_shared_state___shared__dictionary__.md) |
45 | | -2. [Node (`BaseNode`, `Node`, `AsyncNode`) |
46 | | -](02_node___basenode____node____asyncnode___.md) |
47 | | -3. [Actions / Transitions |
48 | | -](03_actions___transitions_.md) |
49 | | -4. [Flow (`Flow`, `AsyncFlow`) |
50 | | -](04_flow___flow____asyncflow___.md) |
51 | | -5. [Asynchronous Processing (`AsyncNode`, `AsyncFlow`) |
52 | | -](05_asynchronous_processing___asyncnode____asyncflow___.md) |
53 | | -6. [Batch Processing (`BatchNode`, `BatchFlow`, `AsyncParallelBatchNode`) |
54 | | -](06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md) |
55 | | -7. [A2A (Agent-to-Agent) Communication Framework |
56 | | -](07_a2a__agent_to_agent__communication_framework_.md) |
57 | | - |
58 | | - |
59 | 47 | --- |
60 | 48 |
|
61 | 49 | Generated by [AI Codebase Knowledge Builder](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge) |
0 commit comments