Skip to content

Package Ecosystem

Strategos is distributed as fourteen NuGet packages, allowing you to include only what you need. Every package listed here ships to nuget.org under the LevelUp. prefix.

PackagePurposeInstall
StrategosCore fluent DSL, abstractions, and type definitionsYes
Strategos.GeneratorsRoslyn source generators for compile-time code generationYes
Strategos.Identity.AbstractionsWorkflow and agent identity records, header constants, and the saga portsArrives with Strategos
Strategos.ContractsTypeSpec-canonical event, workflow-IR, and invariant contractsArrives with Strategos
Strategos.InfrastructureProduction implementations (Thompson Sampling, loop detection, budgets)Recommended
Strategos.AgentsMicrosoft.Extensions.AI integration for LLM-powered stepsFor AI workflows
Strategos.Agents.McpConsume external MCP servers as agent tool sourcesFor MCP tool sources
PackagePurposeInstall
Strategos.OntologyType-safe ontology definition layer: descriptors, builders, object setsFor domain modeling
Strategos.Ontology.GeneratorsRoslyn analyzers that validate ontology declarations at compile timeWith Strategos.Ontology
Strategos.Ontology.NpgsqlPostgreSQL pgvector-backed object set providerFor a durable object set
Strategos.Ontology.EmbeddingsOpenAI-compatible embedding provider for vector searchFor vector search
Strategos.Ontology.MCPOntology exploration, query, and action dispatch as MCP toolsFor agent access
Strategos.Ontology.MCP.HostingRegisters those tools on an MCP server builderTo host the tools
PackagePurposeInstall
Strategos.RagVector store adapters, superseded by Strategos.OntologyNo

The core package containing the fluent DSL for defining workflows and all foundational abstractions.

TypePurpose
Workflow<TState>Entry point for fluent workflow definitions
IWorkflowStep<TState>Interface for implementing workflow steps
IWorkflowDefinition<TState>Interface for workflow definition classes
StepResult<TState>Result type returned from step execution
StepContextExecution context passed to steps (correlation ID, timestamp, metadata)
TypePurpose
AgentBeliefBeta(alpha, beta) distribution representing agent performance belief
TaskCategoryEnumeration of task categories (Analysis, Coding, Research, etc.)
TaskFeaturesExtracted features from task descriptions
IAgentSelectorInterface for agent selection strategies
IBeliefStoreInterface for persisting agent beliefs
AttributePurpose
[Append]Merge lists by appending new items to existing
[Merge]Merge dictionaries, new values overwrite existing keys
[WorkflowState]Marks a record as workflow state (enables source generation)
Terminal window
dotnet add package LevelUp.Strategos

Roslyn source generators that transform fluent DSL definitions into type-safe artifacts at compile time.

ArtifactDescription
Phase EnumType-safe enumeration of workflow phases
CommandsWolverine message types for step transitions
EventsMarten event types for audit trail
Saga ClassComplete Wolverine saga with handlers
State ReducersProperty merge logic based on [Append]/[Merge] attributes
DI ExtensionsService registration helpers

The generator reports errors and warnings at compile time. See Diagnostics Reference for the complete list.

CodeSeverityDescription
AGWF001ErrorWorkflow name cannot be empty
AGWF002WarningNo steps found in workflow
AGWF003ErrorDuplicate step name (use instance names)
AGWF009ErrorWorkflow must begin with StartWith<T>()
AGWF010WarningWorkflow should end with Finally<T>()
AGWF012ErrorEvery Fork must be followed by Join<T>()
Terminal window
dotnet add package LevelUp.Strategos.Generators

The identity seam: workflow and agent identity value records, header constants, and the ports that Wolverine envelope-header propagation consumes.

TypePurpose
IAgentIdentityProviderSupplies the agent identity for an outgoing call
IAgentIdentityAccessorReads the ambient agent identity inside a step
IPhaseAwareSagaPort a generated saga implements so a host can read its current phase

This package has no dependencies of its own and arrives transitively with LevelUp.Strategos. Install it directly only when a project needs the ports without the DSL.

Terminal window
dotnet add package LevelUp.Strategos.Identity.Abstractions

The cross-product schema substrate. TypeSpec is canonical; the contracts are emitted both as C# records (this assembly) and as JSON Schema shipped as package content for non-.NET consumers.

The package covers SDLC event contracts, the workflow wire-IR that WorkflowDefinitionProjection.ToContract() exports, and the invariant and diagnostic catalogs. It versions independently of the workflow packages.

It arrives transitively with LevelUp.Strategos; install it directly when a project consumes the schemas without the DSL.

Terminal window
dotnet add package LevelUp.Strategos.Contracts

