- Einleitung
- Erste Schritte mit UiPath Agents
- Erste Schritte mit UiPath Agents mit LangGraph
- Erstellen eines Low-Code-Agents in Studio Web
- Hinzufügen von Tools zu Ihrem UiPath Agent
- Getting Started with UiPath Maestro Flow
Verwenden Sie Ihren Codierungs-Agent und Ihre UiPath-Fähigkeiten, um einen LangGraph-Agent lokal zu erstellen, zu konfigurieren und auszuführen.
Wenn die CLI installiert ist, die Fähigkeiten vorhanden sind und Ihr Konto authentifiziert wurde, können Sie ein Gerüst für das lokale Projekt erstellen.
Schritt 4 – Einrichten des lokalen Projekts
Erstellen Sie einen neuen Ordner für Ihr Agent-Projekt und öffnen Sie es in VS Code (Datei → Ordner öffnen). Alle Befehle ab diesem Schritt werden vom Stamm des Projektordners aus ausgeführt.
Erstellen Sie die Python-Umgebung
Erstellen Sie eine virtuelle Umgebung, die an eine unterstützte Python-Version angeheftet ist, und aktivieren Sie sie:
mkdir QuestIntake
cd QuestIntake
uv venv --python 3.13
source .venv/bin/activate
mkdir QuestIntake
cd QuestIntake
uv venv --python 3.13
source .venv/bin/activate
Windows: Verwenden Sie .venv\Scripts\activate anstelle von source .venv/bin/activate.
Python-Version: uv lädt Python automatisch herunter und verwaltet es, wenn sich 3.13 nicht auf Ihrem PATH befindet. Unterstützte Versionen sind 3.11, 3.12 und 3.13.
Installieren Sie die LangGraph-Integration
LangGraph ist ein Python-Framework zum Erstellen von statusbezogenen LLM-Agents als Diagramme von Knoten und Kanten. uipath-langchain ist die UiPath-Integrationsebene, die einen LangGraph-Agent für die Bereitstellung und Auswertung auf der UiPath-Plattform verpackt.
Installieren Sie das UiPath LangGraph-Paket in der aktiven Anwendung. Dadurch wird der Framework auch für die Projektgerüst im nächsten Schritt verfügbar:
uv pip install uipath-langchain
uv pip install uipath-langchain
Registrieren Sie Python mit der UiPath CLI
Teilen Sie der CLI mit, in welcher sich die UiPath-kompatible ausführbare Python-Datei befindet:
uip codedagent setup --force
uip codedagent setup --force
Sie sollten "Result": "Success" sehen. Dieser Schritt ist einmal pro Maschine (und nach env-Änderungen) erforderlich, bevor uip codedagent -Befehle verwendet werden.
Gerüst für das Projekt
Erstellen Sie die UiPath-Projektstruktur. uip codedagent new erkennt das installierte Framework und generiert die richtigen Gerüst-Dateien:
uip codedagent new QuestIntake
uip codedagent new QuestIntake
Dadurch werden pyproject.toml, main.py, langgraph.json, uipath.json, entry-points.json, bindings.json und Codierungsagent-Kontextdateien (AGENTS.md, CLAUDE.md, .agent/) erstellt. main.py ist ein Platzhalter; Ihr Codierungsagent ersetzt ihn in Schritt 5.
Fügen Sie die lokale Entwicklungsserver-Abhängigkeit hinzu und synchronisieren Sie die Sperrdatei:
uv add uipath-dev --dev
uv sync
uv add uipath-dev --dev
uv sync
Einstiegspunkte generieren
Führen Sie init aus, um die Einstiegspunktschemas aus dem Gerüst-Code zu generieren:
uip codedagent init
uip codedagent init
Das Projekt hat zu dieser Phase einen Platzhalter-Einstiegspunkt. Führen Sie init in Schritt 5 erneut aus, nachdem Ihr Codierungs-Agent den echten Agent-Code geschrieben hat.
Schritt 5 – Erstellen Sie den Agent mit Ihrem Codierungsagent
Hier zahlen sich die UiPath-Fähigkeiten aus. Öffnen Sie Ihren Codierungs-Agent und fordern Sie ihn auf, die Agent-Logik zu erstellen. Der folgende Prompt ist kurz: Es wird beschrieben, was der Agent tun soll, nicht wie er erstellt wird.
The uipath-agents skill your coding agent has installed already knows the LangGraph integration patterns, correct SDK imports, Pydantic schema conventions, and relevant SDK requirements. Without these skills, you would need to specify all of this in the prompt itself.
Verwenden Sie folgenden Prompt (oder passen Sie ihn an Ihren Anwendungsfall an):
Update main.py to implement this UiPath coded agent using LangGraph as a single-node graph with no tools and no retry or error-handling logic.
The agent is a quest intake classifier for a fantasy adventurer's guild. Given a
description of an incoming quest, it classifies the difficulty as one of four tiers:
- Trivial: Simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: Moderate quests requiring some skill (e.g., escort a merchant caravan)
- Heroic: Difficult quests requiring significant expertise (e.g., slay a wyvern, infiltrate a thieves' guild)
- Legendary: Extreme quests requiring top-tier heroes and special approval (e.g., defeat a lich, close a planar rift)
Return the classification tier and a brief reasoning. Use these exact field names in the State schema:
- Input field: `description` (string)
- Output fields: `tier` (a Literal type constrained to exactly "Trivial", "Standard", "Heroic", "Legendary" — not a plain string, so the model can't emit an out-of-vocabulary tier) and `reasoning` (string)
Update the existing langgraph.json to point at the new graph, and create an input.json with this exact sample quest: {"description": "Clear the rats out of the inn cellar"}.
Only touch main.py, langgraph.json, and input.json.
Don't run any uip codedagent commands or otherwise verify that the agent runs — I will do this myself.
Update main.py to implement this UiPath coded agent using LangGraph as a single-node graph with no tools and no retry or error-handling logic.
The agent is a quest intake classifier for a fantasy adventurer's guild. Given a
description of an incoming quest, it classifies the difficulty as one of four tiers:
- Trivial: Simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: Moderate quests requiring some skill (e.g., escort a merchant caravan)
- Heroic: Difficult quests requiring significant expertise (e.g., slay a wyvern, infiltrate a thieves' guild)
- Legendary: Extreme quests requiring top-tier heroes and special approval (e.g., defeat a lich, close a planar rift)
Return the classification tier and a brief reasoning. Use these exact field names in the State schema:
- Input field: `description` (string)
- Output fields: `tier` (a Literal type constrained to exactly "Trivial", "Standard", "Heroic", "Legendary" — not a plain string, so the model can't emit an out-of-vocabulary tier) and `reasoning` (string)
Update the existing langgraph.json to point at the new graph, and create an input.json with this exact sample quest: {"description": "Clear the rats out of the inn cellar"}.
Only touch main.py, langgraph.json, and input.json.
Don't run any uip codedagent commands or otherwise verify that the agent runs — I will do this myself.
Why this prompt is so specific. It names the exact files to touch and tells the coding agent not to run any uip codedagent commands or verify its own work. That's deliberate here: the rest of this lab exercises those same CLI commands directly in the next steps, so verification is left to you instead of the coding agent running it first.
The prompt above is a good template to start from in your own projects, but you should remove the last two sentences to enable the coding agent to test its work and organize files to its own judgment.
Codierungs-Agents sind nicht-deterministisch. Ihr generierter Code wird sich von allen hier gezeigten Beispielen unterscheiden; das erwartet wird. Wichtig ist, dass main.py ohne Fehler ausgeführt wird und eine Klassifizierung zurückgibt.
And note that if your coding agent presents a 'Delivery' question (Studio Web, local dev server, or skip), select Skip - I'm done for now. Connect to Studio Web in Step 10.
Sobald der Codierungs-Agent fertig gestellt ist, führen Sie init erneut aus, um die aktualisierten Einstiegspunkte aus den neuen Pydantic-Schemas zu übernehmen:
uip codedagent init
uip codedagent init
Sie sollten eine Ausgabe sehen, die bestätigt, dass der Einstiegspunkt erkannt wurde, zusammen mit einem ASCII-Diagramm:
Created 'entry-points.json' file with 1 entrypoint(s).
Created 'entry-points.json' file with 1 entrypoint(s).
Bevor Sie fortfahren, öffnen Sie pyproject.toml und fügen Sie einen authors -Eintrag unter [project] hinzu, falls noch kein Eintrag vorhanden ist. UiPath benötigt dieses Feld, um das Projekt zu verpacken:
authors = [{ name = "Your Name" }]
authors = [{ name = "Your Name" }]
With the agent running locally and the entry points registered, you are ready to run it in the next step.
Schritt 6 – Führen Sie den Agent lokal aus
Führen Sie den Agent mit der Beispieleingabedatei aus, die Ihr Codierungsagent erstellt hat:
uip codedagent run agent --file input.json
uip codedagent run agent --file input.json
Sie sollten sehen, wie der Agent die Anforderung klassifiziert und eine Stufe mit Argumentation zurückgibt.
Sie können Eingaben auch inline übergeben. Diese Beispiele verwenden die Bash-Syntax für einzelne Anführungszeichen. Wenn Sie PowerShell verwenden, verwenden Sie stattdessen --file mit einer JSON-Datei:
uip codedagent run agent '{"description": "Clear the rats out of the inn cellar"}'
uip codedagent run agent '{"description": "Clear the rats out of the inn cellar"}'
Try your own inputs to verify the classifications make sense, for example:
uip codedagent run agent '{"description": "Slay the ancient red dragon terrorizing the countryside"}'
uip codedagent run agent '{"description": "Slay the ancient red dragon terrorizing the countryside"}'
With the agent classifying correctly, you are ready to give it something to verify its answers against.
- Schritt 4 – Einrichten des lokalen Projekts
- Erstellen Sie die Python-Umgebung
- Installieren Sie die LangGraph-Integration
- Registrieren Sie Python mit der UiPath CLI
- Gerüst für das Projekt
- Einstiegspunkte generieren
- Schritt 5 – Erstellen Sie den Agent mit Ihrem Codierungsagent
- Schritt 6 – Führen Sie den Agent lokal aus