Study guide
5.5 Persistent State & Multi-Agent Coordination
AWS Certified Generative AI Developer - Professional AIP-C01
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & Foundation Model Fundamentals
1.1 AIP-C01 Exam Structure, Logistics & Passing Strategy 1.2 AIP-C01 Scoring & Professional Decision Strategy 1.3 Foundation Model Landscape & Model Selection on Amazon Bedrock 1.4 Model Abstraction, Controlled Switching & Resilience 1.5 Customization Spectrum: Prompting vs RAG vs Fine-Tuning vs Continued Pre-training 1.6 Custom Model Deployment & Lifecycle Management
2 Chapter 2: Bedrock Knowledge Bases & RAG Architectures
2.1 Managed RAG Architecture with Bedrock Knowledge Bases 2.2 Knowledge Source Integration, Synchronization & Freshness 2.3 Data Ingestion, Parsing & Chunking Strategies 2.4 Embedding Models & Vector Representations 2.5 Vector Index Scale, Migration & Retrieval Evaluation 2.6 Vector Database Selection: OpenSearch Serverless vs Aurora pgvector vs Managed Stores 2.7 Vector Store Security, Multi-Tenancy & Connectivity
3 Chapter 3: Advanced Vector Search, Indexing & Data Compliance
3.1 Hybrid Search, Metadata Filtering & Semantic Reranking 3.2 Metadata Filtering, Reranking & Query Transformation 3.3 Fine-Tuning & Continued Pre-Training Data Pipeline Engineering 3.4 Data Validation, Multimodal Processing & Model Formatting 3.5 Data Privacy, Data Residency & Compliance Governance 3.6 Privacy Preservation, Source Lineage & Audit Evidence
4 Chapter 4: Prompt Engineering & Bedrock Runtime APIs
4.1 Advanced Prompt Engineering Techniques & Inference Parameters 4.2 Inference Parameters, Prompt Governance & Regression 4.3 Converse API vs InvokeModel API & Message Formatting 4.4 Tool Calling, FM API Resilience & Model Routing 4.5 Streaming Architectures & Asynchronous Event Processing 4.6 Resilient Streaming, Deployment & Asynchronous Processing
5 Chapter 5: Amazon Bedrock Agents & Tool Integration
5.1 Agentic Architecture, ReAct Reasoning Loops & Orchestration 5.2 Agent Frameworks, MCP & Lifecycle Management 5.3 Action Groups, OpenAPI Schemas & AWS Lambda Integration 5.4 Agent Memory, Session State & Multi-Agent Collaboration Patterns 5.5 Persistent State & Multi-Agent Coordination 5.6 Advanced Agent Prompt Templates & Flow Customization 5.7 Agent Safeguards, Tool Reliability & Cost Control
6 Chapter 6: Workflow Orchestration & Application Integration
6.1 Amazon Bedrock Prompt Flows & Visual Orchestration 6.2 Step Functions Orchestration & Human-in-the-Loop Workflows 6.3 Enterprise Integration: API Gateway, AppSync, and EventBridge 6.4 Hybrid Integration, GenAI Gateways & CI/CD Tooling
7 Chapter 7: AI Safety & Guardrails for Amazon Bedrock
7.1 Guardrails Architecture, Denied Topics & Content Filters 7.2 Content Safety, Defense in Depth & Threat Detection 7.3 Sensitive Information Filters & PII Redaction/Masking 7.4 Contextual Grounding Checks & Hallucination Prevention
8 Chapter 8: Security, Access Control & Network Architecture
8.1 IAM Least Privilege & Resource Policies for Bedrock 8.2 PrivateLink VPC Endpoints & Network Isolation 8.3 Encryption with AWS KMS & Cross-Account Access Patterns
9 Chapter 9: Governance, Auditing & Operational Logging
9.1 SageMaker Model Cards & AI Governance Frameworks 9.2 Lineage, Fairness, Transparency & Continuous Governance 9.3 Invocation Logging, CloudTrail Auditing & Observability 9.4 Responsible AI, Bias Mitigation & Red Teaming Methodologies
10 Chapter 10: Performance, Throughput & Cost Optimization
10.1 On-Demand vs Provisioned Throughput & Capacity Planning 10.2 Capacity Measurement, Scaling Patterns & Resilience 10.3 Batch Inference & Bedrock Intelligent Prompt Routing 10.4 Intelligent Prompt Routing & Application Eligibility 10.5 Prompt Caching, Token Optimization & Latency Reduction
11 Chapter 11: Testing, Evaluation & Troubleshooting GenAI Solutions
11.1 Amazon Bedrock Model Evaluation (Automatic & Human Workflows) 11.2 Human, RAG & Continuous Evaluation 11.3 Evaluation Metrics & RAG Quality Benchmarking (Ragas, ROUGE, BLEU) 11.4 RAG and Agent Performance Evaluation 11.5 CloudWatch Metrics, Throttling & Operational Observability 11.6 Quota Diagnosis, Retry Control & Operational Troubleshooting 11.7 Troubleshooting Common GenAI Failure Modes & Agent Traces 11.8 Prompt Maintenance, Content Handling & Deployment Validation
5.5 Persistent State & Multi-Agent Coordination
Key Takeaways Explain This Topic AI
Separate short-lived invocation context from durable business state.
Use conditional writes, version fields, TTL, encryption, and tenant-scoped keys for persisted state.
Define delegation, conflict resolution, stopping conditions, and accountable ownership for multi-agent work.
Last updated: September 2026
- 5.5 Persistent State & Multi-Agent Coordination
- External State Persistence with Amazon DynamoDB
For enterprise architectures requiring full auditing, external CRM integration, or strict transactional guarantees, developers persist state externally using Amazon DynamoDB . ┌───────────────────────────┐
- │ Client / Web Portal │
- └─────────────┬─────────────┘
- │
- 1. Authenticate & Lookup │ 2. InvokeAgent(sessionId,
- Customer Profile │ sessionAttributes={...})
- ▼
- ┌───────────────────────────┐ ┌───────────────────────────┐
- │ Amazon DynamoDB │<───>│ API Gateway / Backend │
- │ (Customer Profiles, State,│ └─────────────┬─────────────┘
- │ Transaction Audit Log) │ │
- └───────────────────────────┘ ▼
- ┌───────────────────────────┐
- │ Amazon Bedrock Agent │
- │ (Orchestrates Actions) │
- └───────────────────────────┘
- Hydration Pattern
Session Initialization : When a user logs in, the backend microservice queries Amazon DynamoDB using the user's primary key ( PK=USER#12345 ).
Attribute Hydration : The backend injects essential profile metadata (e.g., accountType , region , creditTier ) into the sessionAttributes of the first InvokeAgent call.
Transactional Mutations : During agent execution, action group Lambda functions update the DynamoDB table directly to record transactions, maintaining an external, auditable single source of truth.
Multi-Agent Collaboration Patterns
In large enterprises, building a single "super-agent" with 30 action groups and 10 knowledge bases leads to severe operational degradation: the foundation model struggles to select the correct tool from a massive OpenAPI prompt, latency increases, and team-level domain separation is impossible. Production systems adopt Multi-Agent Collaboration .
1. Supervisor / Router Agent Pattern
The Supervisor Agent pattern consists of a lead agent that faces the user, analyzes incoming intent, and delegates tasks to specialized sub-agents (collaborator agents):
Supervisor (Router) Agent : Holds no direct database tools. Its instructions focus entirely on intent classification, conversational routing, and synthesizing sub-agent outputs.
Collaborator Agent A (HR Specialist) : Equipped with leave request tools and employee benefit Knowledge Bases.
Collaborator Agent B (IT Helpdesk Specialist) : Equipped with device management Lambda functions and network diagnostic tools.
Collaborator Agent C (Corporate Travel Specialist) : Equipped with flight booking and hotel reservation action groups. ┌─────────────────────────────┐
- │ End User │
- └──────────────┬──────────────┘
- │
- ▼
- ┌─────────────────────────────┐
- │ Supervisor Router Agent │
- └──────┬───────┬───────┬──────┘
- │ │ │
- ┌───────────────────────┘ │ └───────────────────────┐
- ▼ ▼ ▼
- ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐
- │ HR Specialist │ │ IT Helpdesk │ │ Travel Specialist │
- │ Agent │ │ Agent │ │ Agent │
- ├───────────────────────┤ ├───────────────────────┤ ├───────────────────────┤
- │ • Leave Action Group │ │ • Device Action Group │ │ • Flight Action Group │
- │ • HR Policy KB │ │ • IT Troubleshooting │ │ • Hotel Action Group │
- └───────────────────────┘ └───────────────────────┘ └───────────────────────┘
- 2. Sequential Multi-Agent Pipeline
In a sequential pipeline, agents execute in a predefined relay where the output of one agent serves as the input to the next:
Research Agent : Scours Bedrock Knowledge Bases and summarizes market reports.
Drafting Agent : Formulates a detailed technical proposal based on the research.
Compliance Reviewer Agent : Evaluates the draft against regulatory guardrails and approves or flags violations.
3. Native Multi-Agent Collaboration in Amazon Bedrock
Amazon Bedrock provides native support for multi-agent collaboration. Developers define an agent and add other Bedrock agents directly as Collaborator Agents within its configuration. The supervisor agent automatically receives the descriptions and capabilities of its collaborators, delegating sub-tasks autonomously without requiring custom glue code or intermediate API Gateway routing.
- Exam Scenarios & Common Architectural Traps
- Real-World Exam Scenario
An insurance provider is designing a claims assistant. When an authorized policyholder begins a session, the system must maintain their claimId throughout a 20-minute conversation. However, for a single sensitive turn where the user verifies their identity with a one-time SMS passcode, the passcode must be provided to the authentication Lambda function but must never remain in conversational memory or be accessible in subsequent turns.
Diagnosis & Resolution : The developer should pass the claimId in sessionAttributes so it persists across all turns for the duration of the session. The one-time SMS passcode should be passed strictly in promptSessionAttributes , ensuring it is available only for that specific turn's authentication check and is instantly purged upon turn completion.
Common Architectural Traps
Trap 1: Passing Complex Nested JSON in Session Attributes Without Stringification : sessionAttributes only accepts key-value pairs where both keys and values are strings ( map<string, string> ). Passing a nested object without calling json.dumps() causes an API serialization validation error.
Trap 2: Building Monolithic Multi-Domain Agents : Adding tools for HR, IT, Finance, and Legal into a single agent exhausts prompt token limits and severely degrades tool parameter selection accuracy. The Supervisor Multi-Agent pattern must be used instead.
Trap 3: Relying on Idle Session TTL for Permanent Data : Assuming Bedrock's native session storage will retain user data indefinitely. After 30 minutes of idle inactivity, session data is deleted. Long-term business state must always be persisted in DynamoDB or external databases.
Strands, Agent Squad, and MCP
The current blueprint explicitly includes Strands Agents, AWS Agent Squad, and Model Context Protocol (MCP). Strands provides an agent-development approach for model, tool, and loop composition. AWS Agent Squad is an example of coordinating specialized agents. These frameworks do not remove the need for a deterministic application boundary: define which agent owns a task, what evidence is handed off, how conflicts are resolved, and when the workflow stops.
MCP standardizes how a client discovers and invokes server capabilities. A lightweight stateless server can be implemented behind Lambda-oriented HTTP patterns; more complex or long-running tools can use container services such as ECS or AgentCore Runtime. Current AgentCore documentation supports streamable HTTP and both stateless and stateful MCP modes. Validate tool schemas, authenticate clients, authorize each operation, constrain egress, cap time and recursion, and treat all tool output as untrusted input to the model.