Agent Runtime

The BlackRoad agent runtime provides the execution environment for autonomous agents, handling orchestration, coordination, and lifecycle management.

Overview

The runtime combines LangGraph and CrewAI for flexible agent orchestration. It supports both supervisor-based hierarchies and peer-to-peer coordination models, allowing you to choose the topology that fits your use case.

Note

Agents require a connected memory backend before they can process tasks. See the Memory System documentation for setup instructions.

Initialization

Create an agent instance with the required configuration. The runtime handles connection pooling, health checks, and graceful shutdown automatically.

Python
from blackroad import Agent, Memory, EventBus

# Initialize with memory and event bus
agent = Agent(
    name="lucidia-7",
    memory=Memory(backend="ps-sha-inf"),
    bus=EventBus(url="nats://cluster.local")
)

# Register capabilities
agent.register_capability("reasoning", trinary=True)
agent.register_capability("contradiction-handling")

# Start the agent
await agent.start()

Configuration

The agent accepts the following configuration options:

Parameter Type Description
name str Unique identifier for the agent
memory Memory Memory backend configuration
bus EventBus Event bus connection for coordination
supervisor str | None Parent supervisor agent ID
max_retries int Maximum task retry attempts (default: 3)

Capabilities

Capabilities define what an agent can do. The capability registry tracks available skills across your agent fleet, enabling dynamic task routing.

Registering Capabilities

Register capabilities at initialization or runtime. The registry broadcasts changes to all connected agents.

Python
# Static registration
agent.register_capability("image-analysis")

# With configuration
agent.register_capability(
    "code-execution",
    sandbox=True,
    timeout=30
)

# Query capabilities fleet-wide
agents = await registry.find_agents(
    capability="reasoning"
)

Built-in Capabilities

The runtime includes several built-in capabilities that agents can opt into: