Table of Contents

Namespace LMKit.Agents.Resilience

Classes

AgentExecutionException

Exception representing a failed agent execution.

AgentHealthCheck

Monitors agent health and provides health check capabilities.

Tracks success rates, latency, and circuit breaker states to determine overall agent health.

BulkheadPolicy

A resilience policy that limits concurrent executions.

Prevents resource exhaustion by limiting how many operations can execute simultaneously.

BulkheadRejectedException

Exception thrown when a bulkhead rejects an operation.

CircuitBreakerOpenException

Exception thrown when a circuit breaker is open.

CircuitBreakerPolicy

A resilience policy that implements the circuit breaker pattern.

Prevents cascade failures by "tripping" the circuit after a threshold of failures, rejecting subsequent calls until a recovery period elapses.

CompositePolicy

Combines multiple resilience policies into a single policy.

Policies are executed in order from outermost to innermost. For example: Timeout -> Retry -> CircuitBreaker -> Action.

FallbackAgentExecutor

An executor that tries multiple agents in sequence until one succeeds.

Provides graceful degradation by falling back to alternative agents when the primary agent fails.

FallbackPolicy<T>

A resilience policy that provides a fallback value or action when the primary fails.

Useful for graceful degradation when an operation fails.

HealthStatus

Represents the health status of an agent.

PolicyExtensions

Extension methods for building policy compositions.

RateLimitExceededException

Exception thrown when a rate limit is exceeded.

RateLimitPolicy

A resilience policy that limits the rate of operations.

Uses a token bucket algorithm to enforce rate limits, allowing bursts while maintaining an average rate.

ResilienceContext

Context shared across policy executions.

ResilientAgentExecutor

An agent executor that applies resilience policies to execution.

Wraps agent execution with retry, circuit breaker, timeout, and fallback policies for production reliability.

RetryPolicy

A resilience policy that retries failed operations.

Supports configurable retry counts, delays, exponential backoff, and exception filtering.

TimeoutPolicy

A resilience policy that enforces a timeout on operations.

If the operation does not complete within the specified duration, it is cancelled and a TimeoutRejectedException is thrown.

TimeoutRejectedException

Exception thrown when an operation is rejected due to timeout.

Interfaces

IResiliencePolicy

Defines a resilience policy that wraps agent execution.

Policies can be composed to create sophisticated fault-handling strategies (e.g., retry with circuit breaker and timeout).

Enums

CircuitState

The state of a circuit breaker.

HealthState

The health state of an agent.