# aws-solutions-library-samples/qnabot-on-aws architecture

> Architecture diagram of the GitHub repository aws-solutions-library-samples/qnabot-on-aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-solutions-library-samples/qnabot-on-aws
- Repository: https://github.com/aws-solutions-library-samples/qnabot-on-aws

## Overview

QnABot on AWS is a multi-channel, multilingual conversational support product with a Content Designer for managing its question bank and settings. The main user flow runs from a chat or voice channel through Lex and Bot Fulfillment, which searches OpenSearch and can use language services, Bedrock, Kendra, and streaming; interaction logs support later analysis. The graph also shows administration, content ingestion, integrations, and core fulfillment internals. Runtime links are grounded in the README or shown source references; unsampled subsystem details are represented only where the README documents them.

Main entry points: [`source/lambda/fulfillment/index.js`](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/index.js) (Bot Fulfillment), [`source/lambda/es-proxy-layer/lib/es_query.js`](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/es_query.js) (Question search), [`source/website/js/lib/router.js`](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/lib/router.js) (Admin tools), [`source/templates/master/index.js`](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/index.js) (Content Lambda)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Content administration"]
  node_designer["Content Designer<br/>[index.vue]"]
  node_admin_routes["Admin tools<br/>[router.js]"]
end

subgraph group_content["Content and search"]
  node_content_api["Content API<br/>[index.js]"]
  node_content_lambda["Content Lambda<br/>[index.js]"]
  node_question_bank[("Question bank")]
  node_settings[("Settings store")]
  node_importer["Content import<br/>[index.js]"]
  node_exporter["Content export<br/>[index.js]"]
  node_embeddings["Embedding models<br/>[bedrockClient.js]"]
end

subgraph group_fulfillment["Conversation runtime"]
  node_fulfillment["Bot Fulfillment<br/>[index.js]"]
  node_query_middleware["Query middleware<br/>[3_query.js]"]
  node_lex_router["Lex router<br/>[lexRouter.js]"]
  node_language["Language handling<br/>[multilanguage.js]"]
  node_specialty["Specialty bots"]
  node_search["Question search<br/>[es_query.js]"]
  node_query_builder["Query builder<br/>[esbodybuilder.js]"]
  node_qid["QID matching<br/>[qid.js]"]
  node_kendra_event["Kendra FAQ lookup<br/>[runKendraQuery.js]"]
  node_kendra_query["Kendra query<br/>[kendraQuery.js]"]
  node_kendra_client["Kendra client<br/>[kendraClient.js]"]
  node_bedrock["Amazon Bedrock"]
  node_kendra["Amazon Kendra"]
  node_language_services["Language services"]
end

subgraph group_channels["Channels and operations"]
  node_channels["Chat and voice<br/>[client.vue]"]
  node_lex["Amazon Lex<br/>[fulfillment.js]"]
  node_websocket["Streaming WebSocket<br/>[index.js]"]
  node_firehose["Kinesis Firehose"]
  node_analytics[("S3 analytics")]
end

node_admin(("Administrator"))
node_chat_user(("Chat user"))

node_admin -->|"manages content"| node_designer
node_designer -->|"saves questions"| node_content_api
node_admin_routes -->|"routes to"| node_designer
node_admin_routes -.->|"routes to import"| node_importer
node_admin_routes -->|"routes to export"| node_exporter
node_admin_routes -->|"routes to settings"| node_settings
node_content_api -->|"invokes"| node_content_lambda
node_content_lambda -->|"writes questions"| node_question_bank
node_content_lambda -->|"writes settings"| node_settings
node_content_lambda -.->|"requests embeddings"| node_embeddings
node_embeddings -.->|"embeds content"| node_question_bank
node_chat_user -->|"asks question"| node_channels
node_channels -->|"sends interaction"| node_lex
node_lex -->|"forwards request"| node_fulfillment
node_fulfillment -.->|"processes request"| node_query_middleware
node_query_middleware -->|"routes query"| node_lex_router
node_lex_router -->|"uses language handling"| node_language
node_lex_router -->|"routes specialty bot"| node_specialty
node_query_middleware -->|"invokes router"| node_specialty
node_fulfillment -->|"searches questions"| node_search
node_search -->|"builds query"| node_query_builder
node_search -->|"checks QID"| node_qid
node_search -->|"searches index"| node_question_bank
node_fulfillment -->|"translates requests"| node_language_services
node_fulfillment -.->|"uses LLM features"| node_bedrock
node_fulfillment -.->|"checks FAQ fallback"| node_kendra_event
node_kendra_event -->|"runs lookup"| node_kendra_query
node_kendra_event -->|"determines language"| node_kendra_client
node_kendra_query -->|"retrieves QID match"| node_search
node_kendra_query -->|"uses client"| node_kendra_client
node_kendra_query -->|"queries index"| node_kendra
node_fulfillment -.->|"streams response"| node_websocket
node_fulfillment -->|"sends logs"| node_firehose
node_firehose -->|"delivers records"| node_analytics

