Skip to main content

Generate SVG perspectives of a multi-service system from a registry of TOML config files + filesystem walks. No drift — diagrams are projections of the source of truth.

Project description

ai-architecture-renderer

Generate SVG perspectives of a multi-service system from a registry of TOML config files + filesystem walks. Diagrams that can't drift — they're projections of the source of truth.

CI License: MIT Python: 3.10+

Lifted from raj-sadan, where it was built because PM said "I trust your judgment but have no visual way to verify what you're building." If you have that problem with your own multi-service system, this tool may help.

Status: v0.1.0. Three perspectives shipped (service-mesh, neural-organs, constitutional). Generic registry schema; raj-sadan-shaped systems supported out of the box.

What it does

Reads structured config (TOML) + walks the filesystem; renders three SVG perspectives plus a manifest.json with timestamps and counts:

Perspective What it shows
service-mesh Operational view — running services, their connections, ports
neural-organs For agent stacks: organs (mind, senses, memory, knowledge, dashboard) + their internal subdirs and file counts
constitutional Governance view — articles, ministers, sherpas, chain of authority

Output is plain SVG. Embed in your dashboard, paste into a doc, host on the static directory of your service. Re-run when the source of truth changes.

Install

# 1. Install Graphviz (the binary, not the Python wrapper)
sudo apt-get install graphviz       # Linux
brew install graphviz                # macOS
winget install graphviz              # Windows

# 2. Install the package
pip install ai-architecture-renderer

Use

Against your own repo

ai-architecture-renderer --root /path/to/repo --output diagrams/

The default --root is the current working directory; --output defaults to <root>/architecture.

Single perspective

ai-architecture-renderer --root . --perspective service-mesh
ai-architecture-renderer --root . --perspective neural-organs
ai-architecture-renderer --root . --perspective constitutional

Sample registries

The examples/ directory has three sample shapes:

  • raj-sadan/ — full nervous-system stack (5 organs + ministers + sherpas + protocols). The reference implementation.
  • simple-three-tier/registry.toml — classic web → api → db. Smallest possible example.
  • microservices/registry.toml — six services + gateway + queue + db.

Try them with:

git clone https://github.com/vraj0703/ai-architecture-renderer
cd ai-architecture-renderer
ai-architecture-renderer --root examples/simple-three-tier

What it expects to find

The renderer reads from a few raj-sadan-style paths by default:

  • mind/cortex/config.toml — service registry
  • senses/interoception/state/registry.toml — operational state
  • CONSTITUTION.toml — articles + ministers + sherpas
  • protocols/PROTOCOL-*.toml — protocol files
  • .claude/skills/ministry-*/ — minister directories
  • mind/sherpa/*/ — sherpa directories

If your repo has these (or you symlink to them), it works out of the box. If not, the missing perspective panels fall back to "(no data)" labels — partial diagrams still render.

What's not yet here: a fully generic registry schema where every source path is configurable per-perspective via a single registry.toml. Today it's "raj-sadan-shaped + missing-data-tolerant." A v0.2 plan to fully decouple the source paths is tracked.

Why this exists

Most architecture diagrams drift the moment they're drawn. Lucidchart files diverge from reality the day after the last refactor. Mermaid blocks in READMEs go stale. The fix isn't a better drawing tool — it's making the diagram a projection of the source of truth, regenerable any time, never authoritative on its own.

That's all this is. A small Python script that reads what's actually there + renders SVG. Re-run it when you change something and the diagram updates. Don't, and the diagram stays correct because nothing in the system has moved.

Configuration

Var Default Purpose
ARCH_RENDERER_ROOT cwd Repository root to introspect
ARCH_RENDERER_OUTPUT <root>/architecture Output directory

Both can also be passed as --root / --output CLI flags, which take precedence.

License

MIT.

See also

  • The original raj-sadan tools/architecture/render.py (this tool's source)
  • ai-mind, ai-senses, ai-memory, ai-knowledge — the organs the neural-organs perspective is built around
  • ai-constitution — the governance framework the constitutional perspective expects

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_architecture_renderer-0.1.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_architecture_renderer-0.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file ai_architecture_renderer-0.1.1.tar.gz.

File metadata

  • Download URL: ai_architecture_renderer-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_architecture_renderer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e8660ca16a125ceb92bbe2311913081170dfca40e1e3ee7637a600f9b64e7050
MD5 1ff3886e65f0858abfbc802f4602bb8a
BLAKE2b-256 d3337d97033c0c16649bbdef8924e4bd635f58117efbb1496eae48d0cd2be480

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_architecture_renderer-0.1.1.tar.gz:

Publisher: release.yml on vraj0703/ai-architecture-renderer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_architecture_renderer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_architecture_renderer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b860317074a2b0cd83682f28e0a28f1fef075018ae1fb8fa187daa5178cb41e
MD5 7467e7e32fc04b19355adf6acf975a37
BLAKE2b-256 b1c02798db754e737b43a03a07a16e0e13cf0c07cb1576497c45c1a3ce4ab430

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_architecture_renderer-0.1.1-py3-none-any.whl:

Publisher: release.yml on vraj0703/ai-architecture-renderer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page