TheSingularityWorkshop.ProtocolAi 0.1.0-alpha.1

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

TheSingularityWorkshop.ProtocolAi

License: MIT NuGet version NuGet downloads Build Code Coverage

The lexicon layer for self-defining, integer-backed AI protocols.

AI systems are becoming very good at producing structured data. ProtocolAI asks a different question:

What happens when the vocabulary itself becomes compact, addressable, self-describing, and owned by the tool that needs it?

A tool can define:

[1001] People

[2001] bobId  = "Bob"
[2002] ryanId = "Ryan"
[2003] saraId = "Sara"
[2004] janeId = "Jane"
[2005] jackId = "Jack"
[2006] jillId = "Jill"

The model-facing representation can then become:

[2001] [2004] [2006]

And when an interaction introduces something new:

[2001] [2004] "New Character"

The literal is not a failure. It is a possible new semantic identity.


WHAT is this?

ProtocolAI is the WHAT layer.

But there is a deeper reason to use it: ProtocolAI is a funnel for probabilistic data into a nonprobabilistic application representation.

An LLM is probabilistic. The application does not have to be.

                 PROBABILISTIC
                 model output
                       |
                       v
              +------------------+
              |    ProtocolAI    |
              |  lexical funnel  |
              +------------------+
                 |            |
              known         literal
                 |            |
                 v            v
          integer identity  creation
                 |
                 v
          NONPROBABILISTIC
          application state

ProtocolAI does not make the model deterministic. It creates a deterministic boundary after the model: once a value is resolved against a tool-owned vocabulary, the application can operate on the identity it owns rather than continuing to interpret free-form language.

It defines a self-describing lexicon without owning the LLM, prompt transport, tokenizer, model, or execution environment.

Tool
 |
 | defines vocabulary
 v
+----------------------+
|      ProtocolAI      |
|        WHAT          |
|                      |
| [1001] People        |
| [2001] Bob           |
| [2002] Jane          |
+----------+-----------+
           |
           v
    AI-facing host
           |
           v
          LLM

The package supplies the form of the vocabulary. The tool supplies its meaning.


Why integer-backed?

A string carries meaning directly. An integer can carry identity.

ProtocolAI separates:

Layer Example Role
Protocol identity [1001] Vocabulary namespace
Symbol identity [2001] Entry address
Symbol name bobId Human-facing identifier
Value "Bob" Human/domain meaning

The integer is not the meaning.

It is the address of the meaning.

That makes it possible to describe a vocabulary once and subsequently exchange compact references to its members.


Known values and new values

The current API deliberately distinguishes known values from literals:

var people = new ProtocolBuilder(1001, "People")
    .Define(2001, "bobId", "Bob")
    .Define(2002, "janeId", "Jane")
    .Build();

var payload = people.Encode([
    "Bob",
    "Jane",
    "New Character"
]);

Conceptually:

Bob              -> [2001]
Jane             -> [2002]
New Character    -> "New Character"

This creates a useful lifecycle:

known value
    |
    v
integer reference

unknown value
    |
    v
literal
    |
    v
creation / registration
    |
    v
future integer reference

The alpha does not yet decide how permanent symbol allocation or registration should work. That is an architectural question, not something to hide inside the first version.


Self-definition

A protocol can describe itself:

Console.WriteLine(people.Describe());
[1001] People
  [2001] bobId = "Bob"
  [2002] janeId = "Jane"

The receiving side does not need a hard-coded global dictionary of every domain.

A tool defines its own nomenclature.

That is the key property:

ProtocolAI defines the mechanism for defining a lexicon, not the lexicon itself.


WHAT before HOW

ProtocolAI and GrammarAI are intentionally separate.

ProtocolAI asks:

What does this symbol mean?

GrammarAI asks:

How may these symbols be connected?

ProtocolAI
    |
    | WHAT
    v
GrammarAI
    |
    | HOW
    v
AI-facing host
    |
    v
   LLM

ProtocolAI does not need to own grammar construction.

GrammarAI does not need to own the vocabulary it references.


Why this matters now

Current AI platforms increasingly expose structured outputs, schemas, function calling, and constrained generation. OpenAI's current documentation describes Structured Outputs as schema-adherent generation, while its function-calling documentation also describes context-free grammars as a way to constrain model output. OpenAI Structured Outputs and Function Calling

