Skip to navigation

2. Switch Harnesses

View as MarkdownOpen in Claude

This second quickstart demonstrates the central reason to use NVIDIA NeMo Fabric: your application can keep its execution and result-handling contract while changing harnesses. Complete 1. Install One Harness first and retain its config in first_agent.py.

1

Install the Second Harness

This example compares Deep Agents with Hermes Agent, using its ready-made NeMo Fabric adapter. The supported Hermes v0.22.7 stack requires Python 3.14; NeMo Fabric itself supports Python 3.11–3.14. Keep Hermes in a separate environment to isolate its dependencies. Both variants use the NVIDIA model and credential from the first quickstart.

With the first quickstart’s .venv still active, install uv and Git, then run the following in your application directory using a POSIX shell. The commands check out the supported Hermes release, use its frozen dependency lockfile, and install the Hermes adapter version matching your application:

uv python install 3.14
uv venv --python 3.14 .venv-hermes
git clone --filter=blob:none --no-checkout https://github.com/NousResearch/hermes-agent.git hermes-agent
git -C hermes-agent fetch --depth 1 origin b200f5bc60e31588ba2cb60e288029c4a54ba5fa
git -C hermes-agent checkout --detach FETCH_HEAD
UV_PROJECT_ENVIRONMENT="$PWD/.venv-hermes" uv sync \
--project ./hermes-agent --frozen --no-default-groups --extra mcp \
--config-settings-package hermes-agent:editable_mode=compat
FABRIC_VERSION="$(python -c 'from importlib.metadata import version; print(version("nemo-fabric"))')"
uv pip install --python .venv-hermes/bin/python "nemo-fabric-adapters-hermes==$FABRIC_VERSION"
export HERMES_ADAPTER_PYTHON="$PWD/.venv-hermes/bin/python"

Do not activate .venv-hermes; your application still runs in .venv. HERMES_ADAPTER_PYTHON selects the second interpreter only when launching Hermes. If you already have the supported Hermes environment, install the matching adapter there and set this variable to its absolute interpreter path instead. Refer to the Hermes installation guide for the source-checkout alternative and upstream platform guidance.

2

Construct Explicit Variants

Save the following as compare_agents.py. Set HERMES_ADAPTER_PYTHON to the supported Hermes environment’s absolute Python path before running it:

import asyncio
import os
import sys
from first_agent import REVIEW_INPUT, config
from nemo_fabric import Fabric, HarnessConfig
async def main():
original_python = os.environ.get("ADAPTER_PYTHON")
for name, adapter_id, interpreter in [
("deepagents", "nvidia.fabric.langchain.deepagents", sys.executable),
("hermes", "nvidia.fabric.hermes", os.environ["HERMES_ADAPTER_PYTHON"]),
]:
variant = config.model_copy(deep=True)
variant.harness = HarnessConfig(adapter_id=adapter_id)
os.environ["ADAPTER_PYTHON"] = interpreter
try:
result = await Fabric().run(
variant, input=REVIEW_INPUT
)
print(f"\nHarness: {name}")
print("Adapter:", result.adapter_id)
print("Status:", result.status)
if result.status == "succeeded":
print("Review:", result.output.response)
else:
print("Error:", result.error)
finally:
if original_python is None:
os.environ.pop("ADAPTER_PYTHON", None)
else:
os.environ["ADAPTER_PYTHON"] = original_python
asyncio.run(main())
python compare_agents.py

The environment-variable switch is sequential and intended for this local lesson. Do not mutate shared process environment variables around concurrent runtime starts. Production launchers should establish consistent execution environments.

Interpret the Results

Look for two labeled results, one per harness. Each should report Status: succeeded, the expected adapter ID, and a review identifying that an empty input list causes division by zero. For example, the output can look like this; review wording varies:

Harness: deepagents
Adapter: nvidia.fabric.langchain.deepagents
Status: succeeded
Review: average([]) raises ZeroDivisionError because len(values) is zero.
Harness: hermes
Adapter: nvidia.fabric.hermes
Status: succeeded
Review: Handle an empty list before dividing by its length.

The shared RunResult fields let your application check status before reading output.response, regardless of the harness. If a result fails, inspect the labeled error and follow Troubleshooting; configuration or startup failures can instead raise SDK exceptions. Different prompts, defaults, tools, and native semantics can produce different reviews. This exercise demonstrates common invocation and result handling; it is not a benchmark or proof of equivalent behavior.

Before changing another configuration field, consult Harness Compatibility. For a controlled task and verifier, use Harbor. The maintained variations notebook expands this pattern to additional harnesses, capabilities, and telemetry.

Keep HERMES_ADAPTER_PYTHON set and continue to 3. Add Skills and MCP to extend the Hermes variant using the same model and code-review task.