How thangchung/agent-engineering-experiment works
Repository Shape and Entry Points
This is a workspace of independent samples/prototypes, not one deployable application; the root README is empty and there is no root solution. Each top-level project owns its runtime and deployment model. Primary .NET entry points include DotNetClaw/DotNetClaw/Program.cs, foundry-agentfx/apphost.cs, loop-runtime/src/LoopRuntime.AppHost/Program.cs, mcp-experiments/src/AppHost/Program.cs, and context-engineering-dotnet/src/ContextEngineering.Api/Program.cs. A separate Next.js storefront starts from myshop-claude-code/app/page.tsx.
Agent Runtime and Channel Pattern
DotNetClaw is a compact agent host: a runtime loads agent “mind” instructions and exposes Slack and web channels. Its core control path is host startup → runtime → tools/memory/skills → channel response.
• Runtime and telemetry: DotNetClaw/DotNetClaw/ClawRuntime.cs, DotNetClaw/DotNetClaw/ClawTelemetry.cs
• Input/output boundaries: DotNetClaw/DotNetClaw/SlackChannel.cs, DotNetClaw/DotNetClaw/WebChannel.cs
• Agent state/prompt assets: DotNetClaw/DotNetClaw/mind/SOUL.md, DotNetClaw/DotNetClaw/mind/.working-memory/memory.md
Foundry Coffeeshop Distributed Agent
foundry-agentfx decomposes the same broad pattern into services: channels route requests to an agent; the agent invokes a coffeeshop workflow and discovers tools through a gateway; an MCP service implements coffeeshop operations.
• Agent execution: foundry-agentfx/src/Claw.Agent/Program.cs, foundry-agentfx/src/Claw.Agent/Agents/CoffeeshopWorkflow.cs
• Channel-to-agent client boundary, including local versus Foundry-backed clients: foundry-agentfx/src/Claw.Channels/Program.cs, foundry-agentfx/src/Claw.Channels/FoundryAgentClient.cs
• Tool search/registration: foundry-agentfx/src/ToolSearch.Gateway/Program.cs, foundry-agentfx/src/ToolSearch.Gateway/Registry/ToolRegistry.cs
• MCP business tools: foundry-agentfx/src/Coffeeshop.Mcp/Program.cs, foundry-agentfx/src/Coffeeshop.Mcp/Tools/OrderTools.cs
Azure Foundry, Azure AI Search, Storage, Application Insights, Log Analytics, Container Apps, and container registry are provisioned through foundry-agentfx/infra/main.bicep.
Agent Gateway with OBO Identity
agentgateway-entraid-obo is a Todo-oriented reference architecture for delegated identity across API, agent, MCP server, and gateway. The Todo API accepts client requests and delegates through an IAgentGateway; the agent uses an LLM description generator and an MCP todo sink; the MCP service persists todos via EF Core.
• Public API/gateway adapters: agentgateway-entraid-obo/src/AgenticTodo.TodoApi/Program.cs, agentgateway-entraid-obo/src/AgenticTodo.TodoApi/Adapters/OboAgentGateway.cs
• Agent domain and feature orchestration: agentgateway-entraid-obo/src/AgenticTodo.TodoAgent/Features/CreateTodo/CreateTodoHandler.cs, agentgateway-entraid-obo/src/AgenticTodo.TodoAgent/Adapters/Mcp/McpTodoSink.cs
• MCP persistence boundary: agentgateway-entraid-obo/src/AgenticTodo.TodoMcpServer/Adapters/TodoDbContext.cs, agentgateway-entraid-obo/src/AgenticTodo.TodoMcpServer/Tools/TodoTools.cs
• Gateway policy/configuration: agentgateway-entraid-obo/gateway.yaml
Iterative Executor–Checker Runtime
loop-runtime implements an agent loop: an executor agent works with local/remote MCP tools and a code sandbox; a checker service evaluates output over A2A; shared contracts carry feedback, verdicts, and run results.
• Agent loop state and roles: loop-runtime/src/LoopRuntime.Agents/ExecutorAgent.cs, loop-runtime/src/LoopRuntime.Agents/CheckerAgent.cs, loop-runtime/src/LoopRuntime.Agents/SessionState.cs
• Checker service/A2A boundary: loop-runtime/src/LoopRuntime.Checker/CheckerA2AEndpoint.cs, loop-runtime/src/LoopRuntime.Checker/CheckerAIAgent.cs
• Tool and execution isolation: loop-runtime/src/LoopRuntime.Mcp/Program.cs, loop-runtime/src/LoopRuntime.Sandbox/DockerSandbox.cs
• Cross-service types: loop-runtime/src/LoopRuntime.Contracts/ICodeSandbox.cs, loop-runtime/src/LoopRuntime.Contracts/Verdict.cs
It uses Docker for sandboxing and includes Entra agent-identity/OBO setup scripts.
MCP and Context Infrastructure Experiments
Two projects supply reusable patterns around MCP.
• mcp-experiments turns OpenAPI operations into registered/searchable tools and can execute generated code through local, Hyperlight, or OpenSandbox runners: mcp-experiments/src/McpServer/Program.cs, mcp-experiments/src/McpServer/OpenApi/OpenApiToolCatalogBuilder.cs, mcp-experiments/src/McpServer/CodeMode/SandboxRunnerFactory.cs.
• context-engineering-dotnet provides conversation/scratchpad persistence, token counting, and context reduction behind API and MCP-server hosts: context-engineering-dotnet/src/ContextEngineering.Infrastructure/Data/AppDbContext.cs, context-engineering-dotnet/src/ContextEngineering.Infrastructure/Services/SummarizingChatReducer.cs, context-engineering-dotnet/src/ContextEngineering.McpServer/Program.cs.
Most .NET distributed projects use Aspire AppHosts and shared ServiceDefaults for local orchestration, service discovery, resilience, and telemetry.
Main entry points: ExecutorAgent.cs Executor Agent · main.bicep Azure Deployment · ClawRuntime.cs Claw Runtime · CheckerA2AEndpoint.cs Checker Service
Components 22
DotNetClaw
Compact agent host with Slack and web channels.
- Agent Host
DotNetClaw/DotNetClaw/Program.cs - Claw Runtime · Loads instructions and coordinates tools, memory, and skills.
DotNetClaw/DotNetClaw/ClawRuntime.cs - Slack & Web Channels
- Agent Mind
DotNetClaw/DotNetClaw/mind/SOUL.md
Foundry Coffeeshop
Distributed agent and MCP coffeeshop sample.
- Channels Service · Routes requests through local or Foundry-backed agent clients.
foundry-agentfx/src/Claw.Channels/Program.cs - Coffeeshop Agent
foundry-agentfx/src/Claw.Agent/Agents/CoffeeshopWorkflow.cs - Tool Search Gateway · Registers and discovers available tools.
foundry-agentfx/src/ToolSearch.Gateway/Registry/ToolRegistry.cs - Coffeeshop MCP · Exposes coffeeshop ordering operations.
foundry-agentfx/src/Coffeeshop.Mcp/Tools/OrderTools.cs - Azure Deployment · Provisions Foundry, search, storage, observability, and Container Apps.
foundry-agentfx/infra/main.bicep
OBO Todo Gateway
Delegated-identity Todo reference architecture.
- Todo API · Delegates requests through the agent gateway.
agentgateway-entraid-obo/src/AgenticTodo.TodoApi/Adapters/OboAgentGateway.cs - Todo Agent · Generates descriptions and orchestrates Todo creation.
agentgateway-entraid-obo/src/AgenticTodo.TodoAgent/Features/CreateTodo/CreateTodoHandler.cs - Todo MCP Persistence · Persists todos through EF Core.
agentgateway-entraid-obo/src/AgenticTodo.TodoMcpServer/Adapters/TodoDbContext.cs - Gateway Policy · Defines delegated OBO identity and routing policy.
agentgateway-entraid-obo/gateway.yaml
Loop Runtime
Executor-checker agent loop.
- Executor Agent · Iterates on tasks with tools and sandbox execution.
loop-runtime/src/LoopRuntime.Agents/ExecutorAgent.cs - Checker Service · Evaluates executor output and returns feedback.
loop-runtime/src/LoopRuntime.Checker/CheckerA2AEndpoint.cs - Run Contracts · Carries sandbox, feedback, verdict, and result types.
loop-runtime/src/LoopRuntime.Contracts/Verdict.cs - MCP Tools
loop-runtime/src/LoopRuntime.Mcp/Program.cs - Docker Sandbox
loop-runtime/src/LoopRuntime.Sandbox/DockerSandbox.cs
MCP & Context Experiments
Reusable tool and context-management patterns.
- OpenAPI Tool Catalog · Converts OpenAPI operations into searchable MCP tools.
mcp-experiments/src/McpServer/OpenApi/OpenApiToolCatalogBuilder.cs - Sandbox Runner Factory · Selects local, Hyperlight, or OpenSandbox execution.
mcp-experiments/src/McpServer/CodeMode/SandboxRunnerFactory.cs - Context Reducer · Reduces persisted conversation and scratchpad context.
context-engineering-dotnet/src/ContextEngineering.Infrastructure/Services/SummarizingChatReducer.cs
Other components
- Next.js Storefront · Independent storefront prototype.
myshop-claude-code/app/page.tsx
Connections 22
- Agent Host → Claw Runtime: starts
- Slack & Web Channels → Claw Runtime: sends requests
- Claw Runtime → Slack & Web Channels: returns responses
- Claw Runtime → Agent Mind: loads instructions
- Channels Service → Coffeeshop Agent: routes requests
- Coffeeshop Agent → Tool Search Gateway: discovers tools
- Tool Search Gateway → Coffeeshop MCP: registers tools
- Azure Deployment → Channels Service: deploys
- Azure Deployment → Coffeeshop Agent: deploys
- Azure Deployment → Tool Search Gateway: deploys
- Azure Deployment → Coffeeshop MCP: deploys
- Todo API → Gateway Policy: uses gateway policy
- Gateway Policy → Todo Agent: forwards OBO request
- Todo Agent → Todo MCP Persistence: creates todos
- Executor Agent → MCP Tools: invokes tools
- Executor Agent → Docker Sandbox: executes code
- Executor Agent → Checker Service: submits output over A2A
- Checker Service → Executor Agent: returns feedback
- Executor Agent → Run Contracts: uses
- Checker Service → Run Contracts: uses verdicts
- OpenAPI Tool Catalog → Sandbox Runner Factory: executes generated code
- Context Reducer → OpenAPI Tool Catalog: complementary MCP pattern