diff --git a/docs/async.md b/docs/core_abstraction/async.md similarity index 100% rename from docs/async.md rename to docs/core_abstraction/async.md diff --git a/docs/batch.md b/docs/core_abstraction/batch.md similarity index 100% rename from docs/batch.md rename to docs/core_abstraction/batch.md diff --git a/docs/communication.md b/docs/core_abstraction/communication.md similarity index 97% rename from docs/communication.md rename to docs/core_abstraction/communication.md index d7a1a89..c15af32 100644 --- a/docs/communication.md +++ b/docs/core_abstraction/communication.md @@ -81,7 +81,7 @@ Here: ## 2. Params **Params** let you store *per-Node* or *per-Flow* config that doesn't need to live in the shared store. They are: -- **Immutable** during a Node’s run cycle (i.e., they don’t change mid-`prep->exec->post`). +- **Immutable** during a Node's run cycle (i.e., they don't change mid-`prep->exec->post`). - **Set** via `set_params()`. - **Cleared** and updated each time a parent Flow calls it. diff --git a/docs/core_abstraction.md b/docs/core_abstraction/core_abstraction.md similarity index 100% rename from docs/core_abstraction.md rename to docs/core_abstraction/core_abstraction.md diff --git a/docs/flow.md b/docs/core_abstraction/flow.md similarity index 100% rename from docs/flow.md rename to docs/core_abstraction/flow.md diff --git a/docs/node.md b/docs/core_abstraction/node.md similarity index 100% rename from docs/node.md rename to docs/core_abstraction/node.md diff --git a/docs/parallel.md b/docs/core_abstraction/parallel.md similarity index 100% rename from docs/parallel.md rename to docs/core_abstraction/parallel.md diff --git a/docs/agent.md b/docs/design_pattern/agent.md similarity index 94% rename from docs/agent.md rename to docs/design_pattern/agent.md index 3631fd1..ee699cb 100644 --- a/docs/agent.md +++ b/docs/design_pattern/agent.md @@ -8,11 +8,11 @@ nav_order: 6 # Agent Agent is a powerful design pattern, where node can take dynamic actions based on the context it receives. -To express an agent, create a Node (the agent) with [branching](./flow.md) to other nodes (Actions). +To express an agent, create a Node (the agent) with [branching](../core_abstraction/flow.md) to other nodes (Actions). > The core of build **performant** and **reliable** agents boils down to: > -> 1. **Context Management:** Provide *clear, relevant context* so agents can understand the problem.E.g., Rather than dumping an entire chat history or entire files, use a [Workflow](./decomp.md) that filters out and includes only the most relevant information. +> 1. **Context Management:** Provide *clear, relevant context* so agents can understand the problem.E.g., Rather than dumping an entire chat history or entire files, use a [Workflow](./workflow.md) that filters out and includes only the most relevant information. > > 2. **Action Space:** Define *a well-structured, unambiguous, and easy-to-use* set of actions. For instance, avoid creating overlapping actions like `read_databases` and `read_csvs`. Instead, unify data sources (e.g., move CSVs into a database) and design a single action. The action can be parameterized (e.g., string for search) or programmable (e.g., SQL queries). {: .best-practice } diff --git a/docs/mapreduce.md b/docs/design_pattern/mapreduce.md similarity index 89% rename from docs/mapreduce.md rename to docs/design_pattern/mapreduce.md index 7f1dd1f..7b161ce 100644 --- a/docs/mapreduce.md +++ b/docs/design_pattern/mapreduce.md @@ -12,7 +12,7 @@ MapReduce is a design pattern suitable when you have either: - Large output data (e.g., multiple forms to fill) and there is a logical way to break the task into smaller, ideally independent parts. -You first break down the task using [BatchNode](./batch.md) in the map phase, followed by aggregation in the reduce phase. +You first break down the task using [BatchNode](../core_abstraction/batch.md) in the map phase, followed by aggregation in the reduce phase. ### Example: Document Summarization diff --git a/docs/memory.md b/docs/design_pattern/memory.md similarity index 100% rename from docs/memory.md rename to docs/design_pattern/memory.md diff --git a/docs/multi_agent.md b/docs/design_pattern/multi_agent.md similarity index 100% rename from docs/multi_agent.md rename to docs/design_pattern/multi_agent.md diff --git a/docs/paradigm.md b/docs/design_pattern/paradigm.md similarity index 100% rename from docs/paradigm.md rename to docs/design_pattern/paradigm.md diff --git a/docs/rag.md b/docs/design_pattern/rag.md similarity index 93% rename from docs/rag.md rename to docs/design_pattern/rag.md index 6aeb028..0bb2497 100644 --- a/docs/rag.md +++ b/docs/design_pattern/rag.md @@ -8,7 +8,7 @@ nav_order: 4 # RAG (Retrieval Augmented Generation) For certain LLM tasks like answering questions, providing context is essential. -Use [vector search](./tool.md) to find relevant context for LLM responses. +Use [vector search](../utility_function/tool.md) to find relevant context for LLM responses. ### Example: Question Answering diff --git a/docs/structure.md b/docs/design_pattern/structure.md similarity index 100% rename from docs/structure.md rename to docs/design_pattern/structure.md diff --git a/docs/decomp.md b/docs/design_pattern/workflow.md similarity index 91% rename from docs/decomp.md rename to docs/design_pattern/workflow.md index cdd84a0..d7bee94 100644 --- a/docs/decomp.md +++ b/docs/design_pattern/workflow.md @@ -7,7 +7,7 @@ nav_order: 2 # Workflow -Many real-world tasks are too complex for one LLM call. The solution is to decompose them into a [chain](./flow.md) of multiple Nodes. +Many real-world tasks are too complex for one LLM call. The solution is to decompose them into a [chain](../core_abstraction/flow.md) of multiple Nodes. > - You don't want to make each task **too coarse**, because it may be *too complex for one LLM call*. @@ -46,3 +46,5 @@ writing_flow = Flow(start=outline) shared = {"topic": "AI Safety"} writing_flow.run(shared) ``` + +For *dynamic cases*, consider using [Agents](./agent.md). diff --git a/docs/index.md b/docs/index.md index e975fe8..9a900ad 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,18 +30,18 @@ We model the LLM workflow as a **Nested Directed Graph**: ## Core Abstraction -- [Node](./node.md) -- [Flow](./flow.md) -- [Communication](./communication.md) -- [Batch](./batch.md) -- [(Advanced) Async](./async.md) -- [(Advanced) Parallel](./parallel.md) +- [Node](./core_abstraction/node.md) +- [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](./llm.md) -- [Tool](./tool.md) -- [Viz and Debug](./viz.md) +- [LLM Wrapper](./utility_function/llm.md) +- [Tool](./utility_function/tool.md) +- [Viz and Debug](./utility_function/viz.md) - Chunking > We do not provide built-in utility functions. Example implementations are provided as reference. @@ -50,13 +50,13 @@ We model the LLM workflow as a **Nested Directed Graph**: ## Design Pattern -- [Structured Output](./structure.md) -- [Workflow](./decomp.md) -- [Map Reduce](./mapreduce.md) -- [RAG](./rag.md) -- [Chat Memory](./memory.md) -- [Agent](./agent.md) -- [(Advanced) Multi-Agents](./multi_agent.md) +- [Structured Output](./design_pattern/structure.md) +- [Workflow](./design_pattern/workflow.md) +- [Map Reduce](./design_pattern/mapreduce.md) +- [RAG](./design_pattern/rag.md) +- [Chat Memory](./design_pattern/memory.md) +- [Agent](./design_pattern/agent.md) +- [(Advanced) Multi-Agents](./design_pattern/multi_agent.md) - Evaluation -## [Build your LLM App](./guide.md) \ No newline at end of file +## [Develop your LLM Apps](./guide.md) \ No newline at end of file diff --git a/docs/preparation.md b/docs/utility_function/index.md similarity index 100% rename from docs/preparation.md rename to docs/utility_function/index.md diff --git a/docs/llm.md b/docs/utility_function/llm.md similarity index 100% rename from docs/llm.md rename to docs/utility_function/llm.md diff --git a/docs/tool.md b/docs/utility_function/tool.md similarity index 100% rename from docs/tool.md rename to docs/utility_function/tool.md diff --git a/docs/viz.md b/docs/utility_function/viz.md similarity index 100% rename from docs/viz.md rename to docs/utility_function/viz.md