First-5-Agents MVP¶
๐งญ Overview¶
The First-5-Agents MVP defines the minimal functional loop of the ConnectSoft AI Software Factory, where intelligent agents collaboratively turn a software idea into a production-ready, observable microservice โ autonomously.
This MVP proves the factoryโs core hypothesis:
That autonomous agents, when coordinated through well-defined prompts, events, and templates, can generate production-grade software services with traceability, resilience, and consistency.
๐ฏ Objective¶
Enable a full agentic software generation pipeline starting from a user prompt:
โBuild a BookingService using REST API, NHibernate, and MassTransit.โ
...and autonomously perform:
- Idea formalization (Vision Architect Agent)
- Architecture modeling (Enterprise Architect Agent)
- Codebase scaffolding (Microservice Generator Agent)
- Git traceable commit (Code Committer Agent)
- Pull request orchestration (Pull Request Creator Agent)
๐ Core Agentic Loop¶
flowchart TD
UserInput["๐ง Feature Idea"] --> VisionAgent["๐ฏ Vision Architect Agent"]
VisionAgent --> ArchAgent["๐ Enterprise Architect Agent"]
ArchAgent --> GeneratorAgent["๐งฑ Microservice Generator Agent"]
GeneratorAgent --> CommitterAgent["๐งพ Code Committer Agent"]
CommitterAgent --> PRAgent["๐ฆ Pull Request Creator Agent"]
PRAgent --> AzureDevOps["๐ Azure DevOps CI/CD"]
๐ฆ Scope of the MVP¶
This MVP includes:
- 5 foundational agents with modular roles
- 1 generated microservice (e.g.,
BookingService) - CI/CD build and deployment
- Traceability via
trace_id,agent_id,blueprint_id - Manual or scripted activation of each agent (for now)
๐ Not in Scope (Yet)¶
- Project management UI or dashboards
- Full telemetry/insights platform
- Agent coordination engine (MCP server)
- Agent retry or human escalation flows
- Component registry or edition logic
๐๏ธ High-Level Architecture of First-5-Agent Workflow¶
The First-5-Agents MVP is structured as a modular, event-driven, traceable pipeline where each agent performs a single specialized function. The entire system is built using:
- Clean Architecture principles
- Domain-Driven Design (DDD)
- Autonomous microservices generated from standardized templates
- Azure DevOps CI/CD for code delivery
- OpenTelemetry for traceability and observability
๐ง High-Level Agent Execution Stack¶
graph TD
subgraph AgentWorkflow
A1[Vision Architect Agent] --> A2[Enterprise Architect Agent]
A2 --> A3[Microservice Generator Agent]
A3 --> A4[Code Committer Agent]
A4 --> A5[Pull Request Creator Agent]
end
subgraph CI_CD
A5 --> DevOps[Azure DevOps Pipeline]
DevOps --> Deployment[Docker / Azure Container App]
end
๐งฑ Layered Stack Model¶
| Layer | Components |
|---|---|
| Agent Layer | 5 autonomous agents (Vision, Arch, Generator, Commit, PR) |
| Template Layer | connectsoft-microservice (.NET template) |
| Infrastructure Layer | Azure DevOps, Git repo, Docker, optional Pulumi |
| Observability Layer | Serilog, OpenTelemetry, trace IDs |
| Artifact Layer | BookingService microservice (REST, NHibernate, MassTransit) |
๐ Input โ Output Chain¶
| Phase | Input | Output |
|---|---|---|
| 1๏ธโฃ Vision | Idea | Structured Vision Document |
| 2๏ธโฃ Architecture | Vision Document | Blueprint + Domain Contracts |
| 3๏ธโฃ Generation | Blueprint + Contracts | Codebase (multi-project solution) |
| 4๏ธโฃ Commit | Codebase | Git commit + trace metadata |
| 5๏ธโฃ Pull Request | Git changes | PR with description + CI trigger |
Each agent adds semantic trace metadata like trace_id, agent_name, blueprint_id, artifact_id into logs and outputs.
๐ฅ List of the 5 Core Agents in Scope¶
The First-5-Agents MVP introduces a minimal yet complete pipeline by orchestrating 5 specialized autonomous agents. Each agent operates as a standalone microservice (or component) with clear boundaries, traceability, and defined roles.
๐ง Agent 1: Vision Architect Agent¶
- Role: Transforms a human prompt or idea into a structured, machine-consumable Vision Document
- Outputs: Problem statement, opportunity, personas, feature list, software classification
- Trigger: Receives raw idea or input message
๐ Agent 2: Enterprise Architect Agent¶
- Role: Converts the Vision Document into a formal System Architecture Blueprint
- Outputs: Bounded contexts, aggregates, service boundaries, use cases, transport choices (e.g., REST, messaging)
- Trigger:
VisionDocumentCreatedevent
๐งฑ Agent 3: Microservice Generator Agent¶
- Role: Generates a full Clean Architecture-based microservice using the
connectsoft-microservicetemplate - Outputs: Multi-project .NET solution for a domain-specific service
- Trigger:
SystemArchitectureBlueprintCreatedevent
๐งพ Agent 4: Code Committer Agent¶
- Role: Commits the generated codebase to a Git repository (Azure DevOps) with embedded traceability
- Outputs: Git commit with
trace_id, changelog, and commit metadata - Trigger:
MicroserviceGeneratedevent
๐ฆ Agent 5: Pull Request Creator Agent¶
- Role: Creates a well-formed Pull Request from the committed code, linking to upstream trace ID, blueprint, and triggering CI
- Outputs: Pull Request with structured title/body, trace metadata, and CI build trigger
- Trigger:
CodeCommittedevent
๐ Agent Collaboration Pattern¶
These agents follow the Sequential Handoff Pattern, where each output becomes the structured input of the next. The handoff is traceable, observable, and event-driven (not tightly coupled).
๐ Trace Metadata Fields (Required)¶
All agents must enrich their outputs with:
trace_idโ unique lifecycle execution IDagent_idโ name or ID of the agentblueprint_idโ optional, links to the architectural artifactcreated_atโ UTC timestampartifact_uriโ if applicable, where the output is stored
๐ง Vision Architect Agent โ Purpose & Responsibilities¶
The Vision Architect Agent is the entry point of the ConnectSoft AI Software Factory pipeline. It converts human-level input (ideas, prompts, business goals) into structured, machine-ready artifacts called Vision Documents.
This agent establishes the foundation for all downstream agents by formalizing the intent behind a software solution.
๐ฏ Core Purpose¶
Transform freeform feature ideas into structured, traceable, multi-agent-compatible Vision Documents.
This ensures that architectural and engineering agents can reason over the system using shared terminology, objectives, and constraints.
๐ Responsibilities¶
| Responsibility | Description |
|---|---|
| Idea Structuring | Parse raw input text and extract key goals, context, and pain points |
| Problem Framing | Define the core business or technical problem the system solves |
| Opportunity Mapping | Identify potential value, innovation vectors, or differentiators |
| Solution Conceptualization | Propose a high-level solution without implementation details |
| Software Classification | Classify the system: SaaS, API, Mobile, AI agent platform, etc. |
| Feature Decomposition | List initial modules, user goals, or features (non-technical) |
| Persona Definition | Identify target users, stakeholders, external systems |
| Success Criteria | Define measurable or outcome-based indicators of success |
| Vision Artifact Creation | Create a structured Vision Document with embedded metadata |
| Emit System Event | Publish VisionDocumentCreated with trace ID and payload for downstream agents |
๐ฆ Output: Vision Document¶
The output is a structured Markdown + JSON artifact containing:
- Problem definition
- Opportunity description
- Solution summary
- Software type
- Features/modules
- Personas
- Success metrics
trace_id,agent_id, and semantic metadata
This document is consumed by the Enterprise Architect Agent to design the system blueprint.
๐งพ Vision Architect Agent โ Inputs, Outputs, and Prompt Patterns¶
The Vision Architect Agent operates by transforming a raw, often vague idea into a structured vision document that downstream agents can act on. This is achieved using semantic prompt orchestration, domain knowledge, and traceability metadata.
๐ฅ Inputs¶
| Input Type | Description | Example |
|---|---|---|
| Raw Idea (Text) | User-provided feature description or goal | โBuild a BookingService with REST API and messaging.โ |
| Context Tags | Optional tags like domain, priority, or constraints | "domain": "Scheduling", "target": "SaaS" |
| Session Metadata | Trace ID, blueprint group, originating user or agent | trace_id: booking-core-v1 |
| Optional Artifacts | Existing documents, workflows, or diagrams (if available) | Markdown notes, PDFs, whiteboard export |
๐ค Outputs¶
| Output Type | Description | Format |
|---|---|---|
| Vision Document (Markdown) | Structured narrative artifact for humans and agents | .md |
| Vision Metadata (JSON) | Compact semantic version for downstream systems | .json |
| System Event | VisionDocumentCreated event with links and trace info |
Event Bus message (JSON payload) |
Sample Output Fields:¶
{
"trace_id": "booking-core-v1",
"agent_id": "vision-architect",
"softwareType": ["SaaS", "API"],
"features": ["Appointment Scheduling", "Notifications"],
"personas": ["Clinic Admin", "Customer"],
"successMetrics": ["Reduce no-shows by 25%"]
}
๐ง Prompt Template Pattern¶
๐ฅ Input Prompt Template (to the agent):¶
Human input:
"Build a BookingService with REST API and messaging."
You must respond with:
1. Problem Definition
2. Opportunity
3. Proposed Solution (non-technical)
4. Software Type
5. Feature List
6. Stakeholders / Personas
7. Success Metrics
8. Vision Document (Markdown + JSON)
๐งพ System Prompt:¶
You are a Vision Architect Agent. Convert freeform business ideas into structured software vision documents. Output must include classification, features, personas, and traceable metadata. Format output in Markdown + JSON. Maintain Clean Architecture compatibility.
๐๏ธ Enterprise Architect Agent โ Scope & Domain Modeling¶
The Enterprise Architect Agent is responsible for transforming a high-level Vision Document into a formal, structured architecture blueprint. This blueprint becomes the foundation for system decomposition, service generation, messaging design, and clean architectural alignment.
๐ฏ Core Scope¶
Convert vision-level ideas into modular, domain-aligned, event-driven, and cloud-native architecture blueprints that can be implemented autonomously.
The agent operates across business, domain, and technical boundaries, enabling multi-agent collaboration and scalable service orchestration.
๐งฑ Primary Responsibilities¶
| Area | Description |
|---|---|
| Domain Decomposition | Identify bounded contexts and model the core domain using DDD principles |
| Aggregate Identification | Define key aggregates/entities that reflect core business concepts |
| Use Case Design | Specify high-level use cases and operations that the service must support |
| Transport Selection | Decide whether communication should be via REST, messaging, gRPC, etc. |
| Service Boundary Definition | Establish microservice boundaries and team/agent ownership guidelines |
| Architecture Blueprint Creation | Output a structured artifact (SystemArchitectureBlueprint) with all core decisions |
| Emit Event | Publish SystemArchitectureBlueprintCreated event for generator agent |
๐งฉ Example Domain Output (for BookingService)¶
bounded_context: Booking
aggregate_root: Appointment
value_objects:
- TimeSlot
- Location
- ProviderId
use_cases:
- CreateAppointment
- CancelAppointment
- GetAvailableSlots
service_model: RestApi
persistence_model: NHibernate
messaging_model: MassTransit
๐ฆ Architectural Blueprint Includes¶
- Domain model (aggregates, value objects)
- Application use cases
- Layer separation (Clean Architecture)
- Service boundaries
- Messaging and integration strategy
- Traceability fields (
trace_id,agent_id,blueprint_id)
๐ฅ Collaboration¶
- Consumes output from
Vision Architect Agent - Produces structured inputs for:
Microservice Generator AgentAPI Designer Agent(in later stages)Event-Driven Architect Agent(if needed)
๐ Enterprise Architect Agent โ Outputs and Use Case Design¶
The Enterprise Architect Agent produces a System Architecture Blueprint that encapsulates the structure, behavior, and operational boundaries of the system to be built. This output serves as the formal contract for downstream engineering agents, particularly the Microservice Generator Agent.
๐ค Outputs¶
| Output | Description |
|---|---|
| SystemArchitectureBlueprint (YAML/JSON) | Describes domain, use cases, layers, persistence, and transport strategies |
| Event Emission | Emits SystemArchitectureBlueprintCreated event with trace ID and artifact reference |
| Domain Model Package | A structured model of entities, aggregates, and value objects |
| Use Case Definitions | Declared contracts for application-layer operations |
| Metadata | Includes trace_id, agent_id, blueprint_id, domain tags, ownership, timestamps |
๐งฉ Example Output (YAML Blueprint)¶
trace_id: booking-core-v1
agent_id: enterprise-architect
blueprint_id: booking-service-blueprint
bounded_context: Booking
aggregate_root: Appointment
entities:
- Appointment
- Provider
value_objects:
- TimeSlot
- Location
use_cases:
- CreateAppointment
- CancelAppointment
- GetAvailableSlots
service_model: RestApi
persistence_model: NHibernate
messaging_model: MassTransit
authentication_required: true
๐ง Use Case Design Philosophy¶
Each use case reflects a business operation modeled using Clean Architecture and DDD boundaries. It defines the application service contract, including:
| Field | Description |
|---|---|
name |
Name of the use case (CreateAppointment) |
input_dto |
Input data structure |
output_dto |
Output/result |
preconditions |
Optional constraints or validation rules |
postconditions |
Optional success criteria or follow-up events |
events_emitted |
Domain or integration events published (e.g. AppointmentCreated) |
๐ฆ Use Case Example (CreateAppointment)¶
name: CreateAppointment
input_dto:
- patient_id: string
- provider_id: string
- start_time: datetime
- end_time: datetime
output_dto:
- appointment_id: string
events_emitted:
- AppointmentCreated
๐ Downstream Consumption¶
The blueprint and use case definitions are consumed by:
- โ
Microservice Generator Agent - โ
Code Committer Agent(as metadata for trace) - โ CI pipeline scripts (optional code-gen or lint rules)
๐งฑ Microservice Generator Agent โ Template Logic & CLI Parameters¶
The Microservice Generator Agent transforms a structured System Architecture Blueprint into a real, production-grade microservice using the ConnectSoft .NET template system.
This agent acts as a blueprint interpreter and template executor, ensuring consistent generation of modular, observable, and agent-compatible codebases.
๐ฏ Core Function¶
Parse the architectural blueprint and invoke the appropriate parameters of the
connectsoft-microservicetemplate โ to scaffold a full Clean Architecture solution aligned to DDD, EDA, and factory-wide conventions.
๐งฉ Template Engine¶
- Template:
connectsoft-microservice - Language: C# (.NET 8)
- Mechanism: Invokes
dotnet newCLI with extracted blueprint metadata - Extensibility: Supports AI-based parameter mapping and dynamic toggling of modules (REST, gRPC, messaging, AI)
โ๏ธ Key CLI Parameters (mapped from blueprint)¶
| CLI Parameter | Derived From | Example |
|---|---|---|
--AggregateRootName |
aggregate_root |
Appointment |
--ServiceModelType |
service_model |
RestApi |
--PersistenceModelType |
persistence_model |
NHibernate |
--MessagingModelType |
messaging_model |
MassTransit |
--UseSemanticKernel |
enabled by default | true |
--UseOpenAI |
optional | false |
--Swagger, --HealthCheck, --Docker |
always included | true |
--TraceId (custom) |
trace_id |
booking-core-v1 |
๐ Sample CLI Command (BookingService)¶
dotnet new connectsoft-microservice \
--AggregateRootName Appointment \
--ServiceModelType RestApi \
--PersistenceModelType NHibernate \
--MessagingModelType MassTransit \
--UseSemanticKernel true \
--UseOpenAI false \
--Swagger true \
--HealthCheck true \
--Docker true
โ Output: A fully structured, multi-project solution ready for commit, traceable by
trace_idandblueprint_id.
๐ฆ Output Structure (Example)¶
BookingService/
โโโ DomainModel/
โโโ EntityModel/
โโโ ApplicationModel/
โโโ ServiceModel.RestApi/
โโโ MessagingModel/
โโโ FlowModel.MassTransit/
โโโ PersistenceModel.NHibernate/
โโโ Application/
โโโ UnitTests/
โโโ DockerCompose/
โโโ InfrastructureModel/
โโโ SemanticKernel/
๐ง Intelligent Parameter Mapping (AI Agent)¶
The agent supports intelligent mapping:
- Reads
SystemArchitectureBlueprintfile - Translates domain values into CLI switches
- Auto-injects trace metadata and initial documentation
๐งฑ Microservice Generator Agent โ Output Structure and Project Breakdown¶
Once the Microservice Generator Agent executes the connectsoft-microservice template, it produces a multi-project solution aligned with Clean Architecture and domain-driven design.
Each project is modular, traceable, and ready for CI/CD and agent collaboration.
๐ฆ Output: Multi-Project Microservice Structure¶
ConnectSoft.BookingService/
โโโ DomainModel/ # Use case interfaces, domain services
โโโ EntityModel/ # Aggregates, entities, value objects
โโโ DomainModel.Impl/ # Use case implementations
โโโ ApplicationModel/ # DI registration, middleware config
โโโ Application/ # Host application (Main)
โโโ ServiceModel.RestApi/ # REST controllers, API endpoints
โโโ PersistenceModel.NHibernate/ # ORM mappings, repositories
โโโ MessagingModel/ # Event contracts (e.g., AppointmentCreated)
โโโ FlowModel.MassTransit/ # Consumers, sagas, messaging integration
โโโ SemanticKernel/ # AI skill registration (optional)
โโโ DockerCompose/ # Dev/test container orchestration
โโโ InfrastructureModel/ # Pulumi / deployment config (optional)
โโโ UnitTests/ # Unit testing layer
โโโ ArchitectureModel/ # Mermaid diagrams, service documentation
๐งฑ Clean Architecture Layer Mapping¶
graph LR
UI[ServiceModel.RestApi] --> App[ApplicationModel]
App --> Domain[DomainModel]
Domain --> Entity[EntityModel]
App --> Infra[PersistenceModel + MessagingModel]
- No inner layer references outer layers
- DI bindings managed in
ApplicationModel - Entry point (Main) resides in
Application
๐งช Cross-Cutting Features (Generated)¶
| Feature | Included? |
|---|---|
| OpenTelemetry Tracing | โ |
| Serilog Structured Logging | โ |
| ProblemDetails API Errors | โ |
| FluentValidation | โ |
Health Checks (/health/live, etc.) |
โ |
Swagger UI (/swagger) |
โ |
| Feature Flags Support | โ |
| Dockerfile + Docker Compose | โ |
| CI-ready Git Layout | โ |
๐ง Traceability Hooks in Code¶
Every generated service embeds trace ID support via:
- Logging enrichers (
WithTraceId()) - Correlation ID propagation
- Metadata in Swagger and CI
This allows downstream agents (e.g., QA, observability) to connect artifacts to the trace_id and blueprint_id.
๐งพ Code Committer Agent โ Git Actions, Metadata, CI Triggering¶
The Code Committer Agent is responsible for safely and traceably pushing generated code into version control (Azure DevOps Git). It ensures every commit is auditable, agent-attributed, and ready to trigger CI/CD workflows automatically.
๐ฏ Core Responsibilities¶
| Responsibility | Description |
|---|---|
| Git Integration | Clone/pull the correct repo and branch |
| Stage & Commit | Add all generated files with proper trace metadata |
| Metadata Enrichment | Annotate commit with trace_id, agent_id, blueprint_id |
| Change Log Generation | Create or update CHANGELOG.md entry |
| Event Emission | Emit CodeCommitted event with commit ID and URI |
| Trigger CI/CD | Push commit to tracked branch to start Azure DevOps pipeline |
๐๏ธ Example Git Commit Metadata¶
git commit -m "feat: initial BookingService microservice [trace_id: booking-core-v1] [agent: code-committer]"
Embedded Metadata (in commit message or Git notes):¶
| Field | Value |
|---|---|
trace_id |
booking-core-v1 |
agent_id |
code-committer |
blueprint_id |
booking-service-blueprint |
timestamp |
UTC now |
artifact_type |
microservice-template-generated |
๐ Changelog Template (Auto-generated)¶
## [booking-core-v1] - 2025-05-11
### Added
- BookingService microservice scaffolded via connectsoft-microservice
- REST API for Appointment use cases
- NHibernate setup and MassTransit messaging
- OpenTelemetry, health checks, and Swagger
๐ Event Emission¶
After committing:
{
"event": "CodeCommitted",
"trace_id": "booking-core-v1",
"agent": "CodeCommitter",
"commit_sha": "c9e2f84",
"repo": "https://dev.azure.com/connectsoft/BookingService",
"branch": "main",
"changelog_uri": "CHANGELOG.md"
}
๐ CI/CD Triggering¶
The agent pushes to a branch that has an Azure DevOps pipeline YAML configured (e.g., main or dev), ensuring:
- Immediate build of the generated microservice
- Deployment to Docker / Azure environment
- Test and telemetry validation
๐ฆ Pull Request Creator Agent โ PR Title, Traceability, Collaboration¶
The Pull Request Creator Agent finalizes the delivery of generated code by creating a structured, traceable, and CI-integrated pull request. It ensures human and agent collaborators can review, approve, and merge changes into the production branch โ closing the loop on agent-driven delivery.
๐ฏ Core Responsibilities¶
| Responsibility | Description |
|---|---|
| PR Creation | Create a pull request on Azure DevOps for the generated commit(s) |
| Trace Metadata Injection | Include trace_id, agent_id, and blueprint_id in the title and body |
| Summary Description | Auto-generate a concise overview of what the PR includes |
| CI/CD Integration | Ensure PR triggers build + test pipelines |
| Linkage to Issue or Blueprint | Optionally reference a vision, ticket, or design doc |
๐ Example PR Title¶
๐ Example PR Body¶
### ๐ฆ Summary
This pull request adds the generated microservice `BookingService`, created by the Microservice Generator Agent from blueprint `booking-service-blueprint`.
---
### ๐ง Metadata
- `trace_id`: `booking-core-v1`
- `blueprint_id`: `booking-service-blueprint`
- `agent_id`: `pull-request-creator`
- `created_at`: `2025-05-11T08:45:00Z`
---
### โ
Included Features
- REST API controllers for Appointment use cases
- NHibernate mappings and repository interfaces
- MassTransit consumers for domain events
- OpenTelemetry tracing, health checks, Swagger UI
---
### ๐ Notes
This PR is auto-generated and ready for CI build/test. Please review structure and trace alignment.
๐ Optional Linkages¶
| Linked Object | Example |
|---|---|
| Blueprint Doc | /docs/booking/booking-service-blueprint.md |
| Vision Doc | /docs/booking/booking-service-vision.md |
| Agent Execution Log | /logs/booking-core-v1/execution.json |
| Changelog | /CHANGELOG.md |
๐ Collaboration & Notification¶
The agent may also:
- Assign reviewers (e.g. DevOps or QA agents in future)
- Tag based on agent group (e.g.
autogen,scheduling) - Add a comment webhook to post updates (e.g., build pass/fail)
๐ Agent Interaction Flow โ Event-Driven Handoff & Traceability Chain¶
The First-5-Agents MVP relies on an event-driven, loosely coupled architecture, where each agent reacts to structured events emitted by its predecessor.
This allows agents to operate independently, maintain traceability, and scale horizontally โ all while preserving a shared execution context via trace_id.
๐งญ Event-Driven Handoff Pattern¶
Each agent emits a domain event that acts as a handoff trigger for the next agent. These events include:
- A reference to the produced artifact (e.g., Vision Document, Blueprint, Git commit)
- The
trace_id, which unifies all steps in the same generation flow - Agent identity and timestamp for audit and observability
๐ Sequential Event Chain¶
sequenceDiagram
participant User as Human Prompt
participant Vision as Vision Architect Agent
participant Arch as Enterprise Architect Agent
participant Gen as Microservice Generator Agent
participant Commit as Code Committer Agent
participant PR as Pull Request Creator Agent
User->>Vision: "Build BookingService"
Vision->>Vision: Generate Vision Document
Vision-->>Arch: Emit `VisionDocumentCreated`
Arch->>Arch: Generate Architecture Blueprint
Arch-->>Gen: Emit `SystemArchitectureBlueprintCreated`
Gen->>Gen: Run CLI, Generate Codebase
Gen-->>Commit: Emit `MicroserviceGenerated`
Commit->>Commit: Git commit with trace metadata
Commit-->>PR: Emit `CodeCommitted`
PR->>PR: Create Pull Request
PR-->>CI: Azure DevOps Build Triggered
๐งฉ Traceability Graph¶
Each artifact (document, blueprint, commit, PR) includes the following minimum trace metadata:
| Field | Description |
|---|---|
trace_id |
Unifies all artifacts and events in one logical execution |
agent_id |
Indicates which agent produced the artifact |
blueprint_id |
Links to the architectural specification |
artifact_type |
Vision, Architecture, Service Code, Git Commit, PR, etc. |
timestamp |
UTC timestamp of creation |
artifact_uri |
Pointer to file, repo, or URL |
๐ง Trace ID = the connective tissue All agents, artifacts, commits, and events in one generation flow are traceable through a single
trace_id.
๐ Event Payload Example¶
{
"event": "MicroserviceGenerated",
"trace_id": "booking-core-v1",
"agent_id": "microservice-generator",
"blueprint_id": "booking-service-blueprint",
"output_path": "/services/BookingService",
"timestamp": "2025-05-11T08:33:21Z"
}
๐ก๏ธ Benefits of Event-Driven Agent Interaction¶
- โ Loose coupling โ Agents donโt call each other directly
- โ Parallelization Ready โ Multiple services can generate in parallel
- โ Auditable โ Every step is logged and trace-linked
- โ Recoverable โ Any failed step can be retried independently
- โ Composable โ Future agents (QA, Security, Observability) can subscribe to the same events
๐ Observability, Tracing, and Metadata Enrichment per Agent¶
The First-5-Agents MVP is designed with observability-first principles, ensuring that every agentโs execution can be traced, measured, audited, and debugged โ both in real time and retrospectively.
Each agent enriches its outputs and actions with standardized metadata and emits OpenTelemetry (OTEL)-compliant spans, logs, and metrics.
๐งญ Core Observability Features¶
| Feature | Description |
|---|---|
| Trace ID Propagation | Each agent execution carries a trace_id linking all artifacts together |
| OpenTelemetry Traces | Each major action is wrapped in a traceable span |
| Structured Logging (Serilog) | Logs include trace_id, agent_id, and artifact_id in every message |
| Metrics Exposure | Agents expose Prometheus-compatible metrics (e.g., execution time, failure count) |
| Validation & Retry Logs | Failures and recovery attempts are logged with full input/output diffs |
๐ Common Metadata Fields¶
Every output and log line from an agent includes:
| Field | Example |
|---|---|
trace_id |
booking-core-v1 |
agent_id |
microservice-generator |
execution_id |
msgen-8734-x |
artifact_type |
ArchitectureBlueprint, MicroserviceCode |
created_at |
2025-05-11T08:47:00Z |
duration_ms |
1750 |
status |
success, fail, retry |
๐ OpenTelemetry Tracing Example¶
โ [trace_id=booking-core-v1] [agent=enterprise-architect]
span: GenerateBlueprint [โ 248ms]
โ [trace_id=booking-core-v1] [agent=microservice-generator]
span: ExecuteCLI 'dotnet new connectsoft-microservice ...' [โ 3.2s]
โ [trace_id=booking-core-v1] [agent=code-committer]
span: CommitToGit 'initial scaffold' [โ 612ms]
All spans are tagged with:
trace_idagent_idblueprint_idartifact_urispan_status
โ Agents emit spans and logs via built-in exporters: OTLP โ Application Insights / Prometheus / Jaeger
๐งช Failure Recovery Visibility¶
Failures are logged with full input โ output diff, retry markers, and escalation hints:
{
"trace_id": "booking-core-v1",
"agent_id": "microservice-generator",
"status": "fail",
"error": "Template execution failed: invalid parameter 'PersistenceModelType'",
"attempt": 1,
"next_action": "retry_with_corrected_parameter"
}
๐ฐ๏ธ Observability Pipeline¶
graph TD
AgentExec --> OTELCollector --> ApplicationInsights
AgentExec --> MetricsEndpoint --> Prometheus
AgentExec --> StructuredLogs --> AzureLogAnalytics
๐ Optional Enhancements (Post-MVP)¶
- Correlate Git commits and PRs in dashboards
- Visualize agent spans with Gantt-style execution timelines
- Integrate logs into a searchable trace explorer
- Include agent resource usage (CPU/memory) per task
๐ Deployment Environment โ Azure DevOps Pipelines, Docker, Pulumi¶
The deployment phase of the First-5-Agents MVP is handled via a cloud-native CI/CD pipeline, configured in Azure DevOps, and powered by Docker and optionally Pulumi for infrastructure-as-code.
This environment ensures that every agent-generated service is:
- Built reproducibly
- Deployed consistently
- Observable in production or dev
- Traceable back to agent actions and commits
๐ ๏ธ CI/CD Pipeline โ Azure DevOps¶
Each generated microservice includes a preconfigured azure-pipelines.yml file, which handles:
| Stage | Tasks |
|---|---|
| Build | Restore NuGet, compile all projects |
| Test | Run unit tests, generate coverage |
| Package | Build Docker image |
| Push | Push image to Azure Container Registry (or local registry) |
| Deploy | Use Docker or Pulumi to deploy to Azure App Service, Container Apps, or Kubernetes |
| Trace Injection | Annotate logs and environment with trace_id, artifact_type, agent_id |
๐งช Sample azure-pipelines.yml¶
trigger:
branches:
include: [main]
variables:
trace_id: '$(Build.SourceBranchName)-$(Build.BuildId)'
stages:
- stage: BuildAndTest
jobs:
- job: Build
steps:
- task: UseDotNet@2
inputs:
packageType: sdk
version: '8.x'
- script: dotnet build --configuration Release
- script: dotnet test --no-build --logger trx
- stage: Dockerize
jobs:
- job: DockerBuild
steps:
- task: Docker@2
inputs:
command: buildAndPush
repository: connectsoft/booking-service
tags: |
latest
$(Build.BuildId)
๐ณ Docker-Based Runtime (Default)¶
Each microservice is packaged as a Docker container, with:
- Health checks (
/health/live,/health/ready) - Trace ID injection via environment variables
- Logging via Serilog to console or file
- OpenTelemetry exporter preconfigured
โ This makes it deployable locally, on AKS, Azure Container Apps, or Docker Compose
๐ Optional: Pulumi-Based IaC¶
If --UsePulumi is enabled during generation:
| Resource | Pulumi Module |
|---|---|
| Azure App Service | azure-native:web |
| Azure Key Vault | azure-native:keyvault |
| Azure Container Registry | azure-native:containerregistry |
| Service Bus | azure-native:servicebus |
| DNS/SSL | azure-native:network |
This allows agents or infrastructure scripts to deploy environments via Pulumi CLI, using typesafe C#.
๐ Traceability in Deployment Logs¶
Deployment logs automatically include:
{
"trace_id": "booking-core-v1",
"stage": "Deploy",
"agent": "pull-request-creator",
"container_tag": "booking-service:20250511.1",
"status": "Success",
"region": "East US"
}
๐งฉ Future Enhancements (Post-MVP)¶
- Blue/green deployments with rollback
- Deployment agent with observability feedback loop
- Canary testing support
- GitOps sync integration (e.g., FluxCD, ArgoCD)
๐ฎ Future Enhancements โ Agent Insights, Validation, Feedback Loops¶
While the First-5-Agents MVP delivers a complete autonomous generation loop, the long-term evolution of the ConnectSoft AI Software Factory depends on layering in insight, self-correction, validation, and feedback-driven intelligence.
These enhancements will move the system from automated code generation to a resilient, adaptive software production ecosystem.
๐ 1. Agent Insights Service (Telemetry and Audit)¶
A lightweight microservice (AgentInsightsService) can be introduced to:
- Collect and store agent span data (start/stop, duration, output status)
- Track failures, retries, and human interventions
- Enable dashboards for:
- Most active agents
- Generation time per service
- Failed executions by cause
- Correlate agent output with test and deploy metrics
๐ก Powered by OpenTelemetry + MongoDB or SQL + SignalR for live updates.
โ 2. Output Validation Agent (Structure, Semantics, Security)¶
Introduce a new agent to review the outputs from any previous agent:
| Validation Area | Check |
|---|---|
| Structure | Does the vision/blueprint/code follow ConnectSoft schemas? |
| Semantics | Are domain concepts and use cases coherent? |
| Security | Are sensitive data fields encrypted, protected, and role-restricted? |
| Traceability | Does the output carry trace_id, agent_id, and versioning? |
This agent can act before PR creation or deployment, enabling a guardrail layer.
๐ 3. Feedback Loop Integration (Autonomous Improvement)¶
Agents can evolve through internal feedback signals, such as:
- โ Automated test failures โ trigger bug resolver agent
- โ Architecture validation failures โ trigger blueprint correction
- โ
Human review flags โ post feedback to root
trace_idthread
๐ง These patterns allow agents to self-heal, ask for clarification, or adapt prompt strategies.
๐งช 4. Metrics + Anomaly Detection¶
The platform can detect patterns in:
- Repeated failures from the same agent type
- Latency spikes in specific blueprint configurations
- Commitโdeploy cycles that exceed expected durations
This paves the way for runtime optimizers, cost controllers, and auto-scaling logic.
๐ Future Agents Enabled by These Enhancements¶
| Agent | Role |
|---|---|
AgentInsightsCollector |
Real-time trace and span logger |
OutputValidatorAgent |
Pre-PR compliance and contract enforcer |
FeedbackRouterAgent |
Aggregates error, QA, and human feedback into agent prompts |
BlueprintCorrectionAgent |
Refines system architecture from failed attempts |
๐งญ Summary, Roadmap, and Next Steps¶
The First-5-Agents MVP lays the foundational loop of the ConnectSoft AI Software Factory, enabling the platform to autonomously turn a high-level idea into a production-ready microservice โ with traceability, observability, and CI/CD integration.
This MVP proves the feasibility of agentic software creation through modular, event-driven workflows and AI-enhanced execution.
โ What Weโve Built¶
| Phase | Outcome |
|---|---|
| ๐ง Vision Input โ | Structured Vision Document |
| ๐ Architecture โ | Clean, modular System Architecture Blueprint |
| ๐งฑ Generation โ | Full microservice scaffold using connectsoft-microservice |
| ๐งพ Commit โ | Git commit with full trace metadata |
| ๐ฆ Pull Request โ | CI-enabled PR linked to upstream artifacts |
| ๐ Deploy โ | Service deployed via Azure DevOps & Docker/Pulumi |
| ๐ Trace โ | OTEL spans and structured logs per agent execution |
๐ MVP Agent Lifecycle Summary¶
flowchart TD
Input["Human Prompt"] --> Vision["Vision Architect Agent"]
Vision --> Blueprint["Enterprise Architect Agent"]
Blueprint --> Code["Microservice Generator Agent"]
Code --> Commit["Code Committer Agent"]
Commit --> PR["Pull Request Creator Agent"]
PR --> Azure["Azure DevOps CI/CD"]
Azure --> Deploy["Microservice Live"]
๐ง Core Agent Roles Recap¶
| Agent | Function |
|---|---|
| Vision Architect | Converts ideas into structured software visions |
| Enterprise Architect | Creates the domain, use case, and transport blueprint |
| Microservice Generator | Scaffolds full service based on Clean Architecture |
| Code Committer | Pushes commits with trace_id, version info |
| Pull Request Creator | Publishes PRs and triggers CI/CD workflows |
๐ฎ Roadmap: What Comes Next¶
| Stage | Focus |
|---|---|
| ๐ Agent Insights Service | Real-time telemetry collection and visualization |
| ๐ Output Validation Agent | Pre-PR contract enforcement |
| ๐ฅ Human-in-the-loop Feedback | Review triggers for failed agent paths |
| ๐ง Feedback-Enriched Agents | Enable retry, improvement, and correction |
| ๐ Component Registry Service | Catalog generated services and their metadata |
| ๐ Knowledge Memory Integration | Long-term blueprint and vision recall via vector DB |
| ๐ MCP-Based Orchestration | Introduce formal agent planner + skill router (MCP server) |
๐ Next Steps¶
- โ
Finish
.NET newgeneration and commit BookingService - โ Finalize Azure DevOps CI/CD pipeline and deployment
- โ
Log all agent events with
trace_id - โ Create an execution transcript for this MVP
- ๐ Begin design of
AgentInsightsServiceandOutputValidatorAgent - ๐ง Expand agent catalog with additional engineering and orchestration roles
๐ฏ The MVP demonstrates that ConnectSoft can autonomously generate, trace, and ship software components. From here, we begin the journey toward fully adaptive, insight-driven software factories.