# aws-samples/text-to-querydsl architecture

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

- Interactive diagram: https://gitdiagram.com/aws-samples/text-to-querydsl
- Repository: https://github.com/aws-samples/text-to-querydsl

## Overview

This repository is a notebook-based guide to generating OpenSearch/Elasticsearch DSL queries from natural language with Claude 3, alongside synthetic data generation from supplied schemas. The principal workflow runs in the notebook and uses Amazon Bedrock’s Converse API; the schemas provide domain context. The README documents these capabilities, but no notebook source excerpts were available, so internal call order and finer implementation details are not shown.

Main entry points: [`text2ES_prompting_guide.ipynb`](https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb) (Prompting notebook), [`schemas/healthpost_schema.json`](https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/healthpost_schema.json) (Healthpost schema), [`schemas/userprofile_schema.json`](https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/userprofile_schema.json) (User profile schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Notebook workflow"]
  node_notebook["Prompting notebook"]
  node_synthetic["Synthetic data"]
  node_querydsl["Query DSL prompt"]
end

subgraph group_schemas["Domain schemas"]
  node_healthpost["Healthpost schema"]
  node_healthpost_index["Healthpost schema index"]
  node_userprofile["User profile schema"]
  node_userprofile_index["User profile schema index"]
end

subgraph group_services["External services"]
  node_bedrock{{"Amazon Bedrock"}}
end

node_user(("Engineer"))

node_user -->|"uses"| node_notebook
node_notebook -->|"uses schema"| node_healthpost
node_notebook -->|"uses schema"| node_userprofile
node_notebook -->|"generates"| node_synthetic
node_notebook -->|"prompts for"| node_querydsl
node_notebook -->|"uses Converse API"| node_bedrock

click node_notebook "https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb"
click node_synthetic "https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb"
click node_querydsl "https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb"
click node_healthpost "https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/healthpost_schema.json"
click node_healthpost_index "https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/healthpost_schema_index.json"
click node_userprofile "https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/userprofile_schema.json"
click node_userprofile_index "https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/userprofile_schema_index.json"

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_notebook,node_synthetic,node_querydsl toneBlue
class node_healthpost,node_healthpost_index,node_userprofile,node_userprofile_index toneAmber
class node_bedrock toneMint
class node_user toneIndigo
```

## Components

### Notebook workflow

- [Prompting notebook](https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb): `text2ES_prompting_guide.ipynb`
- [Synthetic data](https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb): `text2ES_prompting_guide.ipynb`
- [Query DSL prompt](https://github.com/aws-samples/text-to-querydsl/blob/main/text2ES_prompting_guide.ipynb): `text2ES_prompting_guide.ipynb`

### Domain schemas

- [Healthpost schema](https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/healthpost_schema.json): `schemas/healthpost_schema.json`
- [Healthpost schema index](https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/healthpost_schema_index.json): `schemas/healthpost_schema_index.json`
- [User profile schema](https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/userprofile_schema.json): `schemas/userprofile_schema.json`
- [User profile schema index](https://github.com/aws-samples/text-to-querydsl/blob/main/schemas/userprofile_schema_index.json): `schemas/userprofile_schema_index.json`

### External services

- **Amazon Bedrock**

### Other components

- **Engineer**

## Connections

- Engineer → Prompting notebook: uses (evidence: `README.md`)
- Prompting notebook → Healthpost schema: uses schema (evidence: `README.md`)
- Prompting notebook → User profile schema: uses schema (evidence: `README.md`)
- Prompting notebook → Synthetic data: generates (evidence: `README.md`)
- Prompting notebook → Query DSL prompt: prompts for (evidence: `README.md`)
- Prompting notebook → Amazon Bedrock: uses Converse API (evidence: `README.md`)
