# aws-samples/sample-agentic-ai-factory architecture

> Architecture diagram of the GitHub repository aws-samples/sample-agentic-ai-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-samples/sample-agentic-ai-factory
- Repository: https://github.com/aws-samples/sample-agentic-ai-factory

## Overview

#### Purpose and Entry Points
Agentic AI Factory is an AWS-hosted enterprise application-development pipeline built around four Bedrock AgentCore agents. Users interact through a React SPA; backend GraphQL operations initiate and track agent work. Primary deployment entry points are `deploy.sh` and CDK app `backend/bin/app.ts`; the browser entry point is `frontend/src/main.tsx`.

#### Frontend Application Boundary
The Vite/React frontend provides authenticated organization-scoped workflows: project dashboard, agent catalog/configuration, assessment chat, design progress, and task running. `frontend/src/App.tsx` composes the application shell; page-level workflow surfaces live in `frontend/src/pages/AgenticStudio.tsx`, `frontend/src/pages/Dashboard.tsx`, and `frontend/src/components/AssessmentChat.tsx`. Service modules such as `frontend/src/services/projectService.ts` and `frontend/src/services/fabricatorService.ts` form the client boundary to backend APIs, while `frontend/src/config/amplify.ts` configures AWS Amplify connectivity.

#### API, Identity, and Persistence
The backend exposes an AppSync GraphQL contract defined in `backend/src/schema/schema.graphql`. Resolver Lambdas implement project, conversation, agent, document, user, tool-config, and task-runner operations, for example `backend/src/lambda/project-resolver.ts`, `backend/src/lambda/conversation-resolver.ts`, and `backend/src/lambda/task-runner-resolver.ts`. Cognito handles authentication and role/group access; DynamoDB holds application state; S3 is used for uploaded/generated artifacts. Shared API, authorization, DynamoDB, event, and validation boundary code is centralized under `backend/src/utils/appsync.ts`, `backend/src/utils/auth.ts`, and `backend/src/utils/dynamodb.ts`.

#### Event-Driven Workflow Control
Long-running agent stages communicate progress asynchronously rather than through a browser request lifecycle. EventBridge connects service-side progress/activity to backend notifier Lambdas, including `backend/src/lambda/assessment-completion-notifier.ts`, `backend/src/lambda/design-progress-notifier.ts`, and `backend/src/lambda/planning-progress-notifier.ts`. Corresponding GraphQL resolvers expose progress/status to the UI, e.g. `backend/src/lambda/assessment-progress-resolver.ts` and `backend/src/lambda/design-progress-resolver.ts`. This separates user-facing API state from agent execution and enables subscription-style live updates.

#### Four-Agent Delivery Pipeline
The core control flow advances from requirements assessment to solution design, planning, and implementation:
1. Assessment agent reviews documents and gathers business, commercial, governance, and technical requirements: `service/agent1_assessment/agent.py`, `service/agent1_assessment/tools/save_assessment_data.py`.
2. Design agent consumes assessment data and incrementally produces a high-level design: `service/agent2_design/agent.py`, `service/agent2_design/tools/assemble_hld_document.py`.
3. Planning agent translates design into executable planning work: `service/agent3_planning/agent3.py`, `service/agent3_planning/api_integration.py`.
4. Implementation agent executes or coordinates implementation work: `service/agent4_implementation/agent4.py`, `service/agent4_implementation/api_integration.py`.

Each agent is independently packaged/deployed, with container definitions for the first two and CloudFormation-style infrastructure definitions for agents 3–4.

#### Agent Orchestration and Artifact Generation
The Arbiter layer configures, fabricates, supervises, and invokes worker execution around the agents: `arbiter/fabricator/index.py`, `arbiter/supervisor/index.py`, and `arbiter/workerWrapper/index.py`. Backend operations such as `backend/src/lambda/fabricator-request-resolver.ts` and `backend/src/lambda/agent-message-handler.ts` bridge GraphQL requests/messages into this layer. Design output can be rendered to PDF via `service/hld_pdf_generator/lambda_handler.py`, with completion notification handled by `service/hld_pdf_notifier/lambda_handler.py`.

#### Infrastructure and Knowledge Services
AWS CDK composes the platform into backend, frontend, agent/arbiter, services, and knowledge-base stacks: `backend/lib/backend-stack.ts`, `backend/lib/frontend-stack.ts`, `backend/lib/knowledge-base-stack.ts`, and `backend/lib/arbiter-stack.ts`. Material services are Bedrock AgentCore, Bedrock knowledge base backed by OpenSearch Serverless, AppSync, Cognito, DynamoDB, EventBridge, Lambda, S3, CloudFront, ECR, and CloudFormation. Knowledge-base provisioning is separately represented in `service/knowledge_base/infrastructure.yaml`; optional Confluence integration is supplied through SSM parameters.

