Skip to content

Commit 4585ac5

Browse files
committed
docs: add docs for distributed agents sample
1 parent f4ebe71 commit 4585ac5

File tree

10 files changed

+2887
-5
lines changed

10 files changed

+2887
-5
lines changed

docs/interrupt_models.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ UiPath platform and the Langchain coded agents.
99

1010
### 1. InvokeProcess
1111

12-
The `InvokeProcess` model is utilized to invoke a process within UiPath cloud platform. Upon completion of the invoked process, the current agent will automatically resume execution.
12+
The `InvokeProcess` model is utilized to invoke a process within the UiPath cloud platform.
13+
This process can be of various types, including API workflows, Agents or RPA automation.
14+
Upon completion of the invoked process, the current agent will automatically resume execution.
1315

1416
#### Attributes:
1517
- **name** (str): The name of the process to invoke.
@@ -20,6 +22,8 @@ The `InvokeProcess` model is utilized to invoke a process within UiPath cloud pl
2022
process_output = interrupt(InvokeProcess(name="MyProcess", input_arguments={"arg1": "value1"}))
2123
```
2224

25+
For a practical implementation of the `InvokeProcess` model, refer to the sample usage in the [planner.py](../../samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/planner.py#L184) file. This example demonstrates how to invoke a process with dynamic input arguments, showcasing the integration of the interrupt functionality within a multi-agent system or a system where an agent integrates with RPA processes and API workflows.
26+
2327
---
2428

2529
### 2. WaitJob
45.5 KB
Loading
82.9 KB
Loading
38.9 KB
Loading
84.8 KB
Loading
41.4 KB
Loading
80.1 KB
Loading

samples/multi-agent-planner-researcher-coder-distributed/README.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Each agent functions as an independent entrypoint and can be deployed as a separ
1212

1313
The system uses LangGraph to create a directed graph of agents that can communicate and pass state to each other.
1414

15-
### Planner Graph
15+
### Planner Agent Graph
1616
```mermaid
1717
---
1818
config:
@@ -34,7 +34,7 @@ graph TD;
3434
classDef last fill:#bfb6fc
3535
```
3636

37-
### Researcher Agent
37+
### Researcher Agent Graph
3838
```mermaid
3939
---
4040
config:
@@ -61,7 +61,7 @@ graph TD;
6161
classDef last fill:#bfb6fc
6262
```
6363

64-
### Coder Agent
64+
### Coder Agent Graph
6565
```mermaid
6666
---
6767
config:
@@ -146,6 +146,91 @@ uipath run coder '{"messages":[{"content":"Let me help you state the Pythagorean
146146
6. Coder agent calculates c = √(2² + 3²) = √(4 + 9) = √13 ≈ 3.606
147147
7. Planner combines the responses and returns the final answer to the user
148148

149+
## Steps to Execute Project on UiPath Cloud Platform
150+
151+
1. **Clone the Repository**
152+
```bash
153+
git clone https://github.com/UiPath/uipath-langchain-python.git
154+
```
155+
156+
2. **Navigate to the Sample Directory**
157+
- **For Windows:**
158+
```bash
159+
cd .\uipath-langchain-python\samples\multi-agent-planner-researcher-coder-distributed
160+
```
161+
162+
- **For Unix-like systems (Linux, macOS):**
163+
```bash
164+
cd ./uipath-langchain-python/samples/multi-agent-planner-researcher-coder-distributed
165+
```
166+
167+
3. **Create and Activate a Virtual Python Environment**
168+
```bash
169+
pip install uv
170+
uv venv -p 3.11 .venv
171+
.venv\Scripts\activate # For Windows
172+
source .venv/bin/activate # For Unix-like systems
173+
uv sync
174+
```
175+
176+
4. **Authenticate to UiPath Cloud Platform**
177+
```bash
178+
uipath auth
179+
```
180+
> **Note:** After successful authentication in the browser, you will be prompted to select the tenant where you wish to publish the package containing the agents.
181+
```
182+
Received log data
183+
Received authentication information
184+
Available tenants:
185+
0: cosmin
186+
1: DefaultTenant
187+
2: Demo
188+
3: lucian
189+
4: Solutions
190+
5: SolutionsTest
191+
6: Test
192+
7: TestRoles
193+
Select tenant: 2
194+
```
195+
196+
5. **Package and Publish Agents**
197+
```bash
198+
uipath pack
199+
uipath publish
200+
```
201+
> **Note:** At this step, you will be required to select the feed where the package should be published:
202+
```
203+
Select feed type:
204+
0: Tenant package feed
205+
1: Personal workspace
206+
Select feed: 0
207+
```
208+
209+
6. **Create 3 Agent Processes in Orchestrator**
210+
- **Planner Agent**
211+
![planner-agent-package-overview](../../docs/sample_images/planner-agent-package-overview.png)
212+
![planner-agent-process-configuration](../../docs/sample_images/planner-agent-process-configuration.png)
213+
214+
- **Researcher Agent**
215+
![researcher-agent-package-overview](../../docs/sample_images/researcher-agent-package-overview.png)
216+
![researcher-agent-process-configuration](../../docs/sample_images/researcher-agent-process-configuration.png)
217+
218+
- **Coder Agent**
219+
![coder-agent-package-overview](../../docs/sample_images/coder-agent-package-overview.png)
220+
![coder-agent-process-configuration](../../docs/sample_images/coder-agent-process-configuration.png)
221+
222+
> **Note:** Please ensure that, for coder and researcher entry points, the process display names are: *coder-agent* and *researcher-agent*.
223+
224+
7. **Run the Planner Agent with Any Question as Input Argument**
225+
> **Tip:** For an action plan of ~5 steps, you can try feeding the following input to the agent:
226+
```
227+
Could you find a Python solution for the N-Queens puzzle for N=8? Please also analyze why this solution works,
228+
considering the key programming concepts that it uses.
229+
Then, revise the solution to handle a dynamic value of N, where N is any positive integer.
230+
After that, research on the time and space complexity of this new solution.
231+
Lastly, demonstrate this revised Python solution with N=10.
232+
```
233+
149234
## Implementation Details
150235

151236
The system is implemented using:

samples/multi-agent-planner-researcher-coder-distributed/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "multi-agents-distributed"
33
version = "0.0.1"
44
description = "Supervisor agent that coordinates between a researcher and a coder"
55
authors = [
6-
{ name = "Radu Mocanu" }
6+
{ name = "Radu Mocanu", email = "radu.mocanu@uipath.com" }
77
]
88
requires-python = ">=3.10"
99
dependencies = [

0 commit comments

Comments
 (0)