Serverless RAG (Retrieval-Augmented Generation) architecture combining S3-based document stores with an Aurora Serverless PostgreSQL pgvector database and Amazon ECS container processors.
sequenceDiagram
Client->>CloudFront: HTTPS Query
CloudFront->>API Gateway: Route API Traffic
API Gateway->>Orchestrator Lambda: Parse payload
Orchestrator->>DynamoDB: Log user session state
Orchestrator->>RAG Lambda (VPC): Synchronous trigger
RAG Lambda->>Aurora PostgreSQL: pgvector similarity query
Aurora PostgreSQL-->>RAG Lambda: Context chunk payload
RAG Lambda->>LLM Provider: Grounded prompt execution
LLM Provider-->>RAG Lambda: Formulated answer
RAG Lambda-->>Orchestrator: 200 OK Response
Orchestrator-->>Client: Answer Output