Update agent.md
This commit is contained in:
parent
61b8edbb78
commit
2905c6f5a8
|
|
@ -9,12 +9,6 @@ nav_order: 6
|
||||||
|
|
||||||
Agent is a powerful design pattern in which nodes can take dynamic actions based on the context.
|
Agent is a powerful design pattern in which nodes can take dynamic actions based on the context.
|
||||||
|
|
||||||
The core of building **high-performance** and **reliable** agents boils down to:
|
|
||||||
|
|
||||||
1. **Input Context:** Provide *relevant, minimal context.* For example, rather than including an entire chat history, retrieve the most relevant via [RAG](./rag.md). Even with larger context windows, LLMs still fall victim to ["lost in the middle"](https://arxiv.org/abs/2307.03172), overlooking mid-prompt content.
|
|
||||||
|
|
||||||
2. **Action Space:** Provide *a well-structured and unambiguous* set of actions—avoiding overlap like separate `read_databases` or `read_csvs`. Instead, import CSVs into the database and then use one parameterized (e.g., table name) or programmable action (e.g., via SQL) to query data.
|
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="https://github.com/the-pocket/PocketFlow/raw/main/assets/agent.png?raw=true" width="350"/>
|
<img src="https://github.com/the-pocket/PocketFlow/raw/main/assets/agent.png?raw=true" width="350"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -49,6 +43,13 @@ parameters:
|
||||||
```"""
|
```"""
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The core of building **high-performance** and **reliable** agents boils down to:
|
||||||
|
|
||||||
|
1. **Input Context:** Provide *relevant, minimal context.* For example, rather than including an entire chat history, retrieve the most relevant via [RAG](./rag.md). Even with larger context windows, LLMs still fall victim to ["lost in the middle"](https://arxiv.org/abs/2307.03172), overlooking mid-prompt content.
|
||||||
|
|
||||||
|
2. **Action Space:** Provide *a well-structured and unambiguous* set of actions—avoiding overlap like separate `read_databases` or `read_csvs`. Instead, import CSVs into the database and then use one parameterized (e.g., table name) or programmable action (e.g., via SQL) to query data.
|
||||||
|
|
||||||
|
|
||||||
### Example: Search Agent
|
### Example: Search Agent
|
||||||
|
|
||||||
This agent:
|
This agent:
|
||||||
|
|
@ -130,4 +131,4 @@ search - "decide" >> decide # Loop back
|
||||||
|
|
||||||
flow = Flow(start=decide)
|
flow = Flow(start=decide)
|
||||||
flow.run({"query": "Who won the Nobel Prize in Physics 2024?"})
|
flow.run({"query": "Who won the Nobel Prize in Physics 2024?"})
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue