@aigne/example-workflow-orchestrator 1.14.0-beta → 1.14.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.local.example +2 -2
- package/CHANGELOG.md +2876 -0
- package/README.md +41 -0
- package/agents/objective.md +9 -0
- package/agents/orchestrator.yaml +44 -0
- package/agents/planner.md +47 -0
- package/package.json +4 -9
- package/run-example.png +0 -0
package/README.md
CHANGED
|
@@ -66,6 +66,47 @@ export GEMINI_API_KEY=YOUR_GEMINI_API_KEY # Or use Gemini
|
|
|
66
66
|
npx -y @aigne/example-workflow-orchestrator
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
### Connect to an AI Model
|
|
70
|
+
|
|
71
|
+
As an example, running `npx -y @aigne/example-workflow-orchestrator --chat` requires an AI model. If this is your first run, you need to connect one.
|
|
72
|
+
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
- Connect via the official AIGNE Hub
|
|
76
|
+
|
|
77
|
+
Choose the first option and your browser will open the official AIGNE Hub page. Follow the prompts to complete the connection. If you're a new user, the system automatically grants 400,000 tokens for you to use.
|
|
78
|
+
|
|
79
|
+

|
|
80
|
+
|
|
81
|
+
- Connect via a self-hosted AIGNE Hub
|
|
82
|
+
|
|
83
|
+
Choose the second option, enter the URL of your self-hosted AIGNE Hub, and follow the prompts to complete the connection. If you need to set up a self-hosted AIGNE Hub, visit the Blocklet Store to install and deploy it: [Blocklet Store](https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ?utm_source=www.arcblock.io&utm_medium=blog_link&utm_campaign=default&utm_content=store.blocklet.dev#:~:text=%F0%9F%9A%80%20Get%20Started%20in%20Minutes).
|
|
84
|
+
|
|
85
|
+

|
|
86
|
+
|
|
87
|
+
- Connect via a third-party model provider
|
|
88
|
+
|
|
89
|
+
Using OpenAI as an example, you can configure the provider's API key via environment variables. After configuration, run the example again:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export OPENAI_API_KEY="" # Set your OpenAI API key here
|
|
93
|
+
```
|
|
94
|
+
For more details on third-party model configuration (e.g., OpenAI, DeepSeek, Google Gemini), see [.env.local.example](./.env.local.example).
|
|
95
|
+
|
|
96
|
+
After configuration, run the example again.
|
|
97
|
+
|
|
98
|
+
### Debugging
|
|
99
|
+
|
|
100
|
+
The `aigne observe` command starts a local web server to monitor and analyze agent execution data. It provides a user-friendly interface to inspect traces, view detailed call information, and understand your agent’s behavior during runtime. This tool is essential for debugging, performance tuning, and gaining insight into how your agent processes information and interacts with tools and models.
|
|
101
|
+
|
|
102
|
+
Start the observation server.
|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+
View a list of recent executions.
|
|
107
|
+
|
|
108
|
+

|
|
109
|
+
|
|
69
110
|
## Installation
|
|
70
111
|
|
|
71
112
|
### Clone the Repository
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Explore the project directory `/modules/workspace/` structure and generate a project summary report in Markdown format.
|
|
2
|
+
|
|
3
|
+
- Ignore directories like node_modules, .git, dist, build, etc.
|
|
4
|
+
- Provide accurate information based on actual file contents
|
|
5
|
+
|
|
6
|
+
{% if message %}
|
|
7
|
+
## User Instructions
|
|
8
|
+
{{ message }}
|
|
9
|
+
{% endif %}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type: "@aigne/agent-library/orchestrator"
|
|
2
|
+
name: orchestrator
|
|
3
|
+
input_schema:
|
|
4
|
+
type: object
|
|
5
|
+
properties:
|
|
6
|
+
message:
|
|
7
|
+
type: string
|
|
8
|
+
description: (Optional) User's instruction
|
|
9
|
+
required: []
|
|
10
|
+
|
|
11
|
+
# Specify the objective for the orchestrator agent.
|
|
12
|
+
objective:
|
|
13
|
+
url: objective.md
|
|
14
|
+
|
|
15
|
+
# Custom planner agent can be defined here.
|
|
16
|
+
planner:
|
|
17
|
+
type: ai
|
|
18
|
+
instructions:
|
|
19
|
+
url: planner.md
|
|
20
|
+
|
|
21
|
+
# Custom worker agent can be defined here.
|
|
22
|
+
# worker:
|
|
23
|
+
# type: ai
|
|
24
|
+
# instructions:
|
|
25
|
+
# url: path/to/worker_instructions.md
|
|
26
|
+
|
|
27
|
+
# Custom completer agent can be defined here.
|
|
28
|
+
# completer:
|
|
29
|
+
# type: ai
|
|
30
|
+
# instructions:
|
|
31
|
+
# url: path/to/completer_instructions.md
|
|
32
|
+
|
|
33
|
+
state_management:
|
|
34
|
+
max_iterations: 5
|
|
35
|
+
max_tokens: 100000 # Optional: limit the total tokens used for state management
|
|
36
|
+
keep_recent: 20 # Optional: keep only the most recent N states in memory
|
|
37
|
+
|
|
38
|
+
afs:
|
|
39
|
+
modules:
|
|
40
|
+
- module: local-fs
|
|
41
|
+
options:
|
|
42
|
+
name: workspace
|
|
43
|
+
localPath: .
|
|
44
|
+
description: Workspace directory for the orchestrator agent.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## Responsibility
|
|
2
|
+
|
|
3
|
+
Your responsibility is to decide the next task based on the current execution state.
|
|
4
|
+
|
|
5
|
+
## Objective for Task Planning
|
|
6
|
+
{{ objective }}
|
|
7
|
+
|
|
8
|
+
## Current Execution State
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
{{ executionState | yaml.stringify }}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Exploration Strategy
|
|
15
|
+
|
|
16
|
+
You need to autonomously decide what to explore based on the objective and current execution state. Think about:
|
|
17
|
+
|
|
18
|
+
- What information is needed to complete the objective?
|
|
19
|
+
- Where can this information be obtained from? (directory structure, config files, source code, documentation, etc.)
|
|
20
|
+
- What information has already been collected? What is still missing?
|
|
21
|
+
- Is deeper exploration needed, or is it ready to summarize?
|
|
22
|
+
|
|
23
|
+
## Planning Decisions
|
|
24
|
+
|
|
25
|
+
Based on the current execution state and objective, flexibly decide the next task:
|
|
26
|
+
|
|
27
|
+
- **Exploration Phase**: Plan exploration tasks specifying which directories to list or which files to read
|
|
28
|
+
- **Summary Phase**: When sufficient information is collected, plan to generate the final summary/report
|
|
29
|
+
- **Completion Phase**: When all necessary tasks are completed, set finished: true
|
|
30
|
+
|
|
31
|
+
## Important Principles
|
|
32
|
+
|
|
33
|
+
- **Plan only one specific task at a time**, don't try to complete the entire exploration process
|
|
34
|
+
- **Don't execute tasks**, only decide what should be done next
|
|
35
|
+
- **Trust the iterative process**, you will be called again after each task completes to decide the next step
|
|
36
|
+
- **Avoid duplicate work**, review the execution history to understand what has been completed
|
|
37
|
+
- Explore at most 5 tasks to prevent infinite loops
|
|
38
|
+
|
|
39
|
+
## Output Format
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
nextTask: "[task description]" # e.g., "List all files and directories in module X" or "Read xxx file and summarize its content"
|
|
43
|
+
finished: false # or true
|
|
44
|
+
reasoning: "[brief explanation]" # optional, explain why this task is needed
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Note: Task descriptions should be **goal-oriented**, not specifying concrete operations. Let the worker autonomously decide how to complete the task based on the task objective.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-orchestrator",
|
|
3
|
-
"version": "1.14.0-beta",
|
|
3
|
+
"version": "1.14.0-beta.2",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework to build a orchestrator workflow",
|
|
5
5
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
6
6
|
"homepage": "https://github.com/AIGNE-io/aigne-framework/tree/main/examples/workflow-orchestrator",
|
|
@@ -10,18 +10,13 @@
|
|
|
10
10
|
"url": "git+https://github.com/AIGNE-io/aigne-framework"
|
|
11
11
|
},
|
|
12
12
|
"bin": "aigne.yaml",
|
|
13
|
-
"files": [
|
|
14
|
-
".env.local.example",
|
|
15
|
-
"*.ts",
|
|
16
|
-
"README.md"
|
|
17
|
-
],
|
|
18
13
|
"dependencies": {
|
|
19
|
-
"@aigne/agent-library": "^1.23.0-beta",
|
|
20
|
-
"@aigne/cli": "^1.58.0-beta"
|
|
14
|
+
"@aigne/agent-library": "^1.23.0-beta.1",
|
|
15
|
+
"@aigne/cli": "^1.58.0-beta.1"
|
|
21
16
|
},
|
|
22
17
|
"devDependencies": {
|
|
23
18
|
"@types/bun": "^1.2.22",
|
|
24
|
-
"@aigne/test-utils": "^0.5.68-beta"
|
|
19
|
+
"@aigne/test-utils": "^0.5.68-beta.1"
|
|
25
20
|
},
|
|
26
21
|
"scripts": {
|
|
27
22
|
"start": "aigne run ."
|
package/run-example.png
ADDED
|
Binary file
|