Universal.Operative.Sdk.Discrete 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Universal.Operative.Sdk.Discrete --version 3.0.0
                    
NuGet\Install-Package Universal.Operative.Sdk.Discrete -Version 3.0.0
                    
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="Universal.Operative.Sdk.Discrete" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Universal.Operative.Sdk.Discrete" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Universal.Operative.Sdk.Discrete" />
                    
Project file
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 Universal.Operative.Sdk.Discrete --version 3.0.0
                    
#r "nuget: Universal.Operative.Sdk.Discrete, 3.0.0"
                    
#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 Universal.Operative.Sdk.Discrete@3.0.0
                    
#: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=Universal.Operative.Sdk.Discrete&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Universal.Operative.Sdk.Discrete&version=3.0.0
                    
Install as a Cake Tool

Universal.Operative.Sdk.Discrete

Provider-neutral conversations, model streams, tools, transforms, turn coordination, and durable conversation chronologies.

Install

dotnet add package Universal.Operative.Sdk.Discrete

Use a provider package such as Universal.Operative.Sdk.Discrete.OpenAI or Universal.Operative.Sdk.Discrete.Anthropic to supply an IModel.

Run a turn

using Universal.Operative.Sdk;
using Universal.Operative.Sdk.Discrete;

IEngine engine = EngineBuilder.FromDefaults(model)
    .AddBaselineToolSet()
    .Build();

var conversation = new Conversation
{
    Messages =
    {
        new Message
        {
            Role = MessageRoles.User,
            Content = { new TextBlock("Inspect this repository.") },
        },
    },
};

ConversationManager manager = await ConversationManager.CreateAsync(conversation);

await foreach (EngineEvent engineEvent in engine.ExecuteAsync(
    new ExecutionContext(new TurnContext()), manager))
{
    if (engineEvent is AssistantMessageEvent response)
        Console.WriteLine(response.Message);
}

Engine streams model output, dispatches tools, applies transforms, and records turn and model-call audit facts through the conversation manager.

Persist and resume

The host owns the repository and its lifetime. ConversationManager owns one mutable materialization and moves one named head.

var repositoryOptions = new FileSystemConversationRepositoryOptions
{
    Directory = conversationDirectory,
    ChronologyId = conversationId,
};

await using FileSystemConversationRepository repository =
    await FileSystemConversationRepository.OpenOrCreateAsync(repositoryOptions);

ConversationManager manager = await ConversationManager.OpenOrCreateAsync(
    repository,
    () => new Conversation { Id = conversationId });

IOperative operative = OperativeBuilder.Create(engine, manager)
    .WithChronologyCompactor(new SizeLimitedChronologyCompactor(new()
    {
        MaximumBytes = 256L * 1024 * 1024,
    }))
    .Build();

Use FileSystemConversationRepository.CreateAsync when the chronology must be new, OpenAsync when it must exist, and OpenOrCreateAsync for either state. A filesystem repository permits one open writer.

chronology.jsonl contains ordered audit facts. Immutable content-addressed objects store conversation snapshots and messages. Unchanged messages are shared across revisions.

Branch and restore

Every revision records its ordered parents and exact conversation snapshot. A named head may be reset or forked without changing earlier revisions.

ConversationManager alternative = await manager.ForkAsync(
    earlierRevisionId,
    headName: "alternative");

await alternative.ResetAsync(otherRevisionId);
Conversation restored = alternative.Current;

Use ReadChronologyAsync to inspect revisions, named heads, turn outcomes, model invocations, and host-defined CustomChronologyEvent values.

Bound storage

IChronologyCompactor defines lossy chronology compaction for repositories that implement ICompactableConversationRepository.

  • SizeLimitedChronologyCompactor retains the largest recent reachable revision window within a byte limit.
  • RevisionWindowChronologyCompactor retains a configured number of recent reachable revisions.
  • CheckpointChronologyCompactor retains only revisions referenced by named heads.
  • FileSystemConversationRepository.ApplyRetentionAsync deletes old payloads while retaining the audit graph.

Compactors preserve every named head. A result reports when the requested byte target cannot be met by the required heads alone.

Main abstractions

  • Conversation is mutable state supplied to a model.
  • ConversationManager materializes revisions and moves one named head.
  • IConversationRepository stores immutable revisions and chronology events.
  • Chronology is the audit read model.
  • IModel maps a provider to provider-neutral stream events.
  • Engine runs one turn.
  • Operative coordinates concurrent submissions.
  • ITransformer derives replacement conversation or turn-context state.

License

Free for noncommercial use under the Universal.Operative Noncommercial License. Commercial use requires a separate license from Andrew Ong.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.

NuGet packages (20)

Showing the top 5 NuGet packages that depend on Universal.Operative.Sdk.Discrete:

Package Downloads
Universal.Operative.Sdk.Discrete.OpenAI

OpenAI Chat Completions and Responses API adapters for Universal.Operative.Sdk.Discrete.

Universal.Operative.Sdk.Discrete.Anthropic

Anthropic Messages API adapter for Universal.Operative.Sdk.Discrete.

Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk

Claude Agent SDK model adapter for Universal.Operative.Sdk.Discrete.

Universal.Operative.Sdk.Scheduling

Durably schedule a prompt to fire into a Universal.Operative.Sdk IOperative at a future time, either once or on a recurring cron schedule — it fires even if this process wasn't running when the schedule came due. ScheduleCreate/List/Cancel tools (backed by a shared ScheduleService, reusable from an HTTP-facing admin surface too) durably register atomically on creation, roll back on failure. IDurableScheduleBackend implementations: WindowsTaskSchedulerBackend/SystemdTimerBackend/CrontabBackend register with the OS's own scheduler; HttpDurableScheduleBackend registers against a remote HTTP dispatcher instead, for hosts (e.g. a sandboxed PaaS container) with no local OS scheduler reachable at all. Every backend is fully configured at construction — RegisterAsync just needs the schedule.

Universal.Operative.Sdk.Discrete.OpenAI.ChatGpt

ChatGPT Responses adapter for Universal.Operative.Sdk.Discrete.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.1 435 10/2/2026
3.1.0 501 9/17/2026
3.0.0 471 9/7/2026
2.4.1 127 9/5/2026
2.3.0 120 9/5/2026
2.2.1 200 9/4/2026
2.2.0 119 9/4/2026
2.1.0 241 9/3/2026
2.0.1 311 9/2/2026
2.0.0 452 9/1/2026
1.2.0 373 8/26/2026
1.1.0 199 8/24/2026
1.0.0 327 8/12/2026

Provides immutable conversation revisions, named heads, durable chronologies, bounded storage compaction, and provider invocation auditing.