# rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo architecture

> Architecture diagram of the GitHub repository rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo
- Repository: https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo

## Overview

VIRA360 is a Bedrock AI-layer demo with four project-record capabilities: summarize threads, extract action items, search project history, and answer questions grounded in records. The Node workflow uses local seeded data for summarization and extraction, and managed Knowledge Base retrieval or a local Titan-vector index for search and Q&A. A parallel AgentCore workflow exposes those capabilities through a Strands agent, Gateway tools or local tools, and optional conversation memory. The graph distinguishes these paths; AgentCore resource provisioning and local-index persistence details are only partly evidenced by the excerpts.

Main entry points: [`src/bedrock.js`](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/bedrock.js) (Bedrock Wrappers), [`agent/runtime/main.py`](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/runtime/main.py) (Strands Runtime), [`src/retrieve.js`](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/retrieve.js) (Retrieval Switch), [`agent/common/core.py`](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/common/core.py) (Shared Tool Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_node_usecases["Node Use Cases"]
  node_summarize["Summarize Thread<br/>[summarize.js]"]
  node_extract["Extract Actions<br/>[extract.js]"]
  node_search["Semantic Search<br/>[search.js]"]
  node_assistant["Grounded Assistant<br/>[assistant.js]"]
end

subgraph group_node_data["Node Data And Retrieval"]
  node_config["Model Configuration<br/>[config.js]"]
  node_bedrock["Bedrock Wrappers<br/>[bedrock.js]"]
  node_project_docs["Seeded Project Records<br/>[project-docs.js]"]
  node_ingest["Local Index Ingest<br/>[ingest.js]"]
  node_retrieve["Retrieval Switch<br/>[retrieve.js]"]
  node_local_index[("Local Vector Index<br/>[retrieve.js]")]
end

subgraph group_agent_runtime["AgentCore Runtime"]
  node_invoke["Agent Invocation<br/>[invoke.py]"]
  node_runtime["Strands Runtime<br/>[main.py]"]
  node_prompts["Agent Prompts<br/>[prompts.py]"]
end

subgraph group_agent_tools["AgentCore Tools"]
  node_gateway_tools["Gateway Lambda Tools<br/>[handler.py]"]
  node_local_tools["Local Agent Tools<br/>[local_tools.py]"]
  node_tool_core["Shared Tool Logic<br/>[core.py]"]
  node_agent_data["Agent Project Records"]
end

node_user(("Demo User"))
node_bedrock_service["Amazon Bedrock"]
node_managed_kb[("Managed Knowledge Base")]
node_agent_user(("Agent User"))
node_memory[("AgentCore Memory")]
node_gateway["AgentCore Gateway"]
node_s3_docs[("S3 Document Fallback")]

node_user -->|"runs"| node_summarize
node_user -->|"runs"| node_extract
node_user -->|"runs"| node_search
node_user -->|"runs"| node_assistant
node_summarize -->|"reads thread"| node_project_docs
node_extract -->|"reads thread"| node_project_docs
node_summarize -->|"requests summary"| node_bedrock
node_extract -->|"requests extraction"| node_bedrock
node_search -->|"retrieves passages"| node_retrieve
node_assistant -->|"gets context"| node_retrieve
node_assistant -->|"generates answer"| node_bedrock
node_bedrock -->|"calls models"| node_bedrock_service
node_bedrock -->|"reads embedding model"| node_config
node_retrieve -->|"reads region and KB"| node_config
node_retrieve -->|"embeds query"| node_bedrock
node_retrieve -->|"retrieves passages"| node_managed_kb
node_retrieve -->|"reads vectors"| node_local_index
node_ingest -->|"embeds records"| node_project_docs
node_ingest -->|"creates embeddings"| node_bedrock
node_ingest -->|"writes vectors"| node_local_index
node_agent_user -->|"invokes"| node_invoke
node_invoke -.->|"calls runtime"| node_runtime
node_runtime -->|"uses system prompt"| node_prompts
node_runtime -->|"lists tools"| node_gateway
node_runtime -->|"loads session context"| node_memory
node_runtime -->|"falls back to"| node_local_tools
node_runtime -.->|"runs model"| node_bedrock_service
node_gateway -.->|"dispatches tools"| node_gateway_tools
node_gateway_tools -->|"dispatches tool call"| node_tool_core
node_local_tools -->|"delegates calls"| node_tool_core
node_tool_core -->|"calls models and retrieval"| node_bedrock_service
node_tool_core -->|"reads bundled records"| node_agent_data
node_tool_core -->|"falls back to"| node_s3_docs
node_tool_core -->|"searches and answers"| node_managed_kb

click node_summarize "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/summarize.js"
click node_extract "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/extract.js"
click node_search "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/search.js"
click node_assistant "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/assistant.js"
click node_config "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/config.js"
click node_bedrock "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/bedrock.js"
click node_project_docs "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/data/project-docs.js"
click node_ingest "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/ingest.js"
click node_retrieve "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/retrieve.js"
click node_local_index "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/retrieve.js"
click node_invoke "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/invoke.py"
click node_runtime "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/runtime/main.py"
click node_prompts "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/common/prompts.py"
click node_gateway_tools "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/lambda_tools/handler.py"
click node_local_tools "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/runtime/local_tools.py"
click node_tool_core "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/common/core.py"
click node_agent_data "https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/tree/main/agent/data"

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_summarize,node_extract,node_search,node_assistant,node_user,node_agent_user toneBlue
class node_config,node_bedrock,node_project_docs,node_ingest,node_retrieve,node_local_index,node_managed_kb,node_memory,node_s3_docs toneAmber
class node_invoke,node_runtime,node_prompts toneMint
class node_gateway_tools,node_local_tools,node_tool_core,node_agent_data toneRose
class node_bedrock_service,node_gateway toneIndigo
```

## Components

### Node Use Cases

- [Summarize Thread](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/summarize.js): `src/summarize.js`
- [Extract Actions](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/extract.js): `src/extract.js`
- [Semantic Search](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/search.js): `src/search.js`
- [Grounded Assistant](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/assistant.js): `src/assistant.js`

### Node Data And Retrieval

- [Model Configuration](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/config.js): `src/config.js`
- [Bedrock Wrappers](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/bedrock.js): `src/bedrock.js`
- [Seeded Project Records](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/data/project-docs.js): `src/data/project-docs.js`
- [Local Index Ingest](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/ingest.js): `src/ingest.js`
- [Retrieval Switch](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/retrieve.js): `src/retrieve.js`
- [Local Vector Index](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/src/retrieve.js): `src/retrieve.js`

### AgentCore Runtime

- [Agent Invocation](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/invoke.py): `agent/invoke.py`
- [Strands Runtime](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/runtime/main.py): `agent/runtime/main.py`
- [Agent Prompts](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/common/prompts.py): `agent/common/prompts.py`

### AgentCore Tools

- [Gateway Lambda Tools](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/lambda_tools/handler.py): `agent/lambda_tools/handler.py`
- [Local Agent Tools](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/runtime/local_tools.py): `agent/runtime/local_tools.py`
- [Shared Tool Logic](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/blob/main/agent/common/core.py): `agent/common/core.py`
- [Agent Project Records](https://github.com/rajeshkumarsomu1983/amazon-bedrock-ai-layer-demo/tree/main/agent/data): `agent/data`

### Other components

- **Demo User**
- **Amazon Bedrock**
- **Managed Knowledge Base**
- **Agent User**
- **AgentCore Memory**
- **AgentCore Gateway**
- **S3 Document Fallback**

## Connections

- Demo User → Summarize Thread: runs
- Demo User → Extract Actions: runs
- Demo User → Semantic Search: runs
- Demo User → Grounded Assistant: runs
- Summarize Thread → Seeded Project Records: reads thread (evidence: `src/summarize.js`)
- Extract Actions → Seeded Project Records: reads thread (evidence: `src/extract.js`)
- Summarize Thread → Bedrock Wrappers: requests summary (evidence: `src/summarize.js`)
- Extract Actions → Bedrock Wrappers: requests extraction (evidence: `src/extract.js`)
- Semantic Search → Retrieval Switch: retrieves passages (evidence: `src/search.js`)
- Grounded Assistant → Retrieval Switch: gets context (evidence: `src/assistant.js`)
- Grounded Assistant → Bedrock Wrappers: generates answer (evidence: `src/assistant.js`)
- Bedrock Wrappers → Amazon Bedrock: calls models (evidence: `src/bedrock.js`)
- Bedrock Wrappers → Model Configuration: reads embedding model (evidence: `src/bedrock.js`)
- Retrieval Switch → Model Configuration: reads region and KB (evidence: `src/retrieve.js`)
- Retrieval Switch → Bedrock Wrappers: embeds query (evidence: `src/retrieve.js`)
- Retrieval Switch → Managed Knowledge Base: retrieves passages (evidence: `src/retrieve.js`)
- Retrieval Switch → Local Vector Index: reads vectors (evidence: `src/retrieve.js`)
- Local Index Ingest → Seeded Project Records: embeds records (evidence: `src/ingest.js`)
- Local Index Ingest → Bedrock Wrappers: creates embeddings (evidence: `src/ingest.js`)
- Local Index Ingest → Local Vector Index: writes vectors (evidence: `src/ingest.js`)
- Agent User → Agent Invocation: invokes
- Agent Invocation → Strands Runtime: calls runtime (evidence: `README.md`)
- Strands Runtime → Agent Prompts: uses system prompt (evidence: `agent/runtime/main.py`)
- Strands Runtime → AgentCore Gateway: lists tools (evidence: `agent/runtime/main.py`)
- Strands Runtime → AgentCore Memory: loads session context (evidence: `agent/runtime/main.py`)
- Strands Runtime → Local Agent Tools: falls back to (evidence: `agent/runtime/main.py`)
- Strands Runtime → Amazon Bedrock: runs model
- AgentCore Gateway → Gateway Lambda Tools: dispatches tools (evidence: `README.md`)
- Gateway Lambda Tools → Shared Tool Logic: dispatches tool call (evidence: `agent/lambda_tools/handler.py`)
- Local Agent Tools → Shared Tool Logic: delegates calls (evidence: `agent/runtime/local_tools.py`)
- Shared Tool Logic → Amazon Bedrock: calls models and retrieval (evidence: `agent/common/core.py`)
- Shared Tool Logic → Agent Project Records: reads bundled records (evidence: `agent/common/core.py`)
- Shared Tool Logic → S3 Document Fallback: falls back to (evidence: `agent/common/core.py`)
- Shared Tool Logic → Managed Knowledge Base: searches and answers (evidence: `agent/common/core.py`)
