Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ jobs:
set -e
UV_PYTHON_DOWNLOADS=manual uv python install --managed-python ${{ steps.ci-config.outputs.default_python_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ jobs:
save-if: false

- name: Install cargo-deny
uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-deny@${{ steps.ci-config.outputs.cargo_deny_version }}

- name: Install cargo-about
uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-about@${{ steps.ci-config.outputs.cargo_about_version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
set -e
UV_PYTHON_DOWNLOADS=manual uv python install --managed-python ${{ steps.ci-config.outputs.default_python_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }},sphinx-rustdocgen@1.0.1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
cache: false
toolchain: ${{ steps.ci-config.outputs.rust_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-llvm-cov@${{ steps.ci-config.outputs.cargo_llvm_cov_version }},just@${{ steps.ci-config.outputs.just_version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_license_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
toolchain: ${{ steps.ci-config.outputs.rust_version }}

- name: Install cargo-about
uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-about@${{ steps.ci-config.outputs.cargo_about_version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
cache-bin: false
save-if: false

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-llvm-cov@${{ steps.ci-config.outputs.cargo_llvm_cov_version }},just@${{ steps.ci-config.outputs.just_version }}

Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
with:
node-version: ${{ steps.ci-config.outputs.node_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }}

Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
with:
node-version: ${{ steps.ci-config.outputs.node_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
cache-bin: false
save-if: false

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-llvm-cov@${{ steps.ci-config.outputs.cargo_llvm_cov_version }},just@${{ steps.ci-config.outputs.just_version }}

Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
set -e
UV_PYTHON_DOWNLOADS=manual uv python install --managed-python ${{ steps.ci-config.outputs.default_python_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
python_home="$("$python_exe" -c 'import sys; print(sys.base_prefix)')"
echo "$python_home" >> "$GITHUB_PATH"

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-llvm-cov@${{ steps.ci-config.outputs.cargo_llvm_cov_version }},cargo-nextest@${{ steps.ci-config.outputs.cargo_nextest_version }},just@${{ steps.ci-config.outputs.just_version }}

Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/ci_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,21 @@ jobs:
cache-bin: false
save-if: false

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-llvm-cov@${{ steps.ci-config.outputs.cargo_llvm_cov_version }},just@${{ steps.ci-config.outputs.just_version }}

- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: ${{ steps.ci-config.outputs.node_version }}

# Work-around issue where the GitHub Repo for wasm-pack was moved breaking taiki-e/install-action from
# Installing wasm-pack. Once a new version of the action is released with the fix, re-enable this and remove the
# cargo install command for wasm-pack.
# - uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
# with:
# tool: wasm-pack@${{ steps.ci-config.outputs.wasm_pack_version }}
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: wasm-pack@${{ steps.ci-config.outputs.wasm_pack_version }}

- name: Run WebAssembly tests with coverage
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
run: |
set -e
cargo install wasm-pack --version "${{ steps.ci-config.outputs.wasm_pack_version }}" --locked
just --set ci true --set output_dir "${{ github.workspace }}" test-wasm
run: just --set ci true --set output_dir "${{ github.workspace }}" test-wasm

- name: Upload WebAssembly coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
Expand Down Expand Up @@ -143,14 +137,9 @@ jobs:
with:
node-version: ${{ steps.ci-config.outputs.node_version }}

- uses: taiki-e/install-action@5939f3337e40968c39aa70f5ecb1417a92fb25a0 # v2.75.15
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }}

- name: Install wasm-pack
run: |
set -e
cargo install wasm-pack --version "${{ steps.ci-config.outputs.wasm_pack_version }}" --locked
tool: just@${{ steps.ci-config.outputs.just_version }},wasm-pack@${{ steps.ci-config.outputs.wasm_pack_version }}

- name: Create packaging output directory
run: |
Expand Down
85 changes: 61 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ uv add nemo-flow
npm install nemo-flow-node
```

The NeMo Flow CLI is offered as a separate crate:

```bash
cargo install nemo-flow-cli
```

For source builds, testing, and contribution workflow, see [CONTRIBUTING.md](CONTRIBUTING.md).

## Documentation
Expand All @@ -128,57 +134,88 @@ The table below summarizes the support level for each binding surface.
| Python | ✅ Fully Supported | Fully documented with Quick Start and Guides |
| Node.js | ✅ Fully Supported | Fully documented with Quick Start and Guides |
| Rust | ✅ Fully Supported | Fully documented with Quick Start and Guides |
| Coding-Agent CLI | 🚧 Experimental | Install with `cargo install nemo-flow-cli`. |
| NeMo Flow CLI | 🚧 Experimental | Install with `cargo install nemo-flow-cli`. |
| Go | 🚧 Experimental | Source-first under `go/nemo_flow`. |
| WebAssembly | 🚧 Experimental | Source-first under `crates/wasm`. |
| FFI | 🚧 Experimental | Source-first under `crates/ffi`. |

## Agent Harness Support

NeMo Flow CLI offers experimental support for several agent harnesses.
Refer to the NeMo Flow CLI documentation for additional information.

Below is our support matrix for agent harnesses.

| Agent | Observability | Security | Optimization | Notes |
|:--|:--:|:--:|:--:|:--|
| Claude Code | ✅ Yes | ❌ No | ❌ No | Observability only; no known issues |
| Codex | ✅ Yes | ❌ No | ❌ No | Observability only; missing some necessary hooks for full features |
| Hermes Agent | ✅ Yes | ❌ No | ❌ No | Observability only; no known issues |
| Cursor | ✅ Yes | ❌ No | ❌ No | Observability only; not feature-rich, missing hooks under `cursor-agent` |

## Third-Party Integrations

Some framework integrations are maintained as packages in this repository. Other
sample integrations are maintained as patch sets against upstream projects.

### Public API-based Integrations
### Public API Integrations

Some integrations can be implemented using public APIs without patching. Public
API-based integrations live under language-specific integration packages such as
`python/nemo_flow/integrations/` and `integrations/`.

The OpenClaw observability plugin is available under `integrations/openclaw/`
and uses OpenClaw public plugin hooks plus the generic NeMo Flow plugin
Below is the support matrix for our public API integrations.

| Agent / Library | Observability | Security | Optimization | Notes |
|:--|:--:|:--:|:--:|:--|
| LangChain | ✅ Yes | ✅ Yes | ✅ Yes | Wrapped Tool and LLM calling |
| LangGraph | ✅ Yes | ✅ Yes | ✅ Yes | Wrapped Tool and LLM calling |
| Deep Agents | ✅ Yes | ✅ Yes | ✅ Yes | Wrapped Tool and LLM calling |
| OpenClaw | ✅ Yes | ❌ No | ❌ No | Observability support; missing middleware for wrapped execution |

#### LangChain

The Python `nemo-flow` package ships several extras that offer comprehensive
middleware support for the following packages:

- LangChain
- LangGraph
- Deep Agents

See the [Python package README](python/nemo_flow/README.md) for more information.

#### OpenClaw

An OpenClaw plugin is available as a Node package `nemo-flow-openclaw`.
It relies on OpenClaw public plugin hooks plus the generic NeMo Flow plugin
configuration shape to export telemetry. See the
[OpenClaw package README](integrations/openclaw/README.md).
[OpenClaw package README](integrations/openclaw/README.md) for more information.

### Patch-based Integrations

Patch-based integrations offer experimental support. Our roadmap includes switching over to first-party plugins and packages where upstream extension points allow it.

Use [third_party/README.md](third_party/README.md) for the clone, checkout, and
patch-application workflow for those integrations.

### Support Matrix

The following table summarizes maintained third-party integrations and whether each provides observability, request intercepts, execution intercepts, and conditional execution.
The following table summarizes maintained third-party integrations and whether each provides observability, security, and optimization support.

| Integration | Method | Observability | Request Intercepts | Execution Intercepts | Conditional Execution |
|---|---|---|---|---|---|
| [LangChain](third_party/README-langchain.md), [LangGraph](third_party/README-langgraph.md), [LangChain NVIDIA](third_party/README-langchain-nvidia.md) | 🚧 Patch | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| [opencode](third_party/README-opencode.md) | 🚧 Patch | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| [OpenClaw](integrations/openclaw/README.md) | `nemo-flow-openclaw` package, `nemo-flow` plugin ID | ✅ Yes | ❌ No | ❌ No | ❌ No |
| [Coding-Agent CLI](docs/integrate-frameworks/coding-agent-gateway.md) | `nemo-flow-cli` package for closed harnesses | ✅ Yes | ❌ No | ❌ No | ❌ No |
| [Hermes Agent](third_party/README-hermes-agent.md) | 🚧 Patch | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

Patch-based integrations offer experimental support. Our roadmap includes switching over to first-party plugins and packages where upstream extension points allow it.
| Integration | Observability | Security | Optimization | Notes |
|:---|:---:|:---:|:---:|:---|
| [LangChain](third_party/README-langchain.md), [LangGraph](third_party/README-langgraph.md), [LangChain NVIDIA](third_party/README-langchain-nvidia.md) | ✅ Yes | ✅ Yes | ✅ Yes | Directly patches behavior into code requiring no middleware |
| [opencode](third_party/README-opencode.md) | ✅ Yes | ✅ Yes | ✅ Yes | Directly patches behavior into code |
| [OpenClaw](third_party/README-openclaw.md) | ✅ Yes | ✅ Yes | ✅ Yes | Adds new middleware support to OpenClaw and a built-in plugin |
| [Hermes Agent](third_party/README-hermes-agent.md) | ✅ Yes | ✅ Yes | ✅ Yes | Directly patches behavior into code |

## Roadmap

The following roadmap outlines planned features and integrations for upcoming releases.

- NemoClaw support and integration for managed tool and LLM execution flows.
- Deeper NVIDIA NeMo ecosystem integration across agent, guardrail, evaluation, and
observability workflows.
- Expanded adaptive optimization capabilities for performance-aware scheduling,
hints, and cache behavior.
- First-party plugins and/or packages for common agent runtimes and frameworks.
- [ ] NemoClaw support and integration for managed tool and LLM execution flows.
- [ ] Deeper NVIDIA NeMo ecosystem integration across agent, guardrail, evaluation, and observability workflows.
- [ ] Expanded adaptive optimization capabilities for performance-aware scheduling, hints, and cache behavior.
- [ ] First-party plugins and/or packages for common agent runtimes and frameworks.

## License

NeMo Flow is licensed under the [Apache License 2.0](LICENSE). All source files must include SPDX license headers.
NeMo Flow is licensed under the [Apache License 2.0](LICENSE).
9 changes: 5 additions & 4 deletions crates/adaptive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ SPDX-License-Identifier: Apache-2.0
[![npm wasm](https://img.shields.io/npm/v/nemo-flow-wasm?label=nemo-flow-wasm&color=CC3534&logo=npm)](https://www.npmjs.com/package/nemo-flow-wasm)
[![Crates.io](https://img.shields.io/crates/v/nemo-flow?label=nemo-flow&color=B7410E&logo=rust)](https://crates.io/crates/nemo-flow)
[![Crates.io](https://img.shields.io/crates/v/nemo-flow-adaptive?label=nemo-flow-adaptive&color=B7410E&logo=rust)](https://crates.io/crates/nemo-flow-adaptive)
[![Crates.io](https://img.shields.io/crates/v/nemo-flow-cli?label=nemo-flow-cli&color=B7410E&logo=rust)](https://crates.io/crates/nemo-flow-cli)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/NVIDIA/NeMo-Flow)

# nemo-flow-adaptive
# NeMo Flow

`nemo-flow-adaptive` is the Rust companion crate for adaptive NeMo Flow
runtime behavior. Use it with `nemo-flow` when an agent runtime should learn
Expand Down Expand Up @@ -46,9 +47,9 @@ framework.
the `redis-backend` feature.
- ✅ **Learning primitives**: Runtime helpers and learners built on NeMo Flow
events.
- ✅ **ACG module surface**: The canonical `nemo_flow_adaptive::acg` module for
PromptIR, provider plugins, stability analysis, and cache telemetry
normalization.
- ✅ **Adaptive Cache Governor (ACG) module surface**: The canonical
`nemo_flow_adaptive::acg` module for PromptIR, provider plugins, stability
analysis, and cache telemetry normalization.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion crates/adaptive/src/acg/anthropic_plugin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//! Anthropic cache plugin for the ACG system.
//! Anthropic cache plugin for the Adaptive Cache Governor (ACG) system.
//!
//! Translates ACG stability classifications into Anthropic-specific
//! `cache_control` breakpoints on content blocks. Implements the
Expand Down
8 changes: 4 additions & 4 deletions crates/adaptive/src/acg/error.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//! Error types for the ACG (Adaptive Cache Governor) crate.
//! Error types for the Adaptive Cache Governor (ACG) crate.
//!
//! All fallible operations in the ACG system return [`Result<T>`], which uses
//! [`AcgError`] as the error type.
//! All fallible operations in the Adaptive Cache Governor (ACG) system return
//! [`Result<T>`], which uses [`AcgError`] as the error type.

use thiserror::Error;

/// The error type for all ACG operations.
/// The error type for all Adaptive Cache Governor (ACG) operations.
#[derive(Debug, Error)]
pub enum AcgError {
/// An intent validation failed.
Expand Down
2 changes: 1 addition & 1 deletion crates/adaptive/src/acg/ir_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::acg::prompt_ir::{
///
/// The builder preserves prompt order, inserts tool-schema blocks before the
/// first non-system message when tools are present, and computes the request
/// hashes needed by downstream ACG analysis.
/// hashes needed by downstream Adaptive Cache Governor (ACG) analysis.
///
/// # Parameters
/// - `request`: Annotated LLM request to normalize.
Expand Down
6 changes: 4 additions & 2 deletions crates/adaptive/src/acg/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//! Canonical ACG module surface exposed from the adaptive crate.
//! Canonical Adaptive Cache Governor (ACG) module surface exposed from the
//! adaptive crate.

/// Minimum observations required before ACG emits optimization intents.
/// Minimum observations required before Adaptive Cache Governor (ACG) emits
/// optimization intents.
pub const MIN_ACG_OBSERVATIONS: u32 = 2;

pub mod anthropic_plugin;
Expand Down
2 changes: 1 addition & 1 deletion crates/adaptive/src/acg/openai_plugin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//! OpenAI cache plugin for the ACG system.
//! OpenAI cache plugin for the Adaptive Cache Governor (ACG) system.
//!
//! Maximizes automatic prefix cache hits through deterministic JSON
//! serialization. OpenAI uses automatic prefix caching at 1024+ tokens
Expand Down
7 changes: 3 additions & 4 deletions crates/adaptive/src/acg/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//! Provider plugin trait and input/output types for the ACG system.
//! Provider plugin trait and input/output types for the Adaptive Cache Governor
//! (ACG) system.
//!
//! The [`ProviderPlugin`] trait defines the contract between ACG's
//! provider-agnostic optimization pipeline and backend-specific
Expand All @@ -13,16 +14,14 @@
//! # Design
//!
//! - **Synchronous**: `translate` is a pure data transform (JSON
//! restructuring), not an I/O operation. This matches the [`LlmCodec`]
//! restructuring), not an I/O operation. This matches the `LlmCodec`
//! pattern in `crates/core/src/codec/traits.rs`.
//! - **Compatibility facade**: provider plugins keep their existing
//! synchronous trait surface, but can internally split translation into
//! semantic hint planning plus request-surface application.
//! - **`Send + Sync`**: Required for storage as `Arc<dyn ProviderPlugin>`
//! in concurrent contexts.
//! - **Object-safe**: The trait is designed to be used as a trait object.
//!
//! [`LlmCodec`]: nemo_flow::codec::LlmCodec

use nemo_flow::api::llm::LlmRequest;

Expand Down
Loading
Loading