> ## Documentation Index
> Fetch the complete documentation index at: https://iso-topology.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture diagrams as code: 3 editable Mermaid and isometric examples

> Rebuild a Mermaid architecture graph as an editable isometric diagram. Compare service, RAG and DuckDB examples with matched colors, YAML templates and SVG exports.

**Architecture diagrams as code can be readable enough for a design review and still remain editable text in Git.** This guide compares three small systems in Mermaid and iso-topology, with matching graphs and colors, downloadable sources, and projects you can reopen for the next edit.

You have a Mermaid diagram that explains the system. Now you need a version for a README, a design review or a presentation, with more deliberate composition and visual hierarchy.

**To make an isometric version, preserve the components and directed connections, re-author their placement in iso-topology YAML, then render an SVG.** iso-topology does not import Mermaid syntax directly. The examples below include both source formats, so you can inspect exactly what changed and start from an editable scene.

![The same six-component service in Mermaid and iso-topology: Client, API, Redis, Postgres, Queue and Worker, with matching colors and six directed connections.](https://mintcdn.com/iso-topology/2zl7lSYCmtNx7l7w/assets/articles/mermaid-isometric/01-service-comparison.png?fit=max\&auto=format\&n=2zl7lSYCmtNx7l7w\&q=85\&s=5820cd80d3bd2562318ebd6fc2da5143)

[Open the full-size comparison](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service-comparison.svg) · [Download the service YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.yaml)

Written from the iso-topology project perspective. Examples prepared December 5, 2026, using Mermaid 12.4.1 and iso-topology revision `3666b20`. These are illustrative architectures, not vendor deployment diagrams.

## What changed between the two pictures?

The graph stays the same. The presentation changes.

| Held constant | Changed deliberately |
| - | - |
| Component IDs and complete labels | Flat shapes versus isometric geometry |
| Directed connections | Node placement and connector paths |
| Node face colors and text colors | Depth, side shading and visual emphasis |
| Edge color and authored stroke width | Ports and routing channels |
| Font family and icon artwork | Spatial grouping within the composition |
| Group membership, where present | Group platform treatment |

Both diagrams use the same SVG-units-to-pixels scale within each comparison. Mermaid has a custom theme and automatic layout. The iso-topology scenes have authored placement and ports. This is a comparison of two authored presentations, **not an automatic-layout benchmark or evidence that one prompt produced the finished scene**. Both sides have editable source.

Mermaid also offers [layout configuration](https://mermaid.ai/open-source/config/layouts.html). If layout alone is the problem, try its available options before changing your diagram workflow.

## Example 1: show the background work around an API

A three-box Client → API → Database picture leaves out the part that often matters in a design review: what happens after a request queues some work?

This service has six components and six directed connections:

```mermaid theme={"system"}
flowchart LR
  client[Client] --> api[API]
  api --> db[(Postgres)]
  api --> cache[(Redis)]
  api --> queue[Queue]
  queue --> worker[Worker]
  worker --> db
```

This small code block describes the graph. The downloadable Mermaid source includes the colors and icons used in the comparison; its icon pack and renderer configuration are in the [reproduction package](https://github.com/NexusFox88/iso-topology/tree/main/tools/gen-doc-images/editorial/mermaid-isometric).

![Isometric service diagram with a raised mint API, a Redis branch, and an API to Queue to Worker to Postgres write path.](https://mintcdn.com/iso-topology/2zl7lSYCmtNx7l7w/assets/articles/mermaid-isometric/01-service-hero.png?fit=max\&auto=format\&n=2zl7lSYCmtNx7l7w\&q=85\&s=7ca7fade0da4fde8abd384a293097422)

The API is the focal point. Redis sits off the main flow. Queue and Worker form a short background path, and Worker reconnects to Postgres without a long return line around the whole scene. Arrows show dependency or data-flow direction; they do not show HTTP responses, retries or transaction guarantees.

**The useful design decision:** place nodes around the routes you need readers to follow. Raising a box adds emphasis; shortening the write path makes the architecture easier to explain.

[Editable YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.yaml) · [Mermaid source](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.mmd) · [Native SVG](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.svg)

## Example 2: separate RAG ingestion from query-time retrieval

A RAG diagram needs to distinguish work that happens when documents arrive from work that happens when someone asks a question.

![RAG architecture in Mermaid and iso-topology, preserving seven components and six edges across document ingestion and live retrieval.](https://mintcdn.com/iso-topology/2zl7lSYCmtNx7l7w/assets/articles/mermaid-isometric/02-rag-comparison.png?fit=max\&auto=format\&n=2zl7lSYCmtNx7l7w\&q=85\&s=7d359138fe2c0cac0b2c5fc38ba1c789)

The upper lane runs Documents → Chunker → Embeddings → Vector DB. The lower lane runs App → Retriever → LLM, with Retriever → Vector DB representing the retrieval dependency. The simplified graph omits response arrows and the query-embedding implementation; it is a logical overview rather than an execution trace.

![Isometric RAG diagram with parallel ingestion and retrieval lanes and separate connector channels to Vector DB.](https://mintcdn.com/iso-topology/2zl7lSYCmtNx7l7w/assets/articles/mermaid-isometric/02-rag-hero.png?fit=max\&auto=format\&n=2zl7lSYCmtNx7l7w\&q=85\&s=7d7a6e65aaeb312ea8a673d5efda01dd)

The two lanes share the same direction. A separate channel connects the retriever to the vector store. This keeps the storage dependency visible without making the ingestion path look like a step in every user request.

**The useful design decision:** give different lifecycles different lanes. A reader should be able to follow ingestion without accidentally entering the request path.

[Editable YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/02-rag.yaml) · [Mermaid source](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/02-rag.mmd) · [Native SVG](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/02-rag.svg) · [Full-size comparison](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/02-rag-comparison.svg)

For a different RAG template and a longer explanation, see the [RAG pipeline example](https://iso-topology.mintlify.site/examples/rag-pipeline.md).

## Example 3: explain a DuckDB file-analysis workflow

This DuckDB example has a different shape: files feed an engine, and the engine supports several outputs. For an overview, fan-in and fan-out are the important relationships.

![DuckDB file-analysis workflow in Mermaid and iso-topology, with CSV and Parquet inputs and Notebook, Dashboard and Parquet export outputs.](https://mintcdn.com/iso-topology/2zl7lSYCmtNx7l7w/assets/articles/mermaid-isometric/03-duckdb-comparison.png?fit=max\&auto=format\&n=2zl7lSYCmtNx7l7w\&q=85\&s=af91a198d8c6f7ce68210a81f43c5b4f)

CSV files and Parquet feed DuckDB. Notebook, Dashboard and Parquet export are the three downstream uses. The arrows summarize data movement and usage; they do not claim that DuckDB hosts a notebook or dashboard server.

![Isometric DuckDB workflow with an amber engine between grouped file sources and grouped exploration tools, plus a separate export route.](https://mintcdn.com/iso-topology/2zl7lSYCmtNx7l7w/assets/articles/mermaid-isometric/03-duckdb-hero.png?fit=max\&auto=format\&n=2zl7lSYCmtNx7l7w\&q=85\&s=81d83398b59c72b754fed69e178adc80)

Thin platforms mark the same two groups represented in the Mermaid source: file sources and exploration tools. The amber engine is taller than the surrounding tiles. The export route remains separate so that producing a file does not read as another interactive analysis tool.

**The useful design decision:** use depth and grouping to explain the role of a component. Give the engine more emphasis without enlarging every object.

[Editable YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/03-duckdb.yaml) · [Mermaid source](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/03-duckdb.mmd) · [Native SVG](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/03-duckdb.svg) · [Full-size comparison](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/03-duckdb-comparison.svg)

## Choose a template and keep its editable project

| Your task | Preview | Reopen in Studio | Review the source |
| - | - | - | - |
| Explain an API and its background jobs | [Service SVG](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.svg) | [Service project](https://iso-topology.mintlify.site/assets/editable-comparisons/01-service.isotopo.json) | [YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.yaml) |
| Separate RAG ingestion and retrieval | [RAG SVG](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/02-rag.svg) | [RAG project](https://iso-topology.mintlify.site/assets/editable-comparisons/02-rag.isotopo.json) | [YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/02-rag.yaml) |
| Explain a DuckDB file-analysis workflow | [DuckDB SVG](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/03-duckdb.svg) | [DuckDB project](https://iso-topology.mintlify.site/assets/editable-comparisons/03-duckdb.isotopo.json) | [YAML](https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/03-duckdb.yaml) |

A project contains the source and matching layout state. The SVG is the published picture. These project downloads reproduce the reviewed native SVGs; they are not screenshots embedded in an editor.

## Render and edit one of these templates

First time using iso-topology? Follow the [architecture diagram quickstart](https://iso-topology.mintlify.site/quickstart.md) for the CLI setup, output files and Studio editing loop. Then use one of the matching templates below.

With [Go 1.25 or later installed](https://iso-topology.mintlify.site/getting-started/01-install.md), install the CLI and download the service source:

```bash theme={"system"}
go install github.com/NexusFox88/iso-topology/cmd/isotopo@main
curl -fL https://iso-topology.mintlify.site/assets/articles/mermaid-isometric/01-service.yaml -o architecture.yaml
isotopo render --report architecture.yaml ./out
isotopo serve architecture.yaml
```

The render writes `out/topology.svg`. Studio opens at `http://localhost:8731` by default. Use the downloaded YAML for visual editing; retain it alongside the exported SVG. For exact historical reproduction, build the revision recorded above rather than the evolving `main` branch.

Start with one edit: change the API label to your service name. Render again, inspect the label and all six connections, then export the accepted revision. For the other templates, replace `01-service.yaml` with `02-rag.yaml` or `03-duckdb.yaml` in the download URL.

For installation and a first edit, follow the [local quickstart](https://iso-topology.mintlify.site/quickstart.md). Then use the sources and commands above for these complete compositions. The [README export walkthrough](https://iso-topology.mintlify.site/getting-started/05-publishing.md) explains keeping the image and editable source together.

## Try a second edit, then reopen it

Download the service project and open it locally:

```bash theme={"system"}
curl -fL https://iso-topology.mintlify.site/assets/editable-comparisons/01-service.isotopo.json -o service.isotopo.json
isotopo serve service.isotopo.json
```

Rename **API** to **App** in Studio and save the project. Keep the component ID `api`; the name a reader sees is different from the ID that keeps connections attached. Regenerate the exported picture from that saved project:

```bash theme={"system"}
isotopo design service.isotopo.json ./revised
isotopo serve revised/project.isotopo.json
```

Stop the first local server before starting the second one on the same port. Check that App appears, all six connections remain, and the saved placement is present. Longer labels can change the space a node needs, so inspect your own revision at its intended display size.

An agent can perform the same bounded revision. Give it the latest saved project, not an earlier source snippet:

```text theme={"system"}
Read service.isotopo.json from disk. Change the api component's label
from API to App. Keep every ID, connection, icon, color and authored
position. Keep the current layout_state as the input to the next design.
Save a new project, render it, and reopen the returned project.
Check that the SVG contains the new label and that the six connections
and existing positions remain. Return the files and remaining issues.
```

The [maintained project check](https://github.com/NexusFox88/iso-topology/blob/main/tools/check_editable_comparison_projects.py) exercises this rename through the actual CLI: it checks unchanged positions, retained edited source, a changed SVG, and an exact replay after reopening. This is a deterministic file-workflow check, not an LLM success-rate measurement or a recorded human editing session. The source already contains explicit placement; for manually dragged automatic layouts, follow [the layout-preservation workflow](https://iso-topology.mintlify.site/guides/preserve-diagram-layout.md).

For a diagram inferred from your own application, start with [code evidence and a bounded agent task](https://iso-topology.mintlify.site/guides/architecture-diagrams-from-code.md). For a proposed redesign, keep [current and target architecture](https://iso-topology.mintlify.site/guides/current-and-target-architecture.md) distinct. A diagram renderer cannot establish that the architecture matches running software.

## How to keep isometric connectors readable

Start with the paths, then add the depth:

1. List every directed connection before arranging nodes. Preserve that list when changing the view.
2. Put a sequence on one isometric axis where possible. Coaxial nodes can connect directly.
3. Use bends along the isometric axes for cross-lane routes. Reserve a channel between lanes instead of sending an arrow across a node face.
4. Choose ports deliberately when several edges meet one component. Check that arrowheads remain attached and distinguishable.
5. Inspect the exported image at the width readers will actually see. Open a full-size SVG when a paired comparison becomes too small on a phone.

These examples use real renderer output. The comparison frames add headings and panel placement; exported node or connector geometry was not retouched. See [connection authoring](https://iso-topology.mintlify.site/guides/connections.md), [layout controls](https://iso-topology.mintlify.site/guides/layout.md), and [preserving an existing layout during edits](https://iso-topology.mintlify.site/guides/preserve-diagram-layout.md).

The recorded checks find zero crossings, occlusions, tunnels and overlaps in these three scenes. Each report still contains an `iso-route-clearance-unresolved` warning for non-convex opaque body coverage. Those metrics have limited coverage and do not replace visual review. Sources, reports, graph checks and reproduction instructions are in the [comparison evidence directory](https://github.com/NexusFox88/iso-topology/tree/main/tools/gen-doc-images/editorial/mermaid-isometric).

## When should you keep Mermaid?

Keep Mermaid when native rendering in your documentation host is central to the workflow, the diagram is easy to follow, or a text change should be enough to update an automatically arranged graph. Check the Mermaid version and supported diagram types in the actual host.

Consider an authored isometric scene when spatial grouping, visual emphasis and a reusable illustration are worth maintaining explicit layout. Isometric projection takes more space and can obscure relationships in dense graphs. A top-down view may communicate a complicated dependency map better. See [choosing an architecture view](https://iso-topology.mintlify.site/guides/choose-architecture-view.md) and the broader [open-source diagram tool guide](https://iso-topology.mintlify.site/guides/open-source-architecture-diagram-tools.md).

## Common questions

### Can iso-topology convert a Mermaid file directly?

No. There is no native Mermaid importer in this workflow. Recreate the components and edges in YAML, JSON or supported D2 input. These examples provide matching Mermaid and iso-topology sources to make that re-authoring inspectable. See [choosing an input format](https://iso-topology.mintlify.site/guides/choose-format.md).

### Do I need an AI agent to create the diagram?

No. The CLI renders locally, and the templates can be edited directly. An agent can help author or revise the source through [the MCP workflow](https://iso-topology.mintlify.site/guides/ai-architecture-diagram-workflow.md), but the finished examples here are not evidence of unattended one-prompt generation.

### Can I edit the exported SVG in Studio?

Use the YAML as the working document. The SVG is the rendered output; it is not the complete editable Studio source. Commit the source and export together so the next revision remains reproducible.

### Are these vendor reference architectures?

No. They are small illustrative graphs for explaining layout and presentation. Adapt their components and relationships to the system you actually run.

Article prepared with AI assistance. The comparison images are generated from the linked diagram sources, not generated bitmap artwork.

Try a structural revision next: [add a queue to an existing architecture diagram](https://iso-topology.mintlify.site/articles/edit-architecture-diagrams-with-ai.md), with before/after projects, the exact source diff and a checked reopen workflow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.