LevelUp.Strategos.Infrastructure
2.2.1
dotnet add package LevelUp.Strategos.Infrastructure --version 2.2.1
NuGet\Install-Package LevelUp.Strategos.Infrastructure -Version 2.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LevelUp.Strategos.Infrastructure" Version="2.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LevelUp.Strategos.Infrastructure" Version="2.2.1" />
<PackageReference Include="LevelUp.Strategos.Infrastructure" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LevelUp.Strategos.Infrastructure --version 2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LevelUp.Strategos.Infrastructure, 2.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LevelUp.Strategos.Infrastructure@2.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LevelUp.Strategos.Infrastructure&version=2.2.1
#tool nuget:?package=LevelUp.Strategos.Infrastructure&version=2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Strategos.Infrastructure
Infrastructure implementations for Strategos including Thompson Sampling agent selection, loop detection, and budget enforcement.
Installation
dotnet add package LevelUp.Strategos.Infrastructure
Features
Thompson Sampling Agent Selection
Contextual bandit algorithm for intelligent agent selection based on historical performance.
services.AddStrategosInfrastructure(options =>
{
options.ThompsonSampling.ExplorationWeight = 0.3;
options.ThompsonSampling.MinSamples = 10;
});
// In your step
var agent = await agentSelector.SelectAgentAsync(
availableAgents,
taskContext,
cancellationToken);
Loop Detection
Detects stuck workflows using multiple strategies:
- Exact Repetition: Identical action sequences in sliding window
- Semantic Similarity: Similar outputs (cosine similarity > 0.85)
- Oscillation: A-B-A-B patterns
- No Progress: Activity without observable state change
var loopResult = await loopDetector.DetectLoopAsync(
workflowHistory,
cancellationToken);
if (loopResult.IsLooping)
{
// Apply recovery strategy
var recovery = loopResult.SuggestedRecovery;
}
Budget Guard
Enforces resource limits with scarcity-aware scoring:
var budget = new WorkflowBudget
{
MaxSteps = 50,
MaxTokens = 100_000,
MaxWallTime = TimeSpan.FromMinutes(30)
};
var canProceed = await budgetGuard.CheckBudgetAsync(
currentUsage,
budget,
cancellationToken);
Scarcity Levels:
- Abundant (>70%): Normal operation
- Normal (30-70%): Slight penalty on expensive actions
- Scarce (10-30%): Prioritize efficient actions
- Critical (<=10%): Essential operations only
Configuration
services.AddStrategosInfrastructure(options =>
{
// Thompson Sampling
options.ThompsonSampling.ExplorationWeight = 0.3;
options.ThompsonSampling.SuccessWeight = 2.0;
// Loop Detection
options.LoopDetection.WindowSize = 10;
options.LoopDetection.SemanticThreshold = 0.85;
// Budget
options.Budget.DefaultScarcityLevel = ScarcityLevel.Normal;
});
Documentation
- Infrastructure API Reference - Complete API documentation
- Configuration Guide - Configuration options
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- BitFaster.Caching (>= 2.5.2)
- CommunityToolkit.HighPerformance (>= 8.4.0)
- LevelUp.Strategos (>= 2.2.1)
- MemoryPack (>= 1.21.3)
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.