# vbookshelf/jai-world-vrm-3d-embodied-ai architecture

> Architecture diagram of the GitHub repository vbookshelf/jai-world-vrm-3d-embodied-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vbookshelf/jai-world-vrm-3d-embodied-ai
- Repository: https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai

## Overview

Jai World is a Flask-backed, browser-based 3D embodied-AI experience. The user controls Y-bot and chats with AI-controlled X-bot; each chat turn uses the browser’s world-state snapshot, a selected model can issue tool calls, and resulting actions are sent back for the world to enact. The graph also preserves the documented vision, exploration, block manipulation, and walking/dancing capabilities. Backend excerpts show tool dispatch and queued actions; the frontend implementation is unsampled, so its internal wiring is represented only where the README documents it.

Main entry points: [`Jai-World-v1.0/openrouter-app.py`](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py) (OpenRouter Backend), [`Jai-World-v1.0/ollama-app.py`](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/ollama-app.py) (Ollama Backend), [`Jai-World-v1.0/templates/index.html`](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/templates/index.html) (World Interface), [`Jai-World-v1.0/static/models`](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/tree/main/Jai-World-v1.0/static/models) (VRM Avatars)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_world["3D World"]
  node_webworld["World Interface<br/>[index.html]"]
  node_avatars["VRM Avatars<br/>[models]"]
  node_dance["Rumba Animation<br/>[rumba-dancing.fbx]"]
  node_chat["Chat and Console<br/>[index.html]"]
end

subgraph group_agent["AI Agent"]
  node_movement["Avatar Movement<br/>[openrouter-app.py]"]
  node_blocks["Block Actions<br/>[openrouter-app.py]"]
  node_exploration["Location Tools<br/>[openrouter-app.py]"]
  node_vision["World Vision<br/>[openrouter-app.py]"]
end

subgraph group_backends["Model Backends"]
  node_openrouter["OpenRouter Backend<br/>[openrouter-app.py]"]
  node_ollama["Ollama Backend<br/>[ollama-app.py]"]
end

node_user(("User"))
node_openrouter_service{{"OpenRouter Model"}}
node_ollama_service{{"Ollama Service"}}

node_user -->|"controls"| node_webworld
node_user -->|"chats with"| node_chat
node_webworld -->|"loads models"| node_avatars
node_webworld -->|"plays dance"| node_dance
node_chat -->|"sends chat state"| node_openrouter
node_chat -->|"sends chat state"| node_ollama
node_openrouter -->|"requests completion"| node_openrouter_service
node_ollama -->|"requests completion"| node_ollama_service
node_openrouter -->|"dispatches tools"| node_movement
node_openrouter -->|"dispatches tools"| node_blocks
node_openrouter -->|"dispatches tools"| node_exploration
node_openrouter -->|"dispatches tools"| node_vision
node_ollama -->|"dispatches tools"| node_movement
node_ollama -->|"dispatches tools"| node_blocks
node_ollama -->|"dispatches tools"| node_exploration
node_ollama -->|"dispatches tools"| node_vision
node_movement -->|"queues actions"| node_webworld
node_blocks -->|"queues actions"| node_webworld
node_exploration -->|"reports location info"| node_webworld
node_vision -->|"returns images"| node_chat

click node_webworld "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/templates/index.html"
click node_avatars "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/tree/main/Jai-World-v1.0/static/models"
click node_dance "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/static/animations/rumba-dancing.fbx"
click node_chat "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/templates/index.html"
click node_movement "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py"
click node_blocks "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py"
click node_exploration "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py"
click node_vision "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py"
click node_openrouter "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py"
click node_ollama "https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/ollama-app.py"

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_webworld,node_avatars,node_dance,node_chat,node_user toneBlue
class node_movement,node_blocks,node_exploration,node_vision toneAmber
class node_openrouter,node_ollama,node_openrouter_service toneMint
class node_ollama_service toneIndigo
```

## Components

### 3D World

- [World Interface](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/templates/index.html): `Jai-World-v1.0/templates/index.html`
- [VRM Avatars](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/tree/main/Jai-World-v1.0/static/models): `Jai-World-v1.0/static/models`
- [Rumba Animation](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/static/animations/rumba-dancing.fbx): `Jai-World-v1.0/static/animations/rumba-dancing.fbx`
- [Chat and Console](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/templates/index.html): `Jai-World-v1.0/templates/index.html`

### AI Agent

- [Avatar Movement](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py): `Jai-World-v1.0/openrouter-app.py`
- [Block Actions](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py): `Jai-World-v1.0/openrouter-app.py`
- [Location Tools](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py): `Jai-World-v1.0/openrouter-app.py`
- [World Vision](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py): `Jai-World-v1.0/openrouter-app.py`

### Model Backends

- [OpenRouter Backend](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/openrouter-app.py): `Jai-World-v1.0/openrouter-app.py`
- [Ollama Backend](https://github.com/vbookshelf/jai-world-vrm-3d-embodied-ai/blob/main/Jai-World-v1.0/ollama-app.py): `Jai-World-v1.0/ollama-app.py`

### Other components

- **User**
- **OpenRouter Model**
- **Ollama Service**

## Connections

- User → World Interface: controls (evidence: `README.md`)
- User → Chat and Console: chats with (evidence: `README.md`)
- World Interface → VRM Avatars: loads models (evidence: `README.md`)
- World Interface → Rumba Animation: plays dance (evidence: `README.md`)
- Chat and Console → OpenRouter Backend: sends chat state (evidence: `README.md`)
- Chat and Console → Ollama Backend: sends chat state (evidence: `README.md`)
- OpenRouter Backend → OpenRouter Model: requests completion (evidence: `Jai-World-v1.0/openrouter-app.py`)
- Ollama Backend → Ollama Service: requests completion (evidence: `Jai-World-v1.0/ollama-app.py`)
- OpenRouter Backend → Avatar Movement: dispatches tools (evidence: `Jai-World-v1.0/openrouter-app.py`)
- OpenRouter Backend → Block Actions: dispatches tools (evidence: `Jai-World-v1.0/openrouter-app.py`)
- OpenRouter Backend → Location Tools: dispatches tools (evidence: `Jai-World-v1.0/openrouter-app.py`)
- OpenRouter Backend → World Vision: dispatches tools (evidence: `Jai-World-v1.0/openrouter-app.py`)
- Ollama Backend → Avatar Movement: dispatches tools (evidence: `Jai-World-v1.0/ollama-app.py`)
- Ollama Backend → Block Actions: dispatches tools (evidence: `Jai-World-v1.0/ollama-app.py`)
- Ollama Backend → Location Tools: dispatches tools (evidence: `Jai-World-v1.0/ollama-app.py`)
- Ollama Backend → World Vision: dispatches tools (evidence: `Jai-World-v1.0/ollama-app.py`)
- Avatar Movement → World Interface: queues actions (evidence: `Jai-World-v1.0/openrouter-app.py`)
- Block Actions → World Interface: queues actions (evidence: `Jai-World-v1.0/openrouter-app.py`)
- Location Tools → World Interface: reports location info (evidence: `README.md`)
- World Vision → Chat and Console: returns images (evidence: `README.md`)
