Skip to content

Commit e7bdeaa

Browse files
authored
Document Joiner. (#2183)
Fixes #2112.
1 parent 3a82a4c commit e7bdeaa

File tree

4 files changed

+287
-3
lines changed

4 files changed

+287
-3
lines changed

packages/website/src/docs/kits/agents/index.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,25 @@ When placed into the flow of work, Human shows the intermediate output and asks
232232

233233
## Joiner
234234

235-
TO DO:
235+
While not powered by an LLM or representing a real person, Joiner is an essential part of any team of workers. Depending on how it is configured, Joiner acts a helper that, respectively, joins or merges conversation contexts.
236236

237-
- Describe how joiner works
237+
{{ "/breadboard/static/boards/joiner-example.bgl.json" | board }}
238238

239-
- Create a graph that joins contexts.
239+
When the flow of work splits across multiple workers, we can rely on Joiner to bring it all together.
240+
241+
When first added to the board, Joiner has no incoming ports: we have to explicitly inform it about all the context we'd like to join. To do so, use the "ad hoc" wiring technique in Breadboard. Drag a wire from each outgoing port we want to be joined into the center of the Joiner, then release. A small dialog box will pop up asking to name the port. Give it an informative name (can only contain lowercase alphanumeric characters, dashes, or numbers) and the wire will appear.
242+
243+
{{ "/breadboard/static/boards/new-joiner-port.bgl.json" | board }}
244+
245+
Joiner has one configuration option, a checkbox on whether or not to merge the last items of all incoming context into one.
246+
247+
![Joiner Merge option](/breadboard/static/images/agent-kit/joiner-merge.png)
248+
249+
When that checkbox is not checked, joiner will take all of the incoming conversation contexts and just string them together into one mega conversation context.
250+
251+
When the checkbox is checked, it will only take the last item of each conversation context and turn them into a new conversation context that contains only one item, merging them as parts of that item.
252+
253+
In either case, the order of items (or contexts) is determined by the alphabetical sort of the incoming ports for the Joiner.
254+
255+
> [!TIP]
256+
> It's a good practice to name ports in a way that makes the order evident. Like in the example above, the ports are named "a-picture", "b-voice", and "c-text" to ensure that the picture goes first, followed by voice and then text.
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
{
2+
"title": "Card Maker",
3+
"version": "0.0.1",
4+
"metadata": {
5+
"comments": [
6+
{
7+
"id": "comment-571ff92f",
8+
"text": "Writes contents of \na game card",
9+
"metadata": {
10+
"visual": {
11+
"x": -129,
12+
"y": 70,
13+
"collapsed": false
14+
}
15+
}
16+
},
17+
{
18+
"id": "comment-6ce6abeb",
19+
"text": "Uses the contents to craft a prompt and create picture.",
20+
"metadata": {
21+
"visual": {
22+
"x": -77,
23+
"y": -175,
24+
"collapsed": false
25+
}
26+
}
27+
},
28+
{
29+
"id": "comment-b99d3821",
30+
"text": "Narrates the text \nof the card",
31+
"metadata": {
32+
"visual": {
33+
"x": 50,
34+
"y": -29,
35+
"collapsed": false
36+
}
37+
}
38+
},
39+
{
40+
"id": "comment-6907d9cd",
41+
"text": "Joins picture, voice, and text into one card.",
42+
"metadata": {
43+
"visual": {
44+
"x": 268,
45+
"y": 113,
46+
"collapsed": false
47+
}
48+
}
49+
}
50+
]
51+
},
52+
"edges": [
53+
{
54+
"from": "input",
55+
"to": "specialist-42832612",
56+
"out": "context",
57+
"in": "in"
58+
},
59+
{
60+
"from": "specialist-42832612",
61+
"to": "specialist-5b7a9d43",
62+
"out": "out",
63+
"in": "in"
64+
},
65+
{
66+
"from": "specialist-42832612",
67+
"to": "specialist-6a61c0b5",
68+
"out": "out",
69+
"in": "in"
70+
},
71+
{
72+
"from": "specialist-42832612",
73+
"to": "joiner-22b013c9",
74+
"out": "out",
75+
"in": "c-text"
76+
},
77+
{
78+
"from": "specialist-5b7a9d43",
79+
"to": "joiner-22b013c9",
80+
"out": "out",
81+
"in": "a-picture"
82+
},
83+
{
84+
"from": "specialist-6a61c0b5",
85+
"to": "joiner-22b013c9",
86+
"out": "out",
87+
"in": "b-voice"
88+
},
89+
{
90+
"from": "joiner-22b013c9",
91+
"to": "output",
92+
"out": "context",
93+
"in": "context"
94+
}
95+
],
96+
"nodes": [
97+
{
98+
"type": "input",
99+
"id": "input",
100+
"configuration": {
101+
"schema": {
102+
"properties": {
103+
"context": {
104+
"type": "array",
105+
"title": "Context",
106+
"examples": [],
107+
"items": {
108+
"type": "object",
109+
"behavior": ["llm-content"]
110+
},
111+
"default": "[{\"role\":\"user\",\"parts\":[{\"text\":\"\"}]}]"
112+
}
113+
},
114+
"type": "object",
115+
"required": []
116+
}
117+
},
118+
"metadata": {
119+
"visual": {
120+
"x": -213,
121+
"y": -127,
122+
"collapsed": false
123+
}
124+
}
125+
},
126+
{
127+
"type": "output",
128+
"id": "output",
129+
"configuration": {
130+
"schema": {
131+
"properties": {
132+
"context": {
133+
"type": "array",
134+
"title": "Context",
135+
"examples": [],
136+
"items": {
137+
"type": "object",
138+
"behavior": ["llm-content"]
139+
},
140+
"default": "null"
141+
}
142+
},
143+
"type": "object",
144+
"required": []
145+
}
146+
},
147+
"metadata": {
148+
"visual": {
149+
"x": 369,
150+
"y": -148,
151+
"collapsed": false
152+
}
153+
}
154+
},
155+
{
156+
"id": "specialist-42832612",
157+
"type": "specialist",
158+
"metadata": {
159+
"visual": {
160+
"x": -167,
161+
"y": 126,
162+
"collapsed": false
163+
},
164+
"title": "Writer",
165+
"logLevel": "debug"
166+
}
167+
},
168+
{
169+
"id": "specialist-5b7a9d43",
170+
"type": "specialist",
171+
"metadata": {
172+
"visual": {
173+
"x": 45,
174+
"y": -123,
175+
"collapsed": false
176+
},
177+
"title": "Illustrator",
178+
"logLevel": "debug"
179+
}
180+
},
181+
{
182+
"id": "specialist-6a61c0b5",
183+
"type": "specialist",
184+
"metadata": {
185+
"visual": {
186+
"x": 90,
187+
"y": 24,
188+
"collapsed": false
189+
},
190+
"title": "Narrator",
191+
"logLevel": "debug"
192+
}
193+
},
194+
{
195+
"id": "joiner-22b013c9",
196+
"type": "joiner",
197+
"metadata": {
198+
"visual": {
199+
"x": 354,
200+
"y": 2,
201+
"collapsed": false
202+
},
203+
"title": "Card Maker",
204+
"logLevel": "debug"
205+
}
206+
}
207+
]
208+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"title": "Wiring Joiner ",
3+
"version": "0.0.1",
4+
"metadata": {
5+
"comments": [
6+
{
7+
"id": "comment-f59dbc67",
8+
"text": "Drag a wire from \"Context Out\" ...",
9+
"metadata": {
10+
"visual": {
11+
"x": 19,
12+
"y": -46,
13+
"collapsed": false
14+
}
15+
}
16+
},
17+
{
18+
"id": "comment-58b1c17b",
19+
"text": "... to the center of Joiner and then let go. You will then be asked to name the incoming port for this wire.",
20+
"metadata": {
21+
"visual": {
22+
"x": 259,
23+
"y": -1,
24+
"collapsed": false
25+
}
26+
}
27+
}
28+
]
29+
},
30+
"edges": [],
31+
"nodes": [
32+
{
33+
"id": "specialist-be4d952e",
34+
"type": "specialist",
35+
"metadata": {
36+
"visual": {
37+
"x": -39,
38+
"y": 8,
39+
"collapsed": false
40+
},
41+
"title": "Illustrator",
42+
"logLevel": "debug"
43+
}
44+
},
45+
{
46+
"id": "joiner-ddb55d72",
47+
"type": "joiner",
48+
"metadata": {
49+
"visual": {
50+
"x": 221,
51+
"y": -71,
52+
"collapsed": false
53+
},
54+
"title": "Card Maker",
55+
"logLevel": "debug"
56+
}
57+
}
58+
]
59+
}
6.4 KB
Loading

0 commit comments

Comments
 (0)