From 894fe3334b1637ea39f423c16e5e49768d35e39c Mon Sep 17 00:00:00 2001 From: zachary62 Date: Sat, 10 May 2025 10:51:29 -0400 Subject: [PATCH] update the header --- README.md | 2 +- .../01_shared_state___shared__dictionary__.md | 7 ++++ ...node___basenode____node____asyncnode___.md | 7 ++++ docs/PocketFlow/03_actions___transitions_.md | 7 ++++ .../04_flow___flow____asyncflow___.md | 7 ++++ ..._processing___asyncnode____asyncflow___.md | 7 ++++ ..._batchflow____asyncparallelbatchnode___.md | 7 ++++ ...gent_to_agent__communication_framework_.md | 7 ++++ docs/PocketFlow/index.md | 32 ++++++------------- docs/index.md | 1 + 10 files changed, 61 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index d98dfbb..00fbb45 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket - [OpenManus](https://the-pocket.github.io/PocketFlow-Tutorial-Codebase-Knowledge/OpenManus) - Build AI agents with digital brains that think, learn, and use tools just like humans do! -- [PocketFlow](https://the-pocket.github.io/PocketFlow-Tutorial-Codebase-Knowledge/PocketFlow) - Pocket Flow: 100-line LLM framework. Let Agents build Agents! +- [PocketFlow](https://the-pocket.github.io/PocketFlow-Tutorial-Codebase-Knowledge/PocketFlow) - 100-line LLM framework. Let Agents build Agents! - [Pydantic Core](https://the-pocket.github.io/PocketFlow-Tutorial-Codebase-Knowledge/Pydantic%20Core) - Validate data at rocket speed with just Python type hints! diff --git a/docs/PocketFlow/01_shared_state___shared__dictionary__.md b/docs/PocketFlow/01_shared_state___shared__dictionary__.md index e0d0fda..45f2653 100644 --- a/docs/PocketFlow/01_shared_state___shared__dictionary__.md +++ b/docs/PocketFlow/01_shared_state___shared__dictionary__.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "Shared State (Shared Dictionary)" +parent: "PocketFlow" +nav_order: 1 +--- + # Chapter 1: Shared State (`shared` dictionary) Welcome to your first step into the world of PocketFlow! Building powerful AI applications often involves breaking down complex tasks into smaller, manageable steps. But how do these steps communicate with each other? How does one part of your AI know what another part has done or figured out? That's where the **`shared` dictionary** comes into play. diff --git a/docs/PocketFlow/02_node___basenode____node____asyncnode___.md b/docs/PocketFlow/02_node___basenode____node____asyncnode___.md index fdeb16a..9eac76e 100644 --- a/docs/PocketFlow/02_node___basenode____node____asyncnode___.md +++ b/docs/PocketFlow/02_node___basenode____node____asyncnode___.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "Node (BaseNode, Node, AsyncNode)" +parent: "PocketFlow" +nav_order: 2 +--- + # Chapter 2: Node (`BaseNode`, `Node`, `AsyncNode`) In [Chapter 1: Shared State (`shared` dictionary)](01_shared_state___shared__dictionary__.md), we learned how different parts of a PocketFlow workflow can communicate using the `shared` dictionary. Now, let's meet the actual "workers" that perform the tasks and use this shared information: **Nodes**. diff --git a/docs/PocketFlow/03_actions___transitions_.md b/docs/PocketFlow/03_actions___transitions_.md index b68d4f3..151837f 100644 --- a/docs/PocketFlow/03_actions___transitions_.md +++ b/docs/PocketFlow/03_actions___transitions_.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "Actions / Transitions" +parent: "PocketFlow" +nav_order: 3 +--- + # Chapter 3: Actions / Transitions In [Chapter 2: Node (`BaseNode`, `Node`, `AsyncNode`)](02_node___basenode____node____asyncnode___.md), we learned that Nodes are the individual workers in our PocketFlow application, each performing a specific task. We also touched upon the `post` method of a Node, mentioning that it can return an "action" string. Now, it's time to explore exactly what these "actions" are and how they create "transitions," guiding the workflow dynamically. diff --git a/docs/PocketFlow/04_flow___flow____asyncflow___.md b/docs/PocketFlow/04_flow___flow____asyncflow___.md index adb0996..2e56ab4 100644 --- a/docs/PocketFlow/04_flow___flow____asyncflow___.md +++ b/docs/PocketFlow/04_flow___flow____asyncflow___.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "Flow (Flow, AsyncFlow)" +parent: "PocketFlow" +nav_order: 4 +--- + # Chapter 4: Flow (`Flow`, `AsyncFlow`) In [Chapter 3: Actions / Transitions](03_actions___transitions__.md), we saw how individual [Nodes (`BaseNode`, `Node`, `AsyncNode`)](02_node___basenode____node____asyncnode__.md) can decide what should happen next by returning "action" strings, and how these actions lead to "transitions" between Nodes. But what actually manages this sequence? What's the conductor of this orchestra of Nodes? That's where **Flows** come in! diff --git a/docs/PocketFlow/05_asynchronous_processing___asyncnode____asyncflow___.md b/docs/PocketFlow/05_asynchronous_processing___asyncnode____asyncflow___.md index 52fb491..480ea9c 100644 --- a/docs/PocketFlow/05_asynchronous_processing___asyncnode____asyncflow___.md +++ b/docs/PocketFlow/05_asynchronous_processing___asyncnode____asyncflow___.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "Asynchronous Processing (AsyncNode, AsyncFlow)" +parent: "PocketFlow" +nav_order: 5 +--- + # Chapter 5: Asynchronous Processing (`AsyncNode`, `AsyncFlow`) In [Chapter 4: Flow (`Flow`, `AsyncFlow`)](04_flow___flow____asyncflow__.md), we learned how `Flow` and `AsyncFlow` orchestrate sequences of [Nodes (`BaseNode`, `Node`, `AsyncNode`)](02_node___basenode____node____asyncnode__.md) to create complete applications. Now, we're going to zoom in on a powerful feature that `AsyncFlow` enables: **Asynchronous Processing**. This is key to building AI applications that feel responsive and can handle tasks that involve waiting, like calling web APIs or interacting with users. diff --git a/docs/PocketFlow/06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md b/docs/PocketFlow/06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md index d8896b5..0ad6023 100644 --- a/docs/PocketFlow/06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md +++ b/docs/PocketFlow/06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "Batch Processing (BatchNode, BatchFlow, AsyncParallelBatchNode)" +parent: "PocketFlow" +nav_order: 6 +--- + # Chapter 6: Batch Processing (`BatchNode`, `BatchFlow`, `AsyncParallelBatchNode`) In [Chapter 5: Asynchronous Processing (`AsyncNode`, `AsyncFlow`)](05_asynchronous_processing___asyncnode____asyncflow___.md), we explored how `AsyncNode` and `AsyncFlow` help build responsive applications that can handle waiting for tasks like API calls. Now, what if you need to perform a similar operation on *many* different items? For example, imagine you have a document, and you want to translate it into ten different languages. Doing this one by one, or even coordinating many asynchronous calls manually, can be cumbersome. PocketFlow provides specialized tools for exactly this: **Batch Processing**. diff --git a/docs/PocketFlow/07_a2a__agent_to_agent__communication_framework_.md b/docs/PocketFlow/07_a2a__agent_to_agent__communication_framework_.md index e754c14..1ea4dff 100644 --- a/docs/PocketFlow/07_a2a__agent_to_agent__communication_framework_.md +++ b/docs/PocketFlow/07_a2a__agent_to_agent__communication_framework_.md @@ -1,3 +1,10 @@ +--- +layout: default +title: "A2A (Agent-to-Agent) Communication Framework" +parent: "PocketFlow" +nav_order: 7 +--- + # Chapter 7: A2A (Agent-to-Agent) Communication Framework Welcome to the final chapter of our PocketFlow journey! In [Chapter 6: Batch Processing (`BatchNode`, `BatchFlow`, `AsyncParallelBatchNode`)](06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md), we saw how to process multiple items or run workflows repeatedly. Now, we'll explore how to make your PocketFlow agents available to the wider world, allowing them to communicate with other systems or agents using a standard "language." diff --git a/docs/PocketFlow/index.md b/docs/PocketFlow/index.md index ac67248..64292f8 100644 --- a/docs/PocketFlow/index.md +++ b/docs/PocketFlow/index.md @@ -1,15 +1,21 @@ +--- +layout: default +title: "PocketFlow" +nav_order: 10 +has_children: true +--- + # Tutorial: PocketFlow -PocketFlow is a *Python framework* for building modular workflows and AI agents. +> This tutorial is AI-generated! To learn more, check out [AI Codebase Knowledge Builder](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge) + +PocketFlow[View Repo](https://github.com/The-Pocket/PocketFlow) is a *Python framework* for building modular workflows and AI agents. It allows you to define complex processes by connecting individual **Nodes**, which represent *atomic tasks* like calling an LLM or searching the web. A **Flow** then *orchestrates* these Nodes, guiding the execution sequence based on **Actions** (string identifiers) returned by each Node. Data is passed between Nodes and managed throughout the workflow execution via a **Shared State** (a Python dictionary). 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. 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. - -**Source Repository:** [https://github.com/The-Pocket/PocketFlow](https://github.com/The-Pocket/PocketFlow) - ```mermaid flowchart TD A0["Node (`BaseNode`, `Node`, `AsyncNode`) @@ -38,24 +44,6 @@ flowchart TD A6 -- "Initializes Shared State" --> A2 ``` -## Chapters - -1. [Shared State (`shared` dictionary) -](01_shared_state___shared__dictionary__.md) -2. [Node (`BaseNode`, `Node`, `AsyncNode`) -](02_node___basenode____node____asyncnode___.md) -3. [Actions / Transitions -](03_actions___transitions_.md) -4. [Flow (`Flow`, `AsyncFlow`) -](04_flow___flow____asyncflow___.md) -5. [Asynchronous Processing (`AsyncNode`, `AsyncFlow`) -](05_asynchronous_processing___asyncnode____asyncflow___.md) -6. [Batch Processing (`BatchNode`, `BatchFlow`, `AsyncParallelBatchNode`) -](06_batch_processing___batchnode____batchflow____asyncparallelbatchnode___.md) -7. [A2A (Agent-to-Agent) Communication Framework -](07_a2a__agent_to_agent__communication_framework_.md) - - --- Generated by [AI Codebase Knowledge Builder](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge) \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index fece772..41e488f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,6 +36,7 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket - [MCP Python SDK](./MCP Python SDK/index.md) - Build powerful apps that communicate through an elegant protocol without sweating the details! - [NumPy Core](./NumPy Core/index.md) - Master the engine behind data science that makes Python as fast as C! - [OpenManus](./OpenManus/index.md) - Build AI agents with digital brains that think, learn, and use tools just like humans do! +- [PocketFlow](./PocketFlow/index.md) - 100-line LLM framework. Let Agents build Agents! - [Pydantic Core](./Pydantic Core/index.md) - Validate data at rocket speed with just Python type hints! - [Requests](./Requests/index.md) - Talk to the internet in Python with code so simple it feels like cheating! - [SmolaAgents](./SmolaAgents/index.md) - Build tiny AI agents that punch way above their weight class!