Skip to main content
3 min read

AgentNode v0.4.0: Smart Execution with Capability Gap Detection

Agents can now detect missing capabilities at runtime, find the right skill in the registry, install it, and retry — all in a single function call. Introducing smart_run(), detect_and_install(), and auto-upgrade policies.

By agentnode

Until now, agents stopped cold when they hit a missing capability. A PDF extraction call with no PDF library installed? The agent throws an error and waits for a human to intervene. That cycle — fail, debug, install, retry — happens dozens of times in a typical agent project.

AgentNode SDK v0.4.0 closes that loop. Agents can now detect missing capabilities at runtime, find the right skill in the registry, install it, and retry — all in a single function call.

The Problem: Agents Can’t Self-Heal

Every agent framework today assumes tools are pre-installed. When an agent encounters a task it can’t handle — extracting text from a PDF, parsing a spreadsheet, calling an unfamiliar API — it fails with an ImportError or a missing-tool exception. The developer then manually searches for the right package, installs it, and re-runs the agent.

This works for small projects. It doesn’t scale. Production agents need to handle novel tasks without human intervention.

The Solution: Detect → Resolve → Install → Retry

smart_run() wraps your callable and catches capability gaps automatically. When the function fails because a dependency is missing, AgentNode detects the gap, finds a matching skill in the registry, installs it according to your policy, and retries your code:

from agentnode_sdk import AgentNodeClient

client = AgentNodeClient(api_key="ank_live_...")

result = client.smart_run(
    lambda: process_pdf("quarterly-report.pdf"),
    auto_upgrade_policy="safe",
)
print(result.result)     # extracted text
print(result.upgraded)   # True — skill was auto-installed

One call. No manual intervention. The agent keeps working.

Safety First: Auto-Upgrade Policies

Automatic installation without guardrails would be reckless. That’s why every smart_run() call requires an explicit auto_upgrade_policy:

  • "off" — Never auto-install. Detect and report the gap, but require manual action.
  • "safe" — Auto-install verified and trusted skills only. Unverified packages are blocked.
  • "strict" — Auto-install trusted skills only. Even verified packages require manual approval.

The policy interacts directly with the publisher’s trust level:

Trust Level "safe" "strict" "off"
trusted Auto-install Auto-install Manual only
verified Auto-install Manual only Manual only
unverified Manual only Manual only Manual only

The API

smart_run() — Primary

Run a callable. If it fails due to a missing capability, detect the gap, install the skill, and retry. Returns the result plus metadata about what was installed.

result = client.smart_run(callable, auto_upgrade_policy="safe")
result.result      # return value of your callable
result.upgraded    # bool — was a skill installed?
result.installed   # list of installed packages

detect_and_install() — Fine-Grained Control

Detect and install without retrying. Useful when you want to control the retry logic yourself.

installed = client.detect_and_install(
    callable,
    auto_upgrade_policy="strict",
)
# Returns list of installed package slugs

detect_gap() — Standalone Detection

Just detect what’s missing without installing anything. Useful for reporting, dry-runs, or building custom install flows.

gaps = client.detect_gap(callable)
# Returns list of capability IDs that are missing

Why This Matters for Publishers

If you publish skills on AgentNode, v0.4.0 changes the game. Your skills are no longer passive packages that developers find by searching — they’re now actively acquired by agents at runtime.

When an agent runs smart_run() and hits a capability gap, AgentNode resolves the best matching skill from the registry. If your skill is verified or trusted, it gets installed automatically — no human in the loop.

This creates a direct incentive: get verified, and agents install your skill without asking. The higher your trust level, the more policies allow auto-installation, and the more agents use your tool.

Get Started

pip install agentnode-sdk==0.4.0
from agentnode_sdk import AgentNodeClient

client = AgentNodeClient(api_key="ank_live_...")

# Your agent now self-extends when it hits missing capabilities
result = client.smart_run(
    lambda: your_task_here(),
    auto_upgrade_policy="safe",
)

Full API reference in the SDK documentation. Release notes on GitHub.

LLM Runtime: Let the Model Handle It

If your agent uses OpenAI or Anthropic tool calling, AgentNodeRuntime handles tool registration, system prompt injection, and the tool loop automatically. The LLM discovers, installs, and runs AgentNode capabilities on its own — no hardcoded tool calls needed.

from openai import OpenAI
from agentnode_sdk import AgentNodeRuntime

runtime = AgentNodeRuntime()

result = runtime.run(
    provider="openai",
    client=OpenAI(),
    model="gpt-4o",
    messages=[{"role": "user", "content": "your task here"}],
)
print(result.content)

The Runtime registers 5 meta-tools (agentnode_capabilities, agentnode_search, agentnode_install, agentnode_run, agentnode_acquire) that let the LLM search the registry, install packages, and execute tools autonomously. Works with Anthropic too — just change provider="anthropic" and pass an Anthropic client.

See the LLM Runtime documentation for the full API reference, trust levels, and manual tool calling.

#release#v0.4.0#sdk