Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7273cbe4ba |
@@ -0,0 +1,108 @@
|
|||||||
|
---
|
||||||
|
name: graph-based-node-orchestration
|
||||||
|
version: 1.0.0
|
||||||
|
description: Build a typed node graph that processes data through a sequence of operations
|
||||||
|
and produces a final result
|
||||||
|
inputs:
|
||||||
|
- NIM_MODEL constant (e.g., 'nim:meta/llama-3.1-8b-instruct') for the LLM model
|
||||||
|
- blacknode package with Graph, Node, and cook functionality
|
||||||
|
- Python script defining node types with inputs/outputs and connecting them via edges
|
||||||
|
steps:
|
||||||
|
- Import required modules (blacknode as bn, NIM_MODEL) and ensure API keys are available
|
||||||
|
via require_nim_api_key()
|
||||||
|
- Create a bn.Graph() instance to hold all nodes and their connections
|
||||||
|
- Define individual nodes with specific input/output parameters (e.g., Text node with
|
||||||
|
'value' input, LLMAgent node with model parameter, Output node with 'value' output)
|
||||||
|
- Connect nodes together using edge definitions (from_port -> to_port) to establish
|
||||||
|
data flow
|
||||||
|
- Execute the graph using g.cook() to run the pipeline and process data through the
|
||||||
|
node chain
|
||||||
|
- Extract the final result from the output node to complete the workflow
|
||||||
|
outputs:
|
||||||
|
- A fully constructed graph with typed nodes and defined connections
|
||||||
|
- Executed result (e.g., processed text, summary, or other output) from the final
|
||||||
|
node
|
||||||
|
- A reusable pattern that can be adapted to different models, hardware, or task types
|
||||||
|
tags: []
|
||||||
|
metadata:
|
||||||
|
source_repo: https://github.com/temiroff/Blacknode.git
|
||||||
|
extracted_at: ''
|
||||||
|
confidence: 0.95
|
||||||
|
---
|
||||||
|
|
||||||
|
# graph-based-node-orchestration
|
||||||
|
|
||||||
|
Build a typed node graph that processes data through a sequence of operations and produces a final result
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
**Dependencies:**
|
||||||
|
|
||||||
|
```text
|
||||||
|
pip install blacknode >= 0.3.0 Python >= 3.11 NVIDIA NIM API key (optional but recommended) Anthropic, OpenAI, or other LLM models
|
||||||
|
```
|
||||||
|
|
||||||
|
**Setup steps:**
|
||||||
|
|
||||||
|
1. Clone the repository and install dependencies: pip install -e .
|
||||||
|
1. Set NVIDIA_API_KEY or other required API keys in .env
|
||||||
|
1. Run the example script: python examples/hello_agent.py
|
||||||
|
1. For production, configure hardware pairing and deploy via the blacknode CLI
|
||||||
|
|
||||||
|
## Key Files
|
||||||
|
|
||||||
|
- `examples/converted_nvidia_nim.py - Full graph with Model, Text, LLMAgent, Output nodes`
|
||||||
|
- `examples/hello_agent.py - Minimal agent example connecting Literal → LLMAgent → Print`
|
||||||
|
- `blacknode/core - Graph and node implementation (internal)`
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
1. Import required modules (blacknode as bn, NIM_MODEL) and ensure API keys are available via require_nim_api_key()
|
||||||
|
2. Create a bn.Graph() instance to hold all nodes and their connections
|
||||||
|
3. Define individual nodes with specific input/output parameters (e.g., Text node with 'value' input, LLMAgent node with model parameter, Output node with 'value' output)
|
||||||
|
4. Connect nodes together using edge definitions (from_port -> to_port) to establish data flow
|
||||||
|
5. Execute the graph using g.cook() to run the pipeline and process data through the node chain
|
||||||
|
6. Extract the final result from the output node to complete the workflow
|
||||||
|
|
||||||
|
## Implementation Details
|
||||||
|
|
||||||
|
```python
|
||||||
|
g = bn.Graph()
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
model = g.node('Model', **{'value': 'nim:meta/llama-3.1-8b-instruct'})
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
agent = g.node('LLMAgent', **{model})
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
result = g.cook(output, 'value')
|
||||||
|
```
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- NIM_MODEL constant (e.g., 'nim:meta/llama-3.1-8b-instruct') for the LLM model
|
||||||
|
- blacknode package with Graph, Node, and cook functionality
|
||||||
|
- Python script defining node types with inputs/outputs and connecting them via edges
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- A fully constructed graph with typed nodes and defined connections
|
||||||
|
- Executed result (e.g., processed text, summary, or other output) from the final node
|
||||||
|
- A reusable pattern that can be adapted to different models, hardware, or task types
|
||||||
|
|
||||||
|
## Failure Modes
|
||||||
|
|
||||||
|
- Missing or invalid API key (NIM_API_KEY, OPENAI_API_KEY) causing require_nim_api_key() to fail
|
||||||
|
- Type mismatch in node connections (e.g., expecting 'value' but receiving 'text') breaking the data flow
|
||||||
|
- Model not available or unreachable (NIM_MODEL not found) causing the LLMAgent node to fail
|
||||||
|
- Graph execution error due to incorrect edge configuration or circular dependencies
|
||||||
|
- Resource exhaustion (e.g., GPU memory) when processing large inputs in the pipeline
|
||||||
|
|
||||||
|
## Source
|
||||||
|
|
||||||
|
Extracted from: [https://github.com/temiroff/Blacknode.git](https://github.com/temiroff/Blacknode.git)
|
||||||
|
Confidence: 0.95
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Commands: graph-based-node-orchestration
|
||||||
|
|
||||||
|
## Available Commands
|
||||||
|
|
||||||
|
- `/skill graph-based-node-orchestration` — Load this skill
|
||||||
|
- `/run graph-based-node-orchestration` — Execute workflow
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Examples: graph-based-node-orchestration
|
||||||
|
|
||||||
|
## Usage Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
# How to use this skill
|
||||||
|
# Inputs: NIM_MODEL constant (e.g., 'nim:meta/llama-3.1-8b-instruct') for the LLM model, blacknode package with Graph, Node, and cook functionality, Python script defining node types with inputs/outputs and connecting them via edges
|
||||||
|
# Process: Import required modules (blacknode as bn, NIM_MODEL) and ensure API keys are available via require_nim_api_key() → Create a bn.Graph() instance to hold all nodes and their connections → Define individual nodes with specific input/output parameters (e.g., Text node with 'value' input, LLMAgent node with model parameter, Output node with 'value' output)
|
||||||
|
# Outputs: A fully constructed graph with typed nodes and defined connections, Executed result (e.g., processed text, summary, or other output) from the final node, A reusable pattern that can be adapted to different models, hardware, or task types
|
||||||
|
```
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "graph-based-node-orchestration",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"goal": "Build a typed node graph that processes data through a sequence of operations and produces a final result",
|
||||||
|
"inputs": [
|
||||||
|
"NIM_MODEL constant (e.g., 'nim:meta/llama-3.1-8b-instruct') for the LLM model",
|
||||||
|
"blacknode package with Graph, Node, and cook functionality",
|
||||||
|
"Python script defining node types with inputs/outputs and connecting them via edges"
|
||||||
|
],
|
||||||
|
"steps": [
|
||||||
|
"Import required modules (blacknode as bn, NIM_MODEL) and ensure API keys are available via require_nim_api_key()",
|
||||||
|
"Create a bn.Graph() instance to hold all nodes and their connections",
|
||||||
|
"Define individual nodes with specific input/output parameters (e.g., Text node with 'value' input, LLMAgent node with model parameter, Output node with 'value' output)",
|
||||||
|
"Connect nodes together using edge definitions (from_port -> to_port) to establish data flow",
|
||||||
|
"Execute the graph using g.cook() to run the pipeline and process data through the node chain",
|
||||||
|
"Extract the final result from the output node to complete the workflow"
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
"A fully constructed graph with typed nodes and defined connections",
|
||||||
|
"Executed result (e.g., processed text, summary, or other output) from the final node",
|
||||||
|
"A reusable pattern that can be adapted to different models, hardware, or task types"
|
||||||
|
],
|
||||||
|
"failure_modes": [
|
||||||
|
"Missing or invalid API key (NIM_API_KEY, OPENAI_API_KEY) causing require_nim_api_key() to fail",
|
||||||
|
"Type mismatch in node connections (e.g., expecting 'value' but receiving 'text') breaking the data flow",
|
||||||
|
"Model not available or unreachable (NIM_MODEL not found) causing the LLMAgent node to fail",
|
||||||
|
"Graph execution error due to incorrect edge configuration or circular dependencies",
|
||||||
|
"Resource exhaustion (e.g., GPU memory) when processing large inputs in the pipeline"
|
||||||
|
],
|
||||||
|
"confidence": 0.95,
|
||||||
|
"explanation": "This workflow demonstrates a declarative graph-based orchestration pattern where nodes are connected via explicit ports and data flows through the graph. The pattern is highly reusable across different domains (robotics, research, data processing) because it separates graph structure from execution logic. The same graph construction and cook pattern can be adapted to different models (NIM, Anthropic, OpenAI), hardware targets (CPU, GPU, Jetson), and task types (LLM reasoning, file I/O, sensor processing).",
|
||||||
|
"source_repo": "https://github.com/temiroff/Blacknode.git",
|
||||||
|
"score": 1.0
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# Tests: langgraph-multi-agent-sequential
|
# Tests: graph-based-node-orchestration
|
||||||
|
|
||||||
## Test Checklist
|
## Test Checklist
|
||||||
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
---
|
|
||||||
name: langgraph-multi-agent-sequential
|
|
||||||
version: 1.0.0
|
|
||||||
description: Orchestrate a sequence of specialized agents to perform multi-step tasks
|
|
||||||
like research, data processing, and final output generation
|
|
||||||
inputs:
|
|
||||||
- BedrockModel with temperature=0.3, top_p=0.8
|
|
||||||
- Researcher agent with system prompt for destination research (places, history, accommodations,
|
|
||||||
food, web pages)
|
|
||||||
- Travel Guide Generator agent with system prompt for structuring travel guides into
|
|
||||||
labeled sections
|
|
||||||
- Writer agent with system prompt for formatting professional client responses
|
|
||||||
steps:
|
|
||||||
- Researcher agent gathers raw destination facts (top 5 attractions, historical facts,
|
|
||||||
best areas, local foods, suggested web pages) using BedrockModel
|
|
||||||
- Travel Guide Generator agent structures the raw facts into a comprehensive travel
|
|
||||||
guide with clearly labeled sections
|
|
||||||
- Writer agent formats the structured guide into a professional client-facing response
|
|
||||||
with the full guide and highlighted web pages
|
|
||||||
outputs:
|
|
||||||
- Raw research data (JSON string containing destination facts and categories)
|
|
||||||
- Structured travel guide content (markdown with sections for attractions, history,
|
|
||||||
accommodations, cuisine, and web pages)
|
|
||||||
- Final client response (formatted travel guide ready for delivery)
|
|
||||||
tags: []
|
|
||||||
metadata:
|
|
||||||
source_repo: https://github.com/omerbsezer/Fast-LLM-Agent-MCP.git
|
|
||||||
extracted_at: ''
|
|
||||||
confidence: 0.95
|
|
||||||
---
|
|
||||||
|
|
||||||
# langgraph-multi-agent-sequential
|
|
||||||
|
|
||||||
Orchestrate a sequence of specialized agents to perform multi-step tasks like research, data processing, and final output generation
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
**Dependencies:**
|
|
||||||
|
|
||||||
```text
|
|
||||||
pip install langchain langgraph bedrock-model pydantic
|
|
||||||
```
|
|
||||||
|
|
||||||
**Setup steps:**
|
|
||||||
|
|
||||||
1. Install langchain and langgraph packages
|
|
||||||
1. Configure BedrockModel with temperature=0.3 and top_p=0.8
|
|
||||||
1. Create three Agent instances with appropriate system prompts and tools
|
|
||||||
1. Deploy the FastAPI server with the LangGraph application
|
|
||||||
|
|
||||||
## Key Files
|
|
||||||
|
|
||||||
- `agents/langchain_langgraph/08-langgraph-multi-agents-sequential-pattern/agent.py`
|
|
||||||
- `agents/langchain_langgraph/08-langgraph-multi-agents-sequential-pattern/app.py`
|
|
||||||
|
|
||||||
## Steps
|
|
||||||
|
|
||||||
1. Researcher agent gathers raw destination facts (top 5 attractions, historical facts, best areas, local foods, suggested web pages) using BedrockModel
|
|
||||||
2. Travel Guide Generator agent structures the raw facts into a comprehensive travel guide with clearly labeled sections
|
|
||||||
3. Writer agent formats the structured guide into a professional client-facing response with the full guide and highlighted web pages
|
|
||||||
|
|
||||||
## Implementation Details
|
|
||||||
|
|
||||||
```python
|
|
||||||
Researcher agent with system_prompt for destination research and tools=[calculator, current_time]
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
Travel Guide Generator agent with system_prompt requiring structured sections (attractions, history, accommodations, cuisine, web pages)
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
Writer agent with system_prompt for client-facing response formatting
|
|
||||||
```
|
|
||||||
|
|
||||||
## Inputs
|
|
||||||
|
|
||||||
- BedrockModel with temperature=0.3, top_p=0.8
|
|
||||||
- Researcher agent with system prompt for destination research (places, history, accommodations, food, web pages)
|
|
||||||
- Travel Guide Generator agent with system prompt for structuring travel guides into labeled sections
|
|
||||||
- Writer agent with system prompt for formatting professional client responses
|
|
||||||
|
|
||||||
## Outputs
|
|
||||||
|
|
||||||
- Raw research data (JSON string containing destination facts and categories)
|
|
||||||
- Structured travel guide content (markdown with sections for attractions, history, accommodations, cuisine, and web pages)
|
|
||||||
- Final client response (formatted travel guide ready for delivery)
|
|
||||||
|
|
||||||
## Failure Modes
|
|
||||||
|
|
||||||
- Researcher agent fails to retrieve sufficient information, causing downstream agents to receive incomplete or empty data
|
|
||||||
- Travel Guide Generator fails to structure data properly, resulting in unorganized or malformed output
|
|
||||||
- Writer agent fails to format the final response correctly, producing garbled or incomplete output
|
|
||||||
- Model timeouts or errors in any agent step causing the entire pipeline to fail
|
|
||||||
|
|
||||||
## Source
|
|
||||||
|
|
||||||
Extracted from: [https://github.com/omerbsezer/Fast-LLM-Agent-MCP.git](https://github.com/omerbsezer/Fast-LLM-Agent-MCP.git)
|
|
||||||
Confidence: 0.95
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# Commands: langgraph-multi-agent-sequential
|
|
||||||
|
|
||||||
## Available Commands
|
|
||||||
|
|
||||||
- `/skill langgraph-multi-agent-sequential` — Load this skill
|
|
||||||
- `/run langgraph-multi-agent-sequential` — Execute workflow
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# Examples: langgraph-multi-agent-sequential
|
|
||||||
|
|
||||||
## Usage Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
# How to use this skill
|
|
||||||
# Inputs: BedrockModel with temperature=0.3, top_p=0.8, Researcher agent with system prompt for destination research (places, history, accommodations, food, web pages), Travel Guide Generator agent with system prompt for structuring travel guides into labeled sections, Writer agent with system prompt for formatting professional client responses
|
|
||||||
# Process: Researcher agent gathers raw destination facts (top 5 attractions, historical facts, best areas, local foods, suggested web pages) using BedrockModel → Travel Guide Generator agent structures the raw facts into a comprehensive travel guide with clearly labeled sections → Writer agent formats the structured guide into a professional client-facing response with the full guide and highlighted web pages
|
|
||||||
# Outputs: Raw research data (JSON string containing destination facts and categories), Structured travel guide content (markdown with sections for attractions, history, accommodations, cuisine, and web pages), Final client response (formatted travel guide ready for delivery)
|
|
||||||
```
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "langgraph-multi-agent-sequential",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"goal": "Orchestrate a sequence of specialized agents to perform multi-step tasks like research, data processing, and final output generation",
|
|
||||||
"inputs": [
|
|
||||||
"BedrockModel with temperature=0.3, top_p=0.8",
|
|
||||||
"Researcher agent with system prompt for destination research (places, history, accommodations, food, web pages)",
|
|
||||||
"Travel Guide Generator agent with system prompt for structuring travel guides into labeled sections",
|
|
||||||
"Writer agent with system prompt for formatting professional client responses"
|
|
||||||
],
|
|
||||||
"steps": [
|
|
||||||
"Researcher agent gathers raw destination facts (top 5 attractions, historical facts, best areas, local foods, suggested web pages) using BedrockModel",
|
|
||||||
"Travel Guide Generator agent structures the raw facts into a comprehensive travel guide with clearly labeled sections",
|
|
||||||
"Writer agent formats the structured guide into a professional client-facing response with the full guide and highlighted web pages"
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
"Raw research data (JSON string containing destination facts and categories)",
|
|
||||||
"Structured travel guide content (markdown with sections for attractions, history, accommodations, cuisine, and web pages)",
|
|
||||||
"Final client response (formatted travel guide ready for delivery)"
|
|
||||||
],
|
|
||||||
"failure_modes": [
|
|
||||||
"Researcher agent fails to retrieve sufficient information, causing downstream agents to receive incomplete or empty data",
|
|
||||||
"Travel Guide Generator fails to structure data properly, resulting in unorganized or malformed output",
|
|
||||||
"Writer agent fails to format the final response correctly, producing garbled or incomplete output",
|
|
||||||
"Model timeouts or errors in any agent step causing the entire pipeline to fail"
|
|
||||||
],
|
|
||||||
"confidence": 0.95,
|
|
||||||
"explanation": "This workflow demonstrates a reusable LangGraph pattern where three specialized agents work sequentially: a Researcher agent gathers raw destination facts, a Travel Guide Generator agent structures those facts into a travel guide, and a Writer agent formats the final output for clients. The pattern is modular and can be adapted to other multi-step tasks by swapping agent roles and prompts while maintaining the same pipeline structure.",
|
|
||||||
"source_repo": "https://github.com/omerbsezer/Fast-LLM-Agent-MCP.git",
|
|
||||||
"score": 1.0
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user