update doc
This commit is contained in:
parent
03b69421b8
commit
b818a0a4a5
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
title: "Design Pattern"
|
title: "Design Pattern"
|
||||||
nav_order: 4
|
nav_order: 3
|
||||||
has_children: true
|
has_children: true
|
||||||
---
|
---
|
||||||
|
|
@ -8,48 +8,31 @@ nav_order: 1
|
||||||
|
|
||||||
A [100-line](https://github.com/the-pocket/PocketFlow/blob/main/pocketflow/__init__.py) minimalist LLM framework for *Agents, Task Decomposition, RAG, etc*.
|
A [100-line](https://github.com/the-pocket/PocketFlow/blob/main/pocketflow/__init__.py) minimalist LLM framework for *Agents, Task Decomposition, RAG, etc*.
|
||||||
|
|
||||||
We model the LLM workflow as a **Graph + Shared Store**:
|
|
||||||
- **Nodes** handle simple (LLM) tasks.
|
|
||||||
- Nodes connect through **Actions** (labeled edges) for *Agents*.
|
|
||||||
- **Flows** orchestrate a directed graph of Nodes for *Task Decomposition*.
|
|
||||||
- Nodes within Flows communicate through a **Shared Store**.
|
|
||||||
- A Flow can be used as a Node (for **Nesting**).
|
|
||||||
- **Batch** Nodes/Flows for data-intensive tasks.
|
|
||||||
- **Async** Nodes/Flows allow waits for asynchronous tasks.
|
|
||||||
|
|
||||||
<div align="center">
|
- **Expressive**: Everything you love from larger frameworks—([Multi-](./design_pattern/multi_agent.html))[Agents](./design_pattern/agent.html), [Workflow](./design_pattern/workflow.html), [RAG](./design_pattern/rag.html), and more.
|
||||||
<img src="https://github.com/the-pocket/PocketFlow/raw/main/assets/meme.jpg?raw=true" width="400"/>
|
|
||||||
</div>
|
- **Lightweight**: Just the core graph abstraction in 100 lines. Zero bloat, zero dependencies, zero vendor lock-in.
|
||||||
|
|
||||||
|
- **Principled**: Built with modularity and clear separation of concerns at its heart.
|
||||||
|
|
||||||
|
- **AI-Friendly**: Intuitive enough for AI agents to assist humans in building complex LLM applications.
|
||||||
|
|
||||||
> If you are an AI assistant reading this document, please read all the non-optional and non-advanced parts. If you are helping a human build an LLM app, please carefully review the [Development Playbook](./guide.md).
|
|
||||||
{: .warning }
|
|
||||||
|
|
||||||
## Core Abstraction
|
## Core Abstraction
|
||||||
|
|
||||||
- [Node](./core_abstraction/node.md)
|
We model the LLM workflow as a **Graph + Shared Store**:
|
||||||
- [Flow](./core_abstraction/flow.md)
|
|
||||||
- [Communication](./core_abstraction/communication.md)
|
|
||||||
- [Batch](./core_abstraction/batch.md)
|
|
||||||
- [(Advanced) Async](./core_abstraction/async.md)
|
|
||||||
- [(Advanced) Parallel](./core_abstraction/parallel.md)
|
|
||||||
|
|
||||||
## Utility Function
|
|
||||||
|
|
||||||
- [LLM Wrapper](./utility_function/llm.md)
|
|
||||||
- [Tool](./utility_function/tool.md)
|
|
||||||
- [(Optional) Viz and Debug](./utility_function/viz.md)
|
|
||||||
- [(Optional) Web Search](./utility_function/websearch.md)
|
|
||||||
- [(Optional) Chunking](./utility_function/chunking.md)
|
|
||||||
- [(Optional) Embedding](./utility_function/embedding.md)
|
|
||||||
- [(Optional) Vector Databases](./utility_function/vector.md)
|
|
||||||
- [(Optional) Text-to-Speech](./utility_function/text_to_speech.md)
|
|
||||||
|
|
||||||
> We do not provide built-in utility functions. Example implementations are provided as reference.
|
|
||||||
{: .warning }
|
|
||||||
|
|
||||||
|
- [Node](./core_abstraction/node.md) handles simple (LLM) tasks.
|
||||||
|
- [Flow](./core_abstraction/flow.md) connects nodes through **Actions** (labeled edges).
|
||||||
|
- [Shared Store](./core_abstraction/communication.md) enables communication between nodes within flows.
|
||||||
|
- [Batch](./core_abstraction/batch.md) nodes/flows allow for data-intensive tasks.
|
||||||
|
- [(Advanced) Async](./core_abstraction/async.md) nodes/flows allow waiting for asynchronous tasks.
|
||||||
|
- [(Advanced) Parallel](./core_abstraction/parallel.md) nodes/flows handle I/O-bound tasks.
|
||||||
|
|
||||||
## Design Pattern
|
## Design Pattern
|
||||||
|
|
||||||
|
From there, it’s easy to implement popular design patterns:
|
||||||
|
|
||||||
- [Structured Output](./design_pattern/structure.md)
|
- [Structured Output](./design_pattern/structure.md)
|
||||||
- [Workflow](./design_pattern/workflow.md)
|
- [Workflow](./design_pattern/workflow.md)
|
||||||
- [Map Reduce](./design_pattern/mapreduce.md)
|
- [Map Reduce](./design_pattern/mapreduce.md)
|
||||||
|
|
@ -59,4 +42,18 @@ We model the LLM workflow as a **Graph + Shared Store**:
|
||||||
- [(Advanced) Multi-Agents](./design_pattern/multi_agent.md)
|
- [(Advanced) Multi-Agents](./design_pattern/multi_agent.md)
|
||||||
- Evaluation
|
- Evaluation
|
||||||
|
|
||||||
|
## Utility Function
|
||||||
|
|
||||||
|
We do not provide built-in utility functions in codes.
|
||||||
|
But we provide example implementations in docs:
|
||||||
|
|
||||||
|
- [LLM Wrapper](./utility_function/llm.md)
|
||||||
|
- [Tool](./utility_function/tool.md)
|
||||||
|
- [(Optional) Viz and Debug](./utility_function/viz.md)
|
||||||
|
- [(Optional) Web Search](./utility_function/websearch.md)
|
||||||
|
- [(Optional) Chunking](./utility_function/chunking.md)
|
||||||
|
- [(Optional) Embedding](./utility_function/embedding.md)
|
||||||
|
- [(Optional) Vector Databases](./utility_function/vector.md)
|
||||||
|
- [(Optional) Text-to-Speech](./utility_function/text_to_speech.md)
|
||||||
|
|
||||||
## [Develop your LLM Apps](./guide.md)
|
## [Develop your LLM Apps](./guide.md)
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
title: "Utility Function"
|
title: "Utility Function"
|
||||||
nav_order: 3
|
nav_order: 4
|
||||||
has_children: true
|
has_children: true
|
||||||
---
|
---
|
||||||
Loading…
Reference in New Issue