# aws-samples/amazon-bedrock-samples architecture

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

- Interactive diagram: https://gitdiagram.com/aws-samples/amazon-bedrock-samples
- Repository: https://github.com/aws-samples/amazon-bedrock-samples

## Overview

Amazon Bedrock Samples is a portfolio of independent examples, not one application. The principal user workflow is to obtain Bedrock access, choose a sample area, then follow that example’s own instructions toward a capability or use case. The graph preserves the README’s major capability branches and names substantial indexed modules; these belong to separate examples, so they are not presented as one runtime pipeline. Relationships within unsampled examples are omitted rather than inferred.

Main entry points: [`evaluation-observe/agent-observability/main.py`](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/main.py) (Agent tracing entry), [`evaluation-observe/open-telemetry-instrumentation/core/agent.py`](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/agent.py) (OTel agent), [`evaluation-observe/open-telemetry-instrumentation/core/handlers.py`](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/handlers.py) (OTel handlers), [`evaluation-observe/open-telemetry-instrumentation/core/timer_lib.py`](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/timer_lib.py) (OTel timers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_getting_started["Getting started"]
  node_bedrock_access["Bedrock access"]
  node_sample_areas["Sample areas"]
end

subgraph group_agents["Agents"]
  node_agents_examples["Agent examples"]
  node_agent_prompts["Agent prompts<br/>[prompts.ts]"]
  node_agent_classification["Agent classification"]
  node_text_to_sql["Text to SQL<br/>[app.py]"]
end

subgraph group_rag["RAG"]
  node_rag_examples["RAG examples"]
  node_rag_cdk_app["RAG CDK example<br/>[app.py]"]
  node_rag_query["Knowledge-base query<br/>[queryKBLambda.py]"]
  node_structured_retriever["Structured retriever"]
  node_managed_storage[("Managed KB storage")]
end

subgraph group_observability["Observability"]
  node_observability_examples["Observability examples"]
  node_agent_observe_entry["Agent tracing entry<br/>[main.py]"]
  node_agent_observe_handlers["Trace handlers<br/>[handlers.py]"]
  node_agent_observe_processors["Trace processors<br/>[processors.py]"]
  node_langfuse_deployment["Langfuse deployment<br/>[main.ts]"]
  node_otel_agent["OTel agent<br/>[agent.py]"]
  node_otel_handlers["OTel handlers<br/>[handlers.py]"]
  node_otel_timer["OTel timers<br/>[timer_lib.py]"]
  node_cost_reporting["Cost reporting<br/>[cdk_stack.py]"]
end

subgraph group_other_capabilities["Other capabilities"]
  node_prompt_engineering["Prompt engineering"]
  node_custom_models["Custom models"]
  node_multimodal["Multimodal"]
  node_generative_use_cases["Generative use cases"]
  node_responsible_ai["Responsible AI"]
  node_workshops["Workshops"]
  node_poc_prod["POC to production"]
  node_embeddings["Embeddings"]
end

node_learner(("Bedrock learner"))

node_learner -->|"gets access"| node_bedrock_access
node_learner -->|"chooses example"| node_sample_areas
node_sample_areas -->|"explores agents"| node_agents_examples
node_sample_areas -->|"explores RAG"| node_rag_examples
node_sample_areas -->|"explores observability"| node_observability_examples
node_sample_areas -->|"explores prompts"| node_prompt_engineering
node_sample_areas -->|"explores models"| node_custom_models
node_sample_areas -->|"explores multimodal"| node_multimodal
node_sample_areas -->|"explores use cases"| node_generative_use_cases
node_sample_areas -->|"explores responsible AI"| node_responsible_ai
node_sample_areas -->|"explores workshops"| node_workshops
node_sample_areas -->|"explores production"| node_poc_prod
node_sample_areas -->|"explores embeddings"| node_embeddings
node_agent_observe_entry -->|"sets tracer"| node_agent_observe_handlers
node_agent_observe_entry -->|"sets tracer"| node_agent_observe_processors
node_otel_handlers -->|"imports"| node_otel_timer
node_otel_agent -.->|"uses handlers"| node_otel_handlers
node_otel_agent -.->|"uses timers"| node_otel_timer

click node_agents_examples "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/agents-and-function-calling"
click node_agent_prompts "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/agents-and-function-calling/bedrock-agents/agent-blueprint-templates/lib/prompt_library/prompts.ts"
click node_agent_classification "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/agents-and-function-calling/bedrock-agents/agent-blueprint-templates/lib/stacks/05-agent-with-classification-instructions/agent-with-classification-instructions-stack.ts"
click node_text_to_sql "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/agents-and-function-calling/bedrock-agents/use-case-examples/text-2-sql-agent-cdk-enhanced/app.py"
click node_rag_examples "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/rag"
click node_rag_cdk_app "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/features-examples/04-infrastructure/e2e_rag_using_bedrock_kb_cdk/app.py"
click node_rag_query "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/features-examples/04-infrastructure/e2e-rag-using-bedrock-kb-cfn/lambdas/queryKBLambda.py"
click node_structured_retriever "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/use-case-examples/rag-using-structured-unstructured-data/custom_database_retriever.py"
click node_managed_storage "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/managed-knowledge-bases/03-use-case-example/04-bmkb-agentic-chatapplication/deploy/lib/storage-construct.ts"
click node_observability_examples "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/evaluation-observe"
click node_agent_observe_entry "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/main.py"
click node_agent_observe_handlers "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/handlers.py"
click node_agent_observe_processors "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/processors.py"
click node_langfuse_deployment "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/deploy-langfuse-on-ecs-fargate-with-typescript-cdk/lib/langfuse/main.ts"
click node_otel_agent "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/agent.py"
click node_otel_handlers "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/handlers.py"
click node_otel_timer "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/timer_lib.py"
click node_cost_reporting "https://github.com/aws-samples/amazon-bedrock-samples/blob/main/cost-reporting/converse-metadata-cost-reporting/cdk/cdk/cdk_stack.py"
click node_prompt_engineering "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/articles-guides"
click node_custom_models "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/custom-models"
click node_multimodal "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/multi-modal"
click node_generative_use_cases "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/genai-use-cases"
click node_responsible_ai "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/responsible_ai"
click node_workshops "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/workshops"
click node_poc_prod "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/poc-to-prod"
click node_embeddings "https://github.com/aws-samples/amazon-bedrock-samples/tree/main/embeddings"

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_bedrock_access,node_sample_areas toneBlue
class node_agents_examples,node_agent_prompts,node_agent_classification,node_text_to_sql toneAmber
class node_rag_examples,node_rag_cdk_app,node_rag_query,node_structured_retriever,node_managed_storage toneMint
class node_observability_examples,node_agent_observe_entry,node_agent_observe_handlers,node_agent_observe_processors,node_langfuse_deployment,node_otel_agent,node_otel_handlers,node_otel_timer,node_cost_reporting toneRose
class node_prompt_engineering,node_custom_models,node_multimodal,node_generative_use_cases,node_responsible_ai,node_workshops,node_poc_prod,node_embeddings,node_learner toneIndigo
```

## Components

### Getting started

- **Bedrock access**
- **Sample areas**

### Agents

- [Agent examples](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/agents-and-function-calling): `agents-and-function-calling`
- [Agent prompts](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/agents-and-function-calling/bedrock-agents/agent-blueprint-templates/lib/prompt_library/prompts.ts): `agents-and-function-calling/bedrock-agents/agent-blueprint-templates/lib/prompt_library/prompts.ts`
- [Agent classification](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/agents-and-function-calling/bedrock-agents/agent-blueprint-templates/lib/stacks/05-agent-with-classification-instructions/agent-with-classification-instructions-stack.ts): `agents-and-function-calling/bedrock-agents/agent-blueprint-templates/lib/stacks/05-agent-with-classification-instructions/agent-with-classification-instructions-stack.ts`
- [Text to SQL](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/agents-and-function-calling/bedrock-agents/use-case-examples/text-2-sql-agent-cdk-enhanced/app.py): `agents-and-function-calling/bedrock-agents/use-case-examples/text-2-sql-agent-cdk-enhanced/app.py`

### RAG

- [RAG examples](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/rag): `rag`
- [RAG CDK example](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/features-examples/04-infrastructure/e2e_rag_using_bedrock_kb_cdk/app.py): `rag/knowledge-bases/features-examples/04-infrastructure/e2e_rag_using_bedrock_kb_cdk/app.py`
- [Knowledge-base query](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/features-examples/04-infrastructure/e2e-rag-using-bedrock-kb-cfn/lambdas/queryKBLambda.py): `rag/knowledge-bases/features-examples/04-infrastructure/e2e-rag-using-bedrock-kb-cfn/lambdas/queryKBLambda.py`
- [Structured retriever](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/use-case-examples/rag-using-structured-unstructured-data/custom_database_retriever.py): `rag/knowledge-bases/use-case-examples/rag-using-structured-unstructured-data/custom_database_retriever.py`
- [Managed KB storage](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/managed-knowledge-bases/03-use-case-example/04-bmkb-agentic-chatapplication/deploy/lib/storage-construct.ts): `rag/managed-knowledge-bases/03-use-case-example/04-bmkb-agentic-chatapplication/deploy/lib/storage-construct.ts`

### Observability

- [Observability examples](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/evaluation-observe): `evaluation-observe`
- [Agent tracing entry](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/main.py): `evaluation-observe/agent-observability/main.py`
- [Trace handlers](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/handlers.py): `evaluation-observe/agent-observability/handlers.py`
- [Trace processors](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/agent-observability/processors.py): `evaluation-observe/agent-observability/processors.py`
- [Langfuse deployment](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/deploy-langfuse-on-ecs-fargate-with-typescript-cdk/lib/langfuse/main.ts): `evaluation-observe/deploy-langfuse-on-ecs-fargate-with-typescript-cdk/lib/langfuse/main.ts`
- [OTel agent](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/agent.py): `evaluation-observe/open-telemetry-instrumentation/core/agent.py`
- [OTel handlers](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/handlers.py): `evaluation-observe/open-telemetry-instrumentation/core/handlers.py`
- [OTel timers](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/evaluation-observe/open-telemetry-instrumentation/core/timer_lib.py): `evaluation-observe/open-telemetry-instrumentation/core/timer_lib.py`
- [Cost reporting](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/cost-reporting/converse-metadata-cost-reporting/cdk/cdk/cdk_stack.py): `cost-reporting/converse-metadata-cost-reporting/cdk/cdk/cdk_stack.py`

### Other capabilities

- [Prompt engineering](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/articles-guides): `articles-guides`
- [Custom models](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/custom-models): `custom-models`
- [Multimodal](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/multi-modal): `multi-modal`
- [Generative use cases](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/genai-use-cases): `genai-use-cases`
- [Responsible AI](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/responsible_ai): `responsible_ai`
- [Workshops](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/workshops): `workshops`
- [POC to production](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/poc-to-prod): `poc-to-prod`
- [Embeddings](https://github.com/aws-samples/amazon-bedrock-samples/tree/main/embeddings): `embeddings`

### Other components

- **Bedrock learner**

## Connections

- Bedrock learner → Bedrock access: gets access
- Bedrock learner → Sample areas: chooses example
- Sample areas → Agent examples: explores agents
- Sample areas → RAG examples: explores RAG
- Sample areas → Observability examples: explores observability
- Sample areas → Prompt engineering: explores prompts
- Sample areas → Custom models: explores models
- Sample areas → Multimodal: explores multimodal
- Sample areas → Generative use cases: explores use cases
- Sample areas → Responsible AI: explores responsible AI
- Sample areas → Workshops: explores workshops
- Sample areas → POC to production: explores production
- Sample areas → Embeddings: explores embeddings
- Agent tracing entry → Trace handlers: sets tracer (evidence: `evaluation-observe/agent-observability/main.py`)
- Agent tracing entry → Trace processors: sets tracer (evidence: `evaluation-observe/agent-observability/main.py`)
- OTel handlers → OTel timers: imports (evidence: `evaluation-observe/open-telemetry-instrumentation/core/handlers.py`)
- OTel agent → OTel handlers: uses handlers (evidence: `evaluation-observe/open-telemetry-instrumentation/core/handlers.py`)
- OTel agent → OTel timers: uses timers
