Cohesive.AI
0.1.0-alpha.98
See the version list below for details.
dotnet add package Cohesive.AI --version 0.1.0-alpha.98
NuGet\Install-Package Cohesive.AI -Version 0.1.0-alpha.98
<PackageReference Include="Cohesive.AI" Version="0.1.0-alpha.98" />
<PackageVersion Include="Cohesive.AI" Version="0.1.0-alpha.98" />
<PackageReference Include="Cohesive.AI" />
paket add Cohesive.AI --version 0.1.0-alpha.98
#r "nuget: Cohesive.AI, 0.1.0-alpha.98"
#:package Cohesive.AI@0.1.0-alpha.98
#addin nuget:?package=Cohesive.AI&version=0.1.0-alpha.98&prerelease
#tool nuget:?package=Cohesive.AI&version=0.1.0-alpha.98&prerelease
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.
Related Packages
Cohesive.Adapters.AzureMLfor Azure Machine Learning training integration.Cohesive.Adapters.AzureStoragefor training artifacts and dataset output streams backed by Azure Blob Storage.Cohesive.Adapters.ONNXandCohesive.Adapters.MicrosoftMLfor concrete inference/tokenization integrations.
| 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. |
-
net10.0
- Cohesive (>= 0.1.0-alpha.98)
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 | 43 | 9/24/2026 |
| 0.1.0-alpha.112 | 50 | 9/23/2026 |
| 0.1.0-alpha.111 | 53 | 9/23/2026 |
| 0.1.0-alpha.110 | 50 | 9/23/2026 |
| 0.1.0-alpha.109.1 | 60 | 9/23/2026 |
| 0.1.0-alpha.109 | 46 | 9/23/2026 |
| 0.1.0-alpha.108 | 73 | 9/21/2026 |
| 0.1.0-alpha.107 | 67 | 9/21/2026 |
| 0.1.0-alpha.106 | 65 | 9/21/2026 |
| 0.1.0-alpha.105 | 65 | 9/21/2026 |
| 0.1.0-alpha.104 | 82 | 9/21/2026 |
| 0.1.0-alpha.103 | 69 | 9/21/2026 |
| 0.1.0-alpha.102 | 85 | 9/21/2026 |
| 0.1.0-alpha.101 | 74 | 9/21/2026 |
| 0.1.0-alpha.100 | 79 | 9/20/2026 |
| 0.1.0-alpha.99 | 73 | 9/20/2026 |
| 0.1.0-alpha.98 | 75 | 9/19/2026 |
| 0.1.0-alpha.97 | 116 | 9/19/2026 |
| 0.1.0-alpha.96 | 98 | 9/19/2026 |
| 0.1.0-alpha.95 | 87 | 9/18/2026 |