Frontmatec.AI.Tools 0.0.7

dotnet add package Frontmatec.AI.Tools --version 0.0.7
                    
NuGet\Install-Package Frontmatec.AI.Tools -Version 0.0.7
                    
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="Frontmatec.AI.Tools" Version="0.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Frontmatec.AI.Tools" Version="0.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Frontmatec.AI.Tools" />
                    
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 Frontmatec.AI.Tools --version 0.0.7
                    
#r "nuget: Frontmatec.AI.Tools, 0.0.7"
                    
#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 Frontmatec.AI.Tools@0.0.7
                    
#: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=Frontmatec.AI.Tools&version=0.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Frontmatec.AI.Tools&version=0.0.7
                    
Install as a Cake Tool

Frontmatec.AI

LLM agents, tools, prompts, and threads for building AI-powered .NET applications.

This repo ships two NuGet packages and is also browsable on GitHub:

  • Frontmatec.AI — core agent loop, prompt templates, thread persistence, and provider clients (Anthropic, OpenAI, Gemini, Ollama).
  • Frontmatec.AI.Windows — WPF chat, thread list, and tool-approval views built on Frontmatec.Windows.

A small WPF test app (WINAI) wires both packages together as a reference.

API keys

Provider API keys are read from AI:Clients:{Provider}:ApiKey in IConfiguration. The test app pattern: declare the keys in appsettings.json with empty values, then override them in appsettings.Development.local.json (gitignored). Ollama runs locally and needs no key.

// appsettings.Development.local.json
{
  "AI": {
    "Clients": {
      "Anthropic": { "ApiKey": "sk-ant-..." },
      "OpenAI":    { "ApiKey": "sk-proj-..." },
      "Gemini":    { "ApiKey": "AIza..." }
    }
  }
}

Roadmap

Two known gaps in the agent loop. Neither blocks current usage; both are pure additions.

Transient-error retry/backoff

The agent loop currently surfaces any client-side failure (429, 503, 529 overload, socket timeout) as a single LlmAgentClientErrorEvent and ends the turn — the host has to retry the whole user turn.

Plan: add retry at the HTTP layer, not the agent layer, so each provider client (AnthropicClient, OpenAIClient, GeminiClient, OllamaClient) retries with exponential backoff on transient signals before the first chunk is read (the only safe window for a streaming response — once a delta has been yielded to the UI, replaying would duplicate text). Options live per-client alongside TimeoutMinutes:

"AI": {
  "Clients": {
    "Anthropic": {
      "Retry": { "MaxAttempts": 3, "BaseDelayMs": 500 }
    }
  }
}

Polly is the obvious dependency, but a ~10-line Task.Delay exponential-backoff wrapper inside each *Client.StreamAsync is enough at this scale.

Extended / interleaved thinking

Claude 4.x supports two reasoning features the loop doesn't currently expose:

  • Extended thinking — opt-in per request via "thinking": { "type": "enabled", "budget_tokens": 8000 }. The model emits a separate thinking content-block stream before its visible answer. Costs extra output tokens; buys noticeably better quality on multi-step reasoning, math, and ambiguous tool selection.
  • Interleaved thinking — header-gated (anthropic-beta: interleaved-thinking-2025-05-14). Lets the model think between tool calls in a ReAct loop, not just once at turn start. With real tool feedback in scope, the model can reason about whether the result answers the question or whether a different tool is needed.

Plan: add ThinkingBudgetTokens and InterleavedThinking to LlmStreamOptions, wire them into the Anthropic client's request body and header. The loop itself only needs a new chunk type (LlmThinkingChunk) forwarded as LlmAgentThinkingDeltaEvent so hosts can render a collapsible "reasoning" block.

Tradeoff: higher time-to-first-visible-token and higher cost. The right shape is per-role, default off — leave Default alone, opt in via a future Reasoning role or a per-turn override for hard tasks.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.7 0 5/27/2026
0.0.6 0 5/27/2026
0.0.5 45 5/26/2026
0.0.4 38 5/26/2026
0.0.3 50 5/22/2026