Cohesive.AI 0.1.0-alpha.102

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

Cohesive.AI

AI-oriented semantic contracts for inference, training, vector storage, text processing, tokenization, ontology modeling, and model registries.

Install

dotnet add package Cohesive.AI

Use When

  • You need provider-neutral contracts for embeddings, pair scoring, graph scoring, feature-vector scoring, or model training.
  • You want to model semantic concepts, ontologies, closure rules, and concept grounding.
  • You need reusable text/token utilities or vector store abstractions without taking a specific cloud or model runtime dependency.

Example

Ontology interchange

Ontology and its existing rule records remain the semantic authority. OntologyJson.SerializeCanonical writes their normalized representation, including every concrete rule payload; OntologyJson.Deserialize reads that complete representation. Rules use a kind discriminator declared on OntologyRule. This also preserves rule payloads when an ontology is serialized with ordinary System.Text.Json.

var json = OntologyJson.SerializeCanonical(ontology);
var restored = OntologyJson.Deserialize(json);
OntologyValidator.Validate(restored); // after assembling any externally referenced ontology slices

The wire profile uses camel-case properties, strict string enums, ordinal object-key ordering, and the shared StrictDocumentJson canonical number representation. Existing ontology constructors own rule and relation normalization; the codec does not define another model or normalization catalog. Serializer metadata is frozen and reused; ontology values and canonical payloads are never globally cached.

Reads accept different whitespace and object-key order but reject unknown fields/kinds, duplicate properties, omitted defaults, and content that constructor normalization would discard or change. Use the writer to materialize the complete interchange representation from authored models. Malformed wire data throws JsonException with the shared wire failure classification and location. Concept dictionary keys must match concept identities in both Debug and Release builds. Referential validation remains a separate step so an ontology slice can retain references resolved by an application import graph.

This introduces a rule-preserving wire contract: older JSON that encoded rules as {} cannot recover their lost meanings and must be regenerated from its semantic source. Existing fingerprints obtained from that older serialization must also be regenerated and reviewed. Applications own revision identity, hash profile/version, tenant isolation, import resolution, persistence, and immutable publication policy.

OntologyJsonTests covers every concrete rule kind, scoped-meaning closure behavior, canonical order, rule-sensitive SHA-256 evidence, malformed/lossy inputs, and unresolved reference preservation.

Ontology authoring

using Cohesive.AI.Semantics;

var ontology = new OntologyBuilder()
    .AddConcept(new("party.role", "Party Role"))
    .AddConcept(new("party.ship-to", "Ship To"))
    .AddParent(childConceptId: "party.ship-to", parentConceptId: "party.role")
    .AddScopedMeaning(scope: "edi.n101", symbol: "ST", conceptId: "party.ship-to")
    .Build();

var closure = OntologyClosure.Create(ontology);
var isPartyRole = closure.IsSubConceptOf("party.ship-to", "party.role");

Reconciliable training submissions

Training submission is identified independently of any physical attempt. Bind the workflow's stable logical identity to the exact request once, then use the same submission for dispatch and ambiguity recovery:

using Cohesive.AI.Training;

var submission = new TrainingJobSubmission(
    submissionId: "tenant/acme/training-run/42/submission",
    request: trainingRequest);

var job = await trainer.SubmitAsync(submission, cancellationToken);
var reconciliation = await trainer.ReconcileSubmissionAsync(submission, cancellationToken);

TrainingJobSubmission snapshots dataset bindings and derives a versioned request fingerprint. Dataset bindings are canonicalized by their ordinal names because list order is not provider meaning; duplicate names are rejected. Every other request value, including provider configuration text, participates exactly. An adapter must return the same provider job for a repeated identity and fingerprint, and must throw TrainingJobSubmissionConflictException when the identity is already bound to different or missing request evidence.

Reconciliation returns one closed result: Accepted, ConfirmedAbsent, or Unresolved. A workflow may safely retry only according to its durable recovery policy and the returned evidence; physical attempt identity must not replace the stable logical submission identity.

Reconciliable training cancellation

Training cancellation is a provider capability separate from cancelling the caller's wait. A workflow binds its stable cancellation-operation identity to the accepted provider job and invokes the stronger trainer capability:

var cancellation = new TrainingJobCancellation(
    cancellationId: "tenant/acme/training-run/42/cancel/1",
    jobId: job.JobId);

if (trainer is not ICancellableModelTrainer cancellableTrainer)
    throw new InvalidOperationException("The selected trainer cannot cancel accepted provider jobs.");

var cancellationResult = await cancellableTrainer.CancelAsync(cancellation, cancellationToken);

Accepted means only that the provider accepted cancellation; it is not proof that the job is terminal. Continue observing the job until it reports Cancelled, Completed, or Failed. AlreadyTerminal retains that exact provider-owned state so a cancellation race cannot overwrite success or failure. NotFound, Rejected, and Unresolved remain distinct recovery evidence. A provider's intermediate cancellation state is represented as TrainingJobStatus.CancellationRequested, not collapsed into Running.

An implementation must treat the same cancellation identity and job identity as one logical operation. If it observes that cancellation identity already bound to another job, it throws TrainingJobCancellationConflictException. Cancelling the method's CancellationToken only stops the caller's wait; it never asserts that the provider job stopped.

  • Cohesive.Adapters.AzureML for Azure Machine Learning training integration.
  • Cohesive.Adapters.AzureStorage for training artifacts and dataset output streams backed by Azure Blob Storage.
  • Cohesive.Adapters.ONNX and Cohesive.Adapters.MicrosoftML for concrete inference/tokenization integrations.
Product 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.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Cohesive.AI:

Package Downloads
Cohesive.Adapters.AzureStorage

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Adapters.AzureML

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Adapters.Cosmos

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Adapters.GitHub

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Adapters.ONNX

Cohesive semantic system definition and orchestration building blocks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.113 0 9/24/2026
0.1.0-alpha.112 8 9/23/2026
0.1.0-alpha.111 36 9/23/2026
0.1.0-alpha.110 35 9/23/2026
0.1.0-alpha.109.1 51 9/23/2026
0.1.0-alpha.109 36 9/23/2026
0.1.0-alpha.108 67 9/21/2026
0.1.0-alpha.107 63 9/21/2026
0.1.0-alpha.106 59 9/21/2026
0.1.0-alpha.105 59 9/21/2026
0.1.0-alpha.104 76 9/21/2026
0.1.0-alpha.103 64 9/21/2026
0.1.0-alpha.102 77 9/21/2026
0.1.0-alpha.101 67 9/21/2026
0.1.0-alpha.100 71 9/20/2026
0.1.0-alpha.99 69 9/20/2026
0.1.0-alpha.98 71 9/19/2026
0.1.0-alpha.97 116 9/19/2026
0.1.0-alpha.96 97 9/19/2026
0.1.0-alpha.95 87 9/18/2026
Loading failed