FieldCure.Ai.Execution
0.1.0
See the version list below for details.
dotnet add package FieldCure.Ai.Execution --version 0.1.0
NuGet\Install-Package FieldCure.Ai.Execution -Version 0.1.0
<PackageReference Include="FieldCure.Ai.Execution" Version="0.1.0" />
<PackageVersion Include="FieldCure.Ai.Execution" Version="0.1.0" />
<PackageReference Include="FieldCure.Ai.Execution" />
paket add FieldCure.Ai.Execution --version 0.1.0
#r "nuget: FieldCure.Ai.Execution, 0.1.0"
#:package FieldCure.Ai.Execution@0.1.0
#addin nuget:?package=FieldCure.Ai.Execution&version=0.1.0
#tool nuget:?package=FieldCure.Ai.Execution&version=0.1.0
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 |
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
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. |
-
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.
# Release Notes — FieldCure.Ai.Execution
## v0.1.0
- Initial release — agent loop and sub-agent execution engine
- `AgentLoop`: autonomous LLM tool-use loop (prompt - model call - tool execution - repeat)
- `SubAgentExecutor`: isolated sub-agent sessions with timeout management
- `ContextHintKeys` + `SystemPromptHints`: context propagation (RAG kb_id, etc.)
- Models: `SubAgentRequest`, `SubAgentResult`, `AgentLoopContext`, `AgentLoopResult`
- Depends on `FieldCure.Ai.Providers` only (no MCP SDK dependency)