Production-ready implementations of core abstractions including Thompson Sampling, loop detection, and budget enforcement.

TypePurpose
ContextualAgentSelectorSelects agents using Thompson Sampling with contextual bandits
InMemoryBeliefStoreIn-memory persistence for agent beliefs (dev/testing)
KeywordTaskFeatureExtractorExtracts task features for category classification

Detects stuck workflows using four strategies:

DetectorDescription
ExactRepetitionDetectorIdentical action sequences
SemanticRepetitionDetectorSimilar outputs (cosine similarity > threshold)
OscillationDetectorA-B-A-B patterns
NoProgressDetectorActivity without state change
TypePurpose
BudgetGuardEnforces resource limits (steps, tokens, wall time)
ScarcityLevelAbundant, Normal, Scarce, Critical
BudgetOptionsConfiguration for budget thresholds
Terminal window
dotnet add package LevelUp.Strategos.Infrastructure
services.AddStrategos()
.AddThompsonSampling(options => options
.WithPrior(alpha: 2, beta: 2))
.AddLoopDetection()
.AddBudgetGuard(options => options
.WithMaxSteps(100)
.WithMaxTokens(50_000));

Integration with Microsoft.Extensions.AI for LLM-powered workflow steps.

TypePurpose
IAgentStep<TState>Base interface for LLM-powered steps
AgentStepContextExtended context with conversation thread access
IConversationalStateInterface for state that includes conversation history
IStreamingCallbackCallback for real-time token streaming
  • Microsoft.Extensions.AI (10.0.1)
  • Microsoft.Extensions.AI.Abstractions (10.0.1)
Terminal window
dotnet add package LevelUp.Strategos.Agents
public class AnalyzeDocumentStep : IAgentStep<DocumentState>
{
private readonly IChatClient _chatClient;
public AnalyzeDocumentStep(IChatClient chatClient)
{
_chatClient = chatClient;
}
public async Task<StepResult<DocumentState>> ExecuteAsync(
DocumentState state,
AgentStepContext context,
CancellationToken ct)
{
var response = await _chatClient.GetResponseAsync(
$"Analyze this document: {state.Content}",
ct);
return state
.With(s => s.Analysis, response)
.AsResult();
}
}

The Model Context Protocol adapter for Strategos.Agents. It supplies McpToolSource, an IToolSource implementation wrapping the ModelContextProtocol C# SDK, so a Strategos agent can consume an external MCP server as a skill provider.

It ships separately from Strategos.Agents on purpose: the core agents package stays free of MCP dependencies, which keeps the port and the adapter apart.

Terminal window
dotnet add package LevelUp.Strategos.Agents.Mcp

The type-safe ontology definition layer for domain modeling. It provides descriptors, builders, and a fluent DSL for defining object types, links, actions, events, and interfaces across domains.

TypePurpose
IObjectSetProviderPort a backing store implements to serve object sets
InMemoryObjectSetProviderIn-memory provider for development and testing
IEmbeddingProviderPort for producing embedding vectors
ITextChunkerChunking strategies: sentence, paragraph, and fixed-size
IngestionPipelineChunk, embed, and load source text into an object set

See the Ontology Reference for the modeling guide.

Terminal window
dotnet add package LevelUp.Strategos.Ontology

Roslyn diagnostic analyzers for ontology definitions. They validate domain ontology declarations at compile time across the core, precondition, lifecycle, derivation, interface-action, and extension-point rules.

The analyzers report the AONT diagnostic series; see AONT001-AONT099, AONT100-AONT199, and the AONT200 series.

Terminal window
dotnet add package LevelUp.Strategos.Ontology.Generators

A PostgreSQL pgvector-backed IObjectSetProvider, for ontologies that need a durable object set with vector search rather than the in-memory provider.

TypePurpose
PgVectorObjectSetProviderThe pgvector-backed object set provider
PgVectorOptionsConnection, schema, and search configuration
IterativeScanOptionsIterative-scan tuning for filtered vector search

See the Npgsql provider reference for schema and index setup.

Terminal window
dotnet add package LevelUp.Strategos.Ontology.Npgsql

An OpenAI-compatible embedding provider for ontology vector search. It targets any endpoint that speaks the OpenAI embeddings API shape.

TypePurpose
OpenAiCompatibleEmbeddingProviderIEmbeddingProvider over an OpenAI-compatible endpoint
OpenAiEmbeddingOptionsEndpoint, model, and dimension configuration
Terminal window
dotnet add package LevelUp.Strategos.Ontology.Embeddings

The MCP tool surface for the ontology. It exposes exploration, querying, and action dispatch as MCP tools so external agents can read and act on the domain model.

