| 
1 | 1 | # Agents  | 
2 | 2 | 
 
  | 
3 |  | -## Descirption  | 
4 |  | - | 
5 |  | -This file depicts a general framework for building **multi-agent AI systems**.  | 
6 |  | - | 
7 |  | -Main description of such system is writen using **YAML**.  | 
8 |  | - | 
9 |  | -The system consists of **nodes** and **edges**.  | 
10 |  | - | 
11 |  | -Currently, we assume that the only information type passed between nodes is **single text** and nodes are connected as a direct acyclic graph (DAC). Node can take input from other nodes, but it can generate only 1 output.  | 
12 |  | - | 
13 |  | -In future, we can support other types like *list of strings*. *booleans*; we can deliver input to several nodes *in parallel*, etc.  | 
14 |  | - | 
15 | 3 | ## YAML description structure  | 
16 | 4 | 
 
  | 
17 | 5 | Please refer to `examples/` directory.  | 
18 | 6 | 
 
  | 
19 | 7 | ## Paths  | 
20 | 8 | 
 
  | 
21 |  | -In several places in YAML file there are values of **paths**. Paths resemble paths in a real file system, parts are delimited with `::`. Absolute path starts from `::`.\  | 
22 |  | - | 
23 |  | -Examples of paths:  | 
24 |  | - | 
25 |  | -- `output`: relative path to single element `output`.  | 
26 |  | -- `event::stdout`: relative path to `stdout` through `event`.  | 
27 |  | -- `::trigger::stdin`: absolute path to `stdin` through `trigger`.  | 
28 |  | - | 
29 |  | -Places where paths are used:  | 
30 |  | - | 
31 |  | -- In nodes - `type`: type of the node. Different types of nodes live in different dirs.  | 
32 |  | -- In nodes - `next`: to which node pass the execution. Nodes live in `::nodes` dir.  | 
33 |  | -- In nodes - `agent_reuse`: reuse conversation history of previous agent.  | 
34 |  | -- In templates - `{{...}}`: take output from the node. Output of nodes live in `::output` dir.  | 
35 |  | - | 
36 |  | -All paths (expect absolute) **are subject to absolutization**. This means that every relative path will be implicitly turned out to absolute path. In case of any ambiguities an error will be thrown. Absolutization also depends on the context: in `next` fields paths are absolutized to `::nodes` dir, in templates - to `::output` and so on.  | 
 | 9 | +- Used in node types, templates.  | 
 | 10 | +- Parts are delimited with `::`.  | 
 | 11 | +- Absolute path has a leading `::`.  | 
 | 12 | +- All paths (expect absolute) **are subject to absolutization**. Absolutization also depends on the context: in `next` fields paths are absolutized to `::nodes` dir, in templates - to `::output` and so on.  | 
37 | 13 | 
 
  | 
38 | 14 | ## Execution  | 
39 | 15 | 
 
  | 
40 |  | -YAML file contains section about `nodes:`. You can think of them as statements in a programming language. Next statement is encoded in `next:` field. Output of the nodes are stored in `::output` dir.  | 
 | 16 | +- YAML file contains section about `nodes:`.  | 
 | 17 | +- Next node is encoded in `next:` field.   | 
 | 18 | +- Output of the nodes are stored in `::output` dir.  | 
41 | 19 | 
 
  | 
42 |  | -## Scenarios referencing  | 
43 |  | - | 
44 |  | -There are two builtin scenarios:  | 
 | 20 | +## Builtin scenarios  | 
45 | 21 | 
 
  | 
46 | 22 | - `::scenario::entry`  | 
47 | 23 | - `::scenario::termination`  | 
48 | 24 | 
 
  | 
49 |  | -## Detailed description of nodes  | 
50 |  | - | 
51 |  | -Each node has an `id` property (its name) and a `type` property.  | 
52 |  | - | 
53 |  | -`type` specifies node type in a special format - `category::type`. Number of levels separated by dots may vary.  | 
54 |  | - | 
55 |  | -### Input nodes  | 
56 |  | - | 
57 |  | -These nodes read an input from external environment and pass it to the graph.  | 
58 |  | - | 
59 |  | -Current **types**:  | 
60 |  | - | 
61 |  | -- `trigger::stdin`: stdin input node.  | 
62 |  | -  Parameters: `prompt`.  | 
63 |  | -- `trigger::file`: file input node.   | 
64 |  | -  Parameters `path`.  | 
65 |  | - | 
66 |  | -### Processing nodes  | 
67 |  | - | 
68 |  | -Those nodes perform intermediate processing of information. It can be either a mechanical one using an external program, or a real LLM agent.  | 
69 |  | - | 
70 |  | -- `script`: script node.  | 
71 |  | -  Parameters: `cmd`.  | 
72 |  | -- `agent::completion`: agent completion node.  | 
73 |  | -  Parameters: `provider`, `model`, `system_message`, `user_message`, `agent_reuse`.  | 
74 |  | -  `system_message` and `user_message` are templates. Variables available to those templates are **node names**.  | 
75 |  | - | 
76 |  | -### Output nodes  | 
77 |  | - | 
78 |  | -These nodes take an input from other node and present it to the external world.  | 
79 |  | - | 
80 |  | -Current **types**:  | 
81 |  | - | 
82 |  | -- `event::stdout`: stdout output node.  | 
83 |  | -  Parameters: `output`.  | 
84 |  | -- `event::file`: file output node.  | 
85 |  | -  Parameters: `path`.  | 
86 |  | - | 
87 |  | -### Utility nodes  | 
88 |  | - | 
89 |  | -These nodes are special nodes for various purposes.  | 
 | 25 | +## Node types  | 
90 | 26 | 
 
  | 
91 |  | -Current **types**:  | 
 | 27 | +- Input nodes:  | 
 | 28 | +  - `trigger::stdin`  | 
 | 29 | +  - `trigger::file`  | 
 | 30 | +- Processing nodes:  | 
 | 31 | +  - `script`  | 
 | 32 | +  - `agent::completion`  | 
 | 33 | +- Output nodes:  | 
 | 34 | +  - `event::stdout`  | 
 | 35 | +  - `event::file`  | 
92 | 36 | 
 
  | 
93 |  | -- `scenario::termination`: scenario termination node.  | 
 | 37 | +Refer to examples in `examples/` to see fields of nodes.  | 
0 commit comments