ProtocolAI sits at a different semantic layer.

schema / grammar
      |
      v
structured representation
      |
      v
ProtocolAI vocabulary
      |
      v
integer-backed references

The goal is not to replace JSON Schema or model-specific constrained decoding.

The goal is to explore what happens when the application's own semantic vocabulary becomes an explicit, addressable protocol.


What belongs here

ProtocolAI owns:

  • protocol identity;
  • symbol identity;
  • symbolic names;
  • human-readable values;
  • string-to-integer encoding;
  • integer-to-string decoding;
  • mixed integer/literal payloads;
  • deterministic self-description.

ProtocolAI does not own:

  • LLM clients;
  • model selection;
  • tokenization;
  • prompting policy;
  • inference;
  • transport;
  • tool execution;
  • grammar composition;
  • MicroBundle hosting;
  • REST/OpenAPI;
  • GUI manifestation.

Those belong to other layers.


Core API

ProtocolBuilder

Defines a vocabulary before publishing its immutable definition.

ProtocolDefinition

Immutable, self-describing protocol definition.

ProtocolSymbol

One named value in the vocabulary.

ProtocolReference

Stable reference to a symbol inside a protocol.

ProtocolValue

Either an integer-backed reference or a literal string.

ProtocolPayload

Ordered values suitable for model-facing protocol transport.


The larger thesis

The intended progression is:

strings
   |
   v
named symbols
   |
   v
integer identities
   |
   v
self-describing vocabulary
   |
   v
grammar
   |
   v
structured protocol
   |
   v
tool / experience

ProtocolAI occupies the first major boundary:

meaning becomes addressable.

GrammarAI occupies the next:

addresses become composable.


Current alpha boundary

Version: 0.1.0-alpha.1

The current release establishes:

  • self-defining protocol vocabularies;
  • integer-backed symbol identity;
  • known-value encoding;
  • literal fallback for unknown values;
  • integer decoding;
  • deterministic protocol descriptions.

It does not yet establish:

  • wire-level serialization;
  • dynamic symbol registration;
  • persistent allocation;
  • cross-protocol negotiation;
  • compatibility/version negotiation;
  • grammar compilation;
  • model-specific adapters;
  • constrained decoding.

See:


Workshop architecture

ProtocolAI is deliberately independent of FSM execution, REST transport, GUI rendering, and MicroBundle hosting.

             AI / Experience
                    |
          +---------+---------+
          |                   |
      GrammarAI           tool host
          |                   |
      ProtocolAI <------------+
          |
     integer lexicon
          |
     domain meaning

The package should remain the form of the lexicon rather than becoming a warehouse for every AI integration.


Development

dotnet restore TheSingularityWorkshop.ProtocolAi.slnx
dotnet build TheSingularityWorkshop.ProtocolAi.slnx --configuration Release
dotnet test tests/ProtocolAi.Tests/ProtocolAi.Tests.csproj --configuration Release
dotnet pack TheSingularityWorkshop.ProtocolAi.csproj --configuration Release --output ./artifacts

The public package workflow runs on every push to master: it restores, builds, tests with coverage, packs the NuGet artifact, and publishes it through NuGet Trusted Publishing. It can also be dispatched manually.


Documentation


License

MIT. See LICENSE.txt.


🔗 Resources & Support

<p align="center"> <a href="https://github.com/TrentBest/FSM_API"> <img src="https://raw.githubusercontent.com/TrentBest/FSM_API/master/Documentation/Branding/TheSingularityWorkshop.png" alt="The Singularity Workshop" height="200"> </a> </p>

<p align="center"> <em>The Singularity Workshop — Tools for the curious, the bold, and the systemically inclined.</em><br> <strong>Because state shouldn't be a mess.</strong> </p>

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 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TheSingularityWorkshop.ProtocolAi:

Package Downloads
TheSingularityWorkshop.Renderer

Observer-aware rendering foundations built around Event Horizons and computational detail.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.2 7,386 9/29/2026
0.1.0-alpha.1 84 9/28/2026

Initial alpha: self-defining protocol vocabularies, integer references, mixed integer/literal payloads, and deterministic protocol descriptions.