How aws-samples/sample-agentic-ai-factory works
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: schema.graphql AppSync GraphQL API · agent1_assessment/agent.py Assessment agent · agent2_design/agent.py Design agent · app.ts CDK deployment
Components 20
Frontend
- React SPA · Authenticated organization-scoped application workflows.
frontend/src/App.tsx - Workflow surfaces · Dashboard, studio, assessment chat, and task-running views.
frontend/src/pages/AgenticStudio.tsx - API client services
frontend/src/services/projectService.ts - Amplify connectivity
frontend/src/config/amplify.ts
Backend platform
- AppSync GraphQL API · Primary API contract and subscription-facing boundary.
backend/src/schema/schema.graphql - Resolver Lambdas · Project, conversation, agent, document, and task operations.
backend/src/lambda/project-resolver.ts - Agent bridge handlers · Bridges fabrication requests and agent messages into orchestration.
backend/src/lambda/fabricator-request-resolver.ts - Progress notifiers · Converts asynchronous stage events into API-visible status.
backend/src/lambda/design-progress-notifier.ts - Identity and application state · Role-scoped authentication and persisted workflow state.
backend/src/utils/auth.ts - Artifact storage · Uploaded source material and generated deliverables.
- Workflow events · Asynchronous progress and activity transport.
Agent delivery pipeline
- Assessment agent · Collects business, commercial, governance, and technical requirements.
service/agent1_assessment/agent.py - Design agent · Produces an incremental high-level design from assessment data.
service/agent2_design/agent.py - Planning agent · Turns design output into executable planning work.
service/agent3_planning/agent3.py - Implementation agent · Executes or coordinates implementation work.
service/agent4_implementation/agent4.py
Agent orchestration
- Arbiter · Fabricates, supervises, and invokes worker execution.
arbiter/fabricator/index.py - HLD PDF generation · Renders design output into PDF artifacts.
service/hld_pdf_generator/lambda_handler.py
Deployment and knowledge
- CDK deployment · Composes backend, frontend, arbiter, services, and knowledge stacks.
backend/bin/app.ts - Knowledge base · Provisioned knowledge retrieval service with optional Confluence inputs.
service/knowledge_base/infrastructure.yaml - Deployment script
deploy.sh
Connections 25
- 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