Main entry points: [`backend/src/schema/schema.graphql`](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/schema/schema.graphql) (AppSync GraphQL API), [`service/agent1_assessment/agent.py`](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent1_assessment/agent.py) (Assessment agent), [`service/agent2_design/agent.py`](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent2_design/agent.py) (Design agent), [`backend/bin/app.ts`](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/bin/app.ts) (CDK deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_react_spa["React SPA<br/>Vite React<br/>[App.tsx]"]
  node_workflow_pages["Workflow surfaces<br/>React pages<br/>[AgenticStudio.tsx]"]
  node_frontend_services["API client services<br/>frontend services<br/>[projectService.ts]"]
  node_amplify["Amplify connectivity<br/>frontend config<br/>[amplify.ts]"]
end

subgraph group_backend["Backend platform"]
  node_appsync{{"AppSync GraphQL API<br/>[schema.graphql]"}}
  node_resolvers["Resolver Lambdas<br/>Lambda handlers"]
  node_workflow_resolvers["Agent bridge handlers<br/>Lambda handlers"]
  node_progress_notifiers["Progress notifiers<br/>Lambda handlers"]
  node_identity_state[("Identity and application state<br/>Cognito + DynamoDB<br/>[auth.ts]")]
  node_artifacts[("Artifact storage<br/>S3")]
  node_events["Workflow events<br/>EventBridge"]
end

subgraph group_pipeline["Agent delivery pipeline"]
  node_assessment["Assessment agent<br/>Bedrock AgentCore agent<br/>[agent.py]"]
  node_design["Design agent<br/>Bedrock AgentCore agent<br/>[agent.py]"]
  node_planning["Planning agent<br/>Bedrock AgentCore agent<br/>[agent3.py]"]
  node_implementation["Implementation agent<br/>Bedrock AgentCore agent<br/>[agent4.py]"]
end

subgraph group_orchestration["Agent orchestration"]
  node_arbiter{{"Arbiter<br/>agent control layer<br/>[index.py]"}}
  node_hld_pdf["HLD PDF generation<br/>Lambda service<br/>[lambda_handler.py]"]
end

subgraph group_infra["Deployment and knowledge"]
  node_cdk_app["CDK deployment<br/>AWS CDK<br/>[app.ts]"]
  node_knowledge_base[("Knowledge base<br/>Bedrock KB + OpenSearch")]
  node_deploy_script["Deployment script<br/>shell entry point<br/>[deploy.sh]"]
end

node_react_spa -->|"renders"| node_workflow_pages
node_workflow_pages -->|"uses"| node_frontend_services
node_frontend_services -->|"configures requests"| node_amplify
node_amplify -->|"connects to"| node_appsync
node_appsync -->|"invokes"| node_resolvers
node_appsync -->|"routes agent requests"| node_workflow_resolvers
node_resolvers -->|"authorizes and persists"| node_identity_state
node_resolvers -->|"manages artifacts"| node_artifacts
node_workflow_resolvers -->|"starts and messages"| node_arbiter
node_arbiter -->|"invokes"| node_assessment
node_assessment -->|"assessment data"| node_design
node_design -->|"high-level design"| node_planning
node_planning -->|"execution plan"| node_implementation
node_assessment -.->|"retrieves context"| node_knowledge_base
node_design -->|"design output"| node_hld_pdf
node_hld_pdf -->|"stores PDF"| node_artifacts
node_assessment -.->|"stage progress"| node_events
node_design -.->|"stage progress"| node_events
node_planning -.->|"stage progress"| node_events
node_events -->|"delivers events"| node_progress_notifiers
node_progress_notifiers -->|"updates progress status"| node_appsync
node_deploy_script -->|"deploys"| node_cdk_app
node_cdk_app -.->|"provisions"| node_appsync
node_cdk_app -.->|"provisions"| node_arbiter
node_cdk_app -.->|"provisions"| node_knowledge_base

click node_react_spa "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/App.tsx"
click node_workflow_pages "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/pages/AgenticStudio.tsx"
click node_frontend_services "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/services/projectService.ts"
click node_amplify "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/config/amplify.ts"
click node_appsync "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/schema/schema.graphql"
click node_resolvers "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/lambda/project-resolver.ts"
click node_workflow_resolvers "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/lambda/fabricator-request-resolver.ts"
click node_progress_notifiers "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/lambda/design-progress-notifier.ts"
click node_identity_state "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/utils/auth.ts"
click node_assessment "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent1_assessment/agent.py"
click node_design "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent2_design/agent.py"
click node_planning "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent3_planning/agent3.py"
click node_implementation "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent4_implementation/agent4.py"
click node_arbiter "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/arbiter/fabricator/index.py"
click node_hld_pdf "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/hld_pdf_generator/lambda_handler.py"
click node_cdk_app "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/bin/app.ts"
click node_knowledge_base "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/knowledge_base/infrastructure.yaml"
click node_deploy_script "https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/deploy.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_react_spa,node_workflow_pages,node_frontend_services,node_amplify toneBlue
class node_appsync,node_resolvers,node_workflow_resolvers,node_progress_notifiers,node_identity_state,node_artifacts,node_events toneAmber
class node_assessment,node_design,node_planning,node_implementation toneMint
class node_arbiter,node_hld_pdf toneRose
class node_cdk_app,node_knowledge_base,node_deploy_script toneIndigo
```

## Components

### Frontend

- [React SPA](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/App.tsx): Vite React · Authenticated organization-scoped application workflows. · `frontend/src/App.tsx`
- [Workflow surfaces](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/pages/AgenticStudio.tsx): React pages · Dashboard, studio, assessment chat, and task-running views. · `frontend/src/pages/AgenticStudio.tsx`
- [API client services](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/services/projectService.ts): frontend services · `frontend/src/services/projectService.ts`
- [Amplify connectivity](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/frontend/src/config/amplify.ts): frontend config · `frontend/src/config/amplify.ts`

### Backend platform

- [AppSync GraphQL API](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/schema/schema.graphql): GraphQL API · Primary API contract and subscription-facing boundary. · `backend/src/schema/schema.graphql`
- [Resolver Lambdas](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/lambda/project-resolver.ts): Lambda handlers · Project, conversation, agent, document, and task operations. · `backend/src/lambda/project-resolver.ts`
- [Agent bridge handlers](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/lambda/fabricator-request-resolver.ts): Lambda handlers · Bridges fabrication requests and agent messages into orchestration. · `backend/src/lambda/fabricator-request-resolver.ts`
- [Progress notifiers](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/lambda/design-progress-notifier.ts): Lambda handlers · Converts asynchronous stage events into API-visible status. · `backend/src/lambda/design-progress-notifier.ts`
- [Identity and application state](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/src/utils/auth.ts): Cognito + DynamoDB · Role-scoped authentication and persisted workflow state. · `backend/src/utils/auth.ts`
- **Artifact storage**: S3 · Uploaded source material and generated deliverables.
- **Workflow events**: EventBridge · Asynchronous progress and activity transport.

### Agent delivery pipeline

- [Assessment agent](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent1_assessment/agent.py): Bedrock AgentCore agent · Collects business, commercial, governance, and technical requirements. · `service/agent1_assessment/agent.py`
- [Design agent](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent2_design/agent.py): Bedrock AgentCore agent · Produces an incremental high-level design from assessment data. · `service/agent2_design/agent.py`
- [Planning agent](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent3_planning/agent3.py): Bedrock AgentCore agent · Turns design output into executable planning work. · `service/agent3_planning/agent3.py`
- [Implementation agent](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/agent4_implementation/agent4.py): Bedrock AgentCore agent · Executes or coordinates implementation work. · `service/agent4_implementation/agent4.py`

### Agent orchestration

- [Arbiter](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/arbiter/fabricator/index.py): agent control layer · Fabricates, supervises, and invokes worker execution. · `arbiter/fabricator/index.py`
- [HLD PDF generation](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/hld_pdf_generator/lambda_handler.py): Lambda service · Renders design output into PDF artifacts. · `service/hld_pdf_generator/lambda_handler.py`

### Deployment and knowledge

- [CDK deployment](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/backend/bin/app.ts): AWS CDK · Composes backend, frontend, arbiter, services, and knowledge stacks. · `backend/bin/app.ts`
- [Knowledge base](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/service/knowledge_base/infrastructure.yaml): Bedrock KB + OpenSearch · Provisioned knowledge retrieval service with optional Confluence inputs. · `service/knowledge_base/infrastructure.yaml`
- [Deployment script](https://github.com/aws-samples/sample-agentic-ai-factory/blob/main/deploy.sh): shell entry point · `deploy.sh`

## Connections

- React SPA → Workflow surfaces: renders
- Workflow surfaces → API client services: uses
- API client services → Amplify connectivity: configures requests
- Amplify connectivity → AppSync GraphQL API: connects to
- AppSync GraphQL API → Resolver Lambdas: invokes
- AppSync GraphQL API → Agent bridge handlers: routes agent requests
- Resolver Lambdas → Identity and application state: authorizes and persists
- Resolver Lambdas → Artifact storage: manages artifacts
- Agent bridge handlers → Arbiter: starts and messages
- Arbiter → Assessment agent: invokes
- Assessment agent → Design agent: assessment data
- Design agent → Planning agent: high-level design
- Planning agent → Implementation agent: execution plan
- Assessment agent → Knowledge base: retrieves context
- Design agent → HLD PDF generation: design output
- HLD PDF generation → Artifact storage: stores PDF
- Assessment agent → Workflow events: stage progress
- Design agent → Workflow events: stage progress
- Planning agent → Workflow events: stage progress
- Workflow events → Progress notifiers: delivers events
- Progress notifiers → AppSync GraphQL API: updates progress status
- Deployment script → CDK deployment: deploys
- CDK deployment → AppSync GraphQL API: provisions
- CDK deployment → Arbiter: provisions
- CDK deployment → Knowledge base: provisions