TypePurpose
OntologyExploreToolWalks object types, links, and actions
OntologyQueryToolRuns object-set queries, including hybrid retrieval
OntologyActionToolDispatches an ontology action
OntologyToolDescriptorTool descriptor carrying title, output schema, and annotations

This package carries the tool definitions only. Registering them on a server is Strategos.Ontology.MCP.Hosting.

Terminal window
dotnet add package LevelUp.Strategos.Ontology.MCP

The hosting bridge. It adapts ontology tool descriptors into ModelContextProtocol server tools and registers them on an MCP server builder.

TypePurpose
OntologyMcpServerBuilderExtensionsRegistration surface on the MCP server builder
OntologyServerToolFactoryBuilds server tools from ontology descriptors
LoggingOntologyAuditSinkAudit sink that writes tool invocations to the logger
Terminal window
dotnet add package LevelUp.Strategos.Ontology.MCP.Hosting

Vector store adapters for Retrieval-Augmented Generation patterns.

AdapterStatusUse Case
InMemoryVectorSearchAdapterAvailableDevelopment and testing
TypePurpose
IVectorSearchAdapterInterface for vector similarity search
SearchResultResult containing content, score, and metadata
Terminal window
dotnet add package LevelUp.Strategos.Rag

For workflows that don’t involve LLM agents:

Terminal window
dotnet add package LevelUp.Strategos
dotnet add package LevelUp.Strategos.Generators

Most common setup for AI agent workflows:

Terminal window
dotnet add package LevelUp.Strategos
dotnet add package LevelUp.Strategos.Generators
dotnet add package LevelUp.Strategos.Agents
dotnet add package LevelUp.Strategos.Infrastructure

For a typed domain model with compile-time validation:

Terminal window
dotnet add package LevelUp.Strategos.Ontology
dotnet add package LevelUp.Strategos.Ontology.Generators

Adds a pgvector-backed object set and an embedding provider:

Terminal window
dotnet add package LevelUp.Strategos.Ontology
dotnet add package LevelUp.Strategos.Ontology.Generators
dotnet add package LevelUp.Strategos.Ontology.Npgsql
dotnet add package LevelUp.Strategos.Ontology.Embeddings

Exposes the ontology to external agents:

Terminal window
dotnet add package LevelUp.Strategos.Ontology
dotnet add package LevelUp.Strategos.Ontology.MCP
dotnet add package LevelUp.Strategos.Ontology.MCP.Hosting

Strategos (core)
+-- Strategos.Identity.Abstractions
+-- Strategos.Contracts
+-- MemoryPack
Strategos.Identity.Abstractions
+-- No dependencies
Strategos.Contracts
+-- No dependencies
Strategos.Generators
+-- Microsoft.CodeAnalysis.CSharp
+-- [Compile-time only; the identity abstractions ship inside the analyzer folder]
Strategos.Infrastructure
+-- Strategos
+-- BitFaster.Caching
+-- CommunityToolkit.HighPerformance
+-- MemoryPack
+-- Microsoft.Extensions.Caching.Memory
+-- Microsoft.Extensions.DependencyInjection.Abstractions
+-- Microsoft.Extensions.Logging.Abstractions
Strategos.Agents
+-- Strategos
+-- Microsoft.Extensions.AI
+-- Microsoft.Extensions.AI.Abstractions
+-- Microsoft.Extensions.DependencyInjection.Abstractions
Strategos.Agents.Mcp
+-- Strategos.Agents
+-- Microsoft.Extensions.AI
+-- Microsoft.Extensions.AI.Abstractions
+-- ModelContextProtocol
Strategos.Ontology
+-- Microsoft.Extensions.DependencyInjection.Abstractions
+-- Microsoft.Extensions.Logging.Abstractions
Strategos.Ontology.Generators
+-- Microsoft.CodeAnalysis.CSharp
+-- [Compile-time only]
Strategos.Ontology.Npgsql
+-- Strategos.Ontology
+-- Npgsql
+-- Pgvector
+-- Microsoft.Extensions.Logging.Abstractions
+-- Microsoft.Extensions.Options
Strategos.Ontology.Embeddings
+-- Strategos.Ontology
+-- Microsoft.Extensions.Http
+-- Microsoft.Extensions.Logging.Abstractions
+-- Microsoft.Extensions.Options
Strategos.Ontology.MCP
+-- Strategos.Ontology
+-- Microsoft.Extensions.Logging.Abstractions
Strategos.Ontology.MCP.Hosting
+-- Strategos.Ontology.MCP
+-- ModelContextProtocol
Strategos.Rag [deprecated]
+-- Strategos.Agents
+-- Microsoft.Extensions.DependencyInjection.Abstractions