IntentSharp · For .NET

Typed, checked AI calls for .NET.

IntentSharp lets developers express application behavior as intent, apply it to ordinary .NET values and methods, and move changeable rules into external files. Our estimate for a typical business application is 20 to 40% less C# code.

20–40%

less C# code in a typical business application

Estimate

Overview

An intent, checked against your types and rules.

IntentSharp is a .NET library from C2Consultants: express application behavior as intent, keep changeable rules in external files, and check every AI answer against your types and rules.

Runtimes
.NET 8, 9 and 10
Price
From $349 per developer per year
Evaluation
Free for 30 days
Release
1.0 on NuGet
var email = "Hi, this is Dana from Northwind. We'd like 40 units of SKU A-1192 delivered by 2026-11-15.";
var options = new AIRequestOptions()
    .Require<PurchaseRequest>(r => r.Quantity > 0, "Quantity must be a positive number.");
var order = await client.TransformAsync<PurchaseRequest>(email, "Extract the purchase request from this email.", options);
The sample from the IntentSharp quickstart.

Three steps

How it works

  1. State an intent

    Your code states an intent in plain words: on a value (text, a record, a list, a DataTable or JSON), or in an [AIIntent] method that replaces one interpretation step inside a method you already have.

  2. Checked, retried, kept

    IntentSharp sends the intent and its input to the model you configure, checks the answer against your .NET type and your rules, and retries with the findings when it fails them, within the limits you set. Every attempt is kept. A pass means the checks passed, not that the answer is right.

  3. Rules in files

    Wording and rules can live in a JSON or YAML intent file. Save it and the next call uses it, with no release; a bad save keeps the last good version while the app runs. A new .NET result type, a new named code check, or code that calls a new intent by name still needs a release.

The estimate

Less of your own machinery

20–40%

less C# code in a typical business application

Estimate

The library ships the parse, check, retry and fallback loop, catalog loading with hot reload, versions and revert, and one options surface for every call. You do not write these.

Our estimate for a typical business application is 20 to 40% less C# code, which also means less context for the coding agents and models that read it. It is an estimate, not a measurement.

One method

How it fits

IntentSharp is the program scale of our method, Cognitive Infrastructure: a program exposes its meaning as definitions people and programs can read.

C2Empowered, our operations platform, is built on IntentSharp and applies the same separation across an organization's work. Teams that build their own .NET applications use IntentSharp; teams that need work done across systems they do not build use C2Empowered.

Facts

Specifications

Runtimes
.NET 8, 9 and 10
Providers
OpenAI, Anthropic, any Microsoft.Extensions.AI IChatClient, or a local model on Ollama
Packages
IntentSharp, IntentSharp.Catalog, IntentSharp.Extensions.AI: one version
Agents
Catalog intents as Microsoft Agent Framework AIFunction tools, each answer checked before the agent sees it
Licence check
Offline
Data
Only to the model providers you configure
Licence
Commercial, not open source. From $349 per developer per year, unlimited deployments
Evaluation
Free for 30 days on development and test systems. Business use needs a paid licence after that; production use needs one from the first day

Install

dotnet add package IntentSharp

Read the docs →