FieldCure.Ai.Execution
0.2.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package FieldCure.Ai.Execution --version 0.2.0
NuGet\Install-Package FieldCure.Ai.Execution -Version 0.2.0
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="FieldCure.Ai.Execution" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FieldCure.Ai.Execution" Version="0.2.0" />
<PackageReference Include="FieldCure.Ai.Execution" />
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 FieldCure.Ai.Execution --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FieldCure.Ai.Execution, 0.2.0"
#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 FieldCure.Ai.Execution@0.2.0
#: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=FieldCure.Ai.Execution&version=0.2.0
#tool nuget:?package=FieldCure.Ai.Execution&version=0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FieldCure.Ai.Execution
Agent loop and sub-agent execution engine for autonomous LLM tool-use workflows.
Components
| Class | Description |
|---|---|
IAgentLoop / AgentLoop |
Prompt - model call - tool execution - repeat loop |
ISubAgentExecutor / SubAgentExecutor |
Isolated sub-agent sessions with context propagation |
AgentLoopContext |
Loop input: provider, system prompt, tools, guards |
AgentLoopResult |
Loop output: status, summary, tool call count, messages |
SubAgentRequest |
Sub-agent task definition with ContextHints |
SubAgentResult |
Sub-agent report, status, duration |
ContextHintKeys |
Well-known keys for context propagation (kb_id, etc.) |
SystemPromptHints |
Converts ContextHints to system prompt fragments |
Quick Start
AgentLoop (standalone)
using FieldCure.Ai.Execution;
using FieldCure.Ai.Providers;
using FieldCure.Ai.Providers.Models;
var loop = new AgentLoop();
var result = await loop.RunAsync(new AgentLoopContext
{
Provider = myProvider, // IAiProvider instance
SystemPrompt = "You are helpful.",
UserPrompt = "Summarize this document.",
Tools = [searchTool, readTool], // IAssistTool list
MaxRounds = 10,
});
Console.WriteLine(result.Summary); // Last assistant message
Console.WriteLine(result.Status); // Completed, MaxRoundsReached, Failed
Console.WriteLine(result.Messages); // Full conversation for audit logging
SubAgentExecutor
using FieldCure.Ai.Execution;
using FieldCure.Ai.Execution.Models;
var executor = new SubAgentExecutor(
agentLoop: new AgentLoop(),
resolveProvider: preset => ProviderFactory.Create(preset),
resolveTools: (servers, allowed, ct) => BootstrapMcpTools(servers, allowed, ct),
defaultPresetName: "Claude"
);
var result = await executor.ExecuteAsync(new SubAgentRequest
{
Prompt = "Research competitor news and write a report.",
McpServers = ["builtin_essentials"],
AllowedTools = ["http_request"],
MaxRounds = 10,
Timeout = TimeSpan.FromMinutes(2),
ContextHints = new Dictionary<string, string>
{
[ContextHintKeys.KbId] = "my-kb-uuid", // RAG kb_id propagation
},
});
Console.WriteLine(result.Report); // Sub-agent's final report
Console.WriteLine(result.Status); // Completed, TimedOut, MaxRoundsReached, Failed
Design Principles
- AgentLoop is pure - no timeout, no retry, no MCP. Just CancellationToken.
- Timeout is the caller's responsibility (CancelAfter + catch OperationCanceledException).
- Retry is the caller's responsibility (wrap IAiProvider or handle externally).
- MCP bootstrapping stays in the consumer (Runner, AssistStudio Core).
- ContextHints are resolved by SubAgentExecutor into system prompt text. AgentLoop never sees them.
Dependencies
FieldCure.Ai.Providers(IAiProvider, IAssistTool, AiRequest, AiResponse, ChatMessage)
License
MIT
| Product | Versions 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
- FieldCure.Ai.Providers (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v0.2.0: AgentLoopResult.Messages — expose full conversation history for audit trails and execution logging.