click node_designer "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/components/designer/index.vue"
click node_admin_routes "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/lib/router.js"
click node_content_api "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/routes/index.js"
click node_content_lambda "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/index.js"
click node_importer "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/import/index.js"
click node_exporter "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/export/index.js"
click node_embeddings "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/bedrock/bedrockClient.js"
click node_channels "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/client.vue"
click node_lex "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/lex/fulfillment.js"
click node_fulfillment "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/index.js"
click node_query_middleware "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/3_query.js"
click node_lex_router "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/lexRouter.js"
click node_language "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/multilanguage.js"
click node_specialty "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/specialtyBotRouter.js"
click node_search "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/es_query.js"
click node_query_builder "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/esbodybuilder.js"
click node_qid "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/fulfillment-event/qid.js"
click node_kendra_event "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/fulfillment-event/runKendraQuery.js"
click node_kendra_query "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/kendraQuery.js"
click node_kendra_client "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/kendraClient.js"
click node_websocket "https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/streaming/index.js"

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_designer,node_admin_routes,node_chat_user toneBlue
class node_content_api,node_content_lambda,node_question_bank,node_settings,node_importer,node_exporter,node_embeddings toneAmber
class node_fulfillment,node_query_middleware,node_lex_router,node_language,node_specialty,node_search,node_query_builder,node_qid,node_kendra_event,node_kendra_query,node_kendra_client,node_bedrock,node_kendra,node_language_services toneMint
class node_channels,node_lex,node_websocket,node_firehose,node_analytics toneRose
class node_admin toneIndigo
```

## Components

### Content administration

- [Content Designer](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/components/designer/index.vue): `source/website/js/components/designer/index.vue`
- [Admin tools](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/lib/router.js): `source/website/js/lib/router.js`

### Content and search

- [Content API](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/routes/index.js): `source/templates/master/routes/index.js`
- [Content Lambda](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/index.js): `source/templates/master/index.js`
- **Question bank**
- **Settings store**
- [Content import](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/import/index.js): `source/lambda/import/index.js`
- [Content export](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/export/index.js): `source/lambda/export/index.js`
- [Embedding models](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/bedrock/bedrockClient.js): `source/lambda/es-proxy-layer/lib/bedrock/bedrockClient.js`

### Conversation runtime

- [Bot Fulfillment](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/index.js): `source/lambda/fulfillment/index.js`
- [Query middleware](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/3_query.js): `source/lambda/fulfillment/lib/middleware/3_query.js`
- [Lex router](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/lexRouter.js): `source/lambda/fulfillment/lib/middleware/lexRouter.js`
- [Language handling](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/multilanguage.js): `source/lambda/fulfillment/lib/middleware/multilanguage.js`
- [Specialty bots](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/fulfillment/lib/middleware/specialtyBotRouter.js): `source/lambda/fulfillment/lib/middleware/specialtyBotRouter.js`
- [Question search](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/es_query.js): `source/lambda/es-proxy-layer/lib/es_query.js`
- [Query builder](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/esbodybuilder.js): `source/lambda/es-proxy-layer/lib/esbodybuilder.js`
- [QID matching](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/fulfillment-event/qid.js): `source/lambda/es-proxy-layer/lib/fulfillment-event/qid.js`
- [Kendra FAQ lookup](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/fulfillment-event/runKendraQuery.js): `source/lambda/es-proxy-layer/lib/fulfillment-event/runKendraQuery.js`
- [Kendra query](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/kendraQuery.js): `source/lambda/es-proxy-layer/lib/kendraQuery.js`
- [Kendra client](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/es-proxy-layer/lib/kendraClient.js): `source/lambda/es-proxy-layer/lib/kendraClient.js`
- **Amazon Bedrock**
- **Amazon Kendra**
- **Language services**

### Channels and operations

- [Chat and voice](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/website/js/client.vue): `source/website/js/client.vue`
- [Amazon Lex](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/templates/master/lex/fulfillment.js): `source/templates/master/lex/fulfillment.js`
- [Streaming WebSocket](https://github.com/aws-solutions-library-samples/qnabot-on-aws/blob/main/source/lambda/streaming/index.js): `source/lambda/streaming/index.js`
- **Kinesis Firehose**
- **S3 analytics**

### Other components

- **Administrator**
- **Chat user**

## Connections

- Administrator → Content Designer: manages content (evidence: `README.md`)
- Content Designer → Content API: saves questions (evidence: `README.md`)
- Admin tools → Content Designer: routes to (evidence: `source/website/js/lib/router.js`)
- Admin tools → Content import: routes to import
- Admin tools → Content export: routes to export (evidence: `source/website/js/lib/router.js`)
- Admin tools → Settings store: routes to settings (evidence: `source/website/js/lib/router.js`)
- Content API → Content Lambda: invokes (evidence: `README.md`)
- Content Lambda → Question bank: writes questions (evidence: `README.md`)
- Content Lambda → Settings store: writes settings (evidence: `README.md`)
- Content Lambda → Embedding models: requests embeddings (evidence: `README.md`)
- Embedding models → Question bank: embeds content (evidence: `README.md`)
- Chat user → Chat and voice: asks question (evidence: `README.md`)
- Chat and voice → Amazon Lex: sends interaction (evidence: `README.md`)
- Amazon Lex → Bot Fulfillment: forwards request (evidence: `README.md`)
- Bot Fulfillment → Query middleware: processes request
- Query middleware → Lex router: routes query (evidence: `source/lambda/fulfillment/lib/middleware/3_query.js`)
- Lex router → Language handling: uses language handling (evidence: `source/lambda/fulfillment/lib/middleware/lexRouter.js`)
- Lex router → Specialty bots: routes specialty bot (evidence: `source/lambda/fulfillment/lib/middleware/lexRouter.js`)
- Query middleware → Specialty bots: invokes router (evidence: `source/lambda/fulfillment/lib/middleware/3_query.js`)
- Bot Fulfillment → Question search: searches questions (evidence: `README.md`)
- Question search → Query builder: builds query (evidence: `source/lambda/es-proxy-layer/lib/es_query.js`)
- Question search → QID matching: checks QID (evidence: `source/lambda/es-proxy-layer/lib/es_query.js`)
- Question search → Question bank: searches index (evidence: `README.md`)
- Bot Fulfillment → Language services: translates requests (evidence: `README.md`)
- Bot Fulfillment → Amazon Bedrock: uses LLM features (evidence: `README.md`)
- Bot Fulfillment → Kendra FAQ lookup: checks FAQ fallback
- Kendra FAQ lookup → Kendra query: runs lookup (evidence: `source/lambda/es-proxy-layer/lib/fulfillment-event/runKendraQuery.js`)
- Kendra FAQ lookup → Kendra client: determines language (evidence: `source/lambda/es-proxy-layer/lib/fulfillment-event/runKendraQuery.js`)
- Kendra query → Question search: retrieves QID match (evidence: `source/lambda/es-proxy-layer/lib/kendraQuery.js`)
- Kendra query → Kendra client: uses client (evidence: `source/lambda/es-proxy-layer/lib/kendraQuery.js`)
- Kendra query → Amazon Kendra: queries index (evidence: `README.md`)
- Bot Fulfillment → Streaming WebSocket: streams response (evidence: `README.md`)
- Bot Fulfillment → Kinesis Firehose: sends logs (evidence: `README.md`)
- Kinesis Firehose → S3 analytics: delivers records (evidence: `README.md`)
