Task 2.5: Application Integration Patterns

Task 2.5: Application integration patterns và development tools

Skill 2.5.1: FM API interfaces

Kiến thức cần nắm:

  • API Gateway cho streaming responses
  • Token limit management
  • Retry strategies cho model timeouts

Giải thích chi tiết:

Token Management:

  • Mỗi model có context window limit (ví dụ: Claude 3 Sonnet = 200K tokens)
  • Input tokens + Output tokens phải nằm trong limit
  • Cần estimate token count trước khi gọi API
  • Truncate hoặc summarize input nếu vượt limit

API Gateway cho GenAI:

  • WebSocket APIs cho streaming responses
  • Request/response transformation
  • Usage plans cho rate limiting per client
  • Custom authorizers cho authentication

Skill 2.5.2: Accessible AI interfaces

Kiến thức cần nắm:

  • AWS Amplify cho declarative UI components
  • OpenAPI specifications cho API-first development
  • Amazon Bedrock Prompt Flows cho no-code workflow builders

Giải thích chi tiết:

Amplify + GenAI:

  • Amplify Gen 2 hỗ trợ AI-powered features
  • Pre-built UI components cho chat interfaces
  • Backend integration với Bedrock qua AppSync

Bedrock Prompt Flows:

  • Visual workflow builder (no-code/low-code)
  • Kết nối nhiều prompts thành pipeline
  • Conditional branching dựa trên model responses
  • Tích hợp với Knowledge Bases và Agents

Skill 2.5.3: Business system enhancements

Kiến thức cần nắm:

  • Lambda cho CRM enhancements
  • Step Functions cho document processing
  • Amazon Q Business data sources cho internal knowledge tools
  • Amazon Bedrock Data Automation cho automated data processing

Giải thích chi tiết:

Amazon Q Business:

  • Enterprise AI assistant
  • Kết nối với 40+ data sources (S3, SharePoint, Confluence, Salesforce…)
  • Role-based access control
  • Customizable guardrails

Document Processing Pipeline:

Documents → S3 → Textract (OCR) → Comprehend (NER)
    ↓
Bedrock (Summarize/Classify) → DynamoDB (Store results)
    ↓
Step Functions orchestrates entire workflow

Skill 2.5.4: Developer productivity

Kiến thức cần nắm:

  • Amazon Q Developer cho code generation, refactoring
  • AI-assisted code suggestions
  • AI component testing và performance optimization

Giải thích chi tiết:

Amazon Q Developer capabilities:

  • Code generation và completion
  • Code transformation (language migration)
  • Security vulnerability scanning
  • Code review và optimization suggestions
  • /dev command cho feature development
  • /transform cho code modernization

Skill 2.5.5: Advanced GenAI applications

Kiến thức cần nắm:

  • Strands AgentsAWS Agent Squad cho AWS-native orchestration
  • Step Functions cho agent design patterns
  • Amazon Bedrock cho prompt chaining patterns

Giải thích chi tiết:

Prompt Chaining Pattern:

Step 1: Extract key entities from document
    ↓
Step 2: Research each entity using Knowledge Base
    ↓
Step 3: Generate comprehensive analysis
    ↓
Step 4: Format output for business stakeholders

Mỗi step sử dụng output của step trước làm input, tạo thành pipeline xử lý phức tạp.

Skill 2.5.6: Troubleshooting efficiency

Kiến thức cần nắm:

  • CloudWatch Logs Insights cho prompt/response analysis
  • X-Ray cho FM API call tracing
  • Amazon Q Developer cho GenAI-specific error pattern recognition

Giải thích chi tiết:

Observability Stack cho GenAI:

ToolMục đích
CloudWatch LogsLog prompts, responses, errors
CloudWatch MetricsToken usage, latency, error rates
X-RayEnd-to-end request tracing
CloudWatch Logs InsightsQuery và analyze log patterns
CloudWatch DashboardsVisualize GenAI metrics

CloudWatch Logs Insights query ví dụ:

fields @timestamp, @message
| filter @message like /ThrottlingException/
| stats count() by bin(1h)

Tài liệu tham khảo