# pgarvie/mirofish-offline architecture

> Architecture diagram of the GitHub repository pgarvie/mirofish-offline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pgarvie/mirofish-offline
- Repository: https://github.com/pgarvie/mirofish-offline

## Overview

MiroFish-Offline is a local multi-agent simulation product: users submit a document, build a knowledge graph, configure agent personas and platforms, run simulations, inspect a report, and chat with simulated agents. The graph preserves those documented stages and the Neo4j/Ollama storage layer. README statements support the high-level workflow; source excerpts and the SOURCE INDEX provide implementation evidence for storage and simulation internals. Some route-to-service details are unsampled, so those connections are omitted or marked unverified.

Main entry points: [`frontend/src/views/Process.vue`](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/views/Process.vue) (Workflow steps), [`backend/app/storage/neo4j_storage.py`](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/neo4j_storage.py) (Neo4j storage), [`backend/app/api/simulation.py`](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/simulation.py) (Simulation API), [`backend/app/api/graph.py`](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/graph.py) (Graph API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Interface"]
  node_web["Vue application<br/>[App.vue]"]
  node_process["Workflow steps<br/>[Process.vue]"]
  node_history["Project history"]
  node_graphui["Graph explorer<br/>[GraphPanel.vue]"]
  node_reportui["Report view<br/>[Step4Report.vue]"]
  node_interactionui["Agent chat"]
end

subgraph group_workflow["Simulation Workflow"]
  node_graphapi["Graph API<br/>[graph.py]"]
  node_simulationapi["Simulation API<br/>[simulation.py]"]
  node_reportapi["Report API<br/>[report.py]"]
end

subgraph group_graph["Knowledge Graph"]
  node_entityreader["Entity reader<br/>[entity_reader.py]"]
  node_graphbuilder["Graph builder<br/>[graph_builder.py]"]
  node_ontology["Ontology generator"]
  node_graphstorage["Storage interface<br/>[graph_storage.py]"]
  node_neo4jstorage["Neo4j storage<br/>[neo4j_storage.py]"]
  node_ner["NER extraction<br/>[ner_extractor.py]"]
  node_embedding["Embedding service"]
  node_search["Hybrid search<br/>[search_service.py]"]
end

subgraph group_runtime["Simulation Runtime"]
  node_profiles["Persona generator"]
  node_simconfig["Simulation config"]
  node_simmanager["Simulation manager"]
  node_runner["Simulation runner"]
  node_memory["Memory updater"]
end

subgraph group_analysis["Analysis and Interaction"]
  node_reportagent["Report agent<br/>[report_agent.py]"]
  node_graphtools["Graph tools<br/>[graph_tools.py]"]
end

node_user(("User"))
node_neo4j[("Neo4j database")]
node_ollama["Ollama services"]
node_oasis["OASIS engine"]

node_user -->|"uses"| node_web
node_web -.->|"shows workflow"| node_process
node_process -->|"builds graph"| node_graphapi
node_process -->|"runs simulation"| node_simulationapi
node_history -->|"loads history"| node_simulationapi
node_process -->|"requests report"| node_reportapi
node_graphapi -.->|"builds graph"| node_graphbuilder
node_graphapi -.->|"persists graph"| node_neo4jstorage
node_simulationapi -->|"reads entities"| node_entityreader
node_simulationapi -->|"manages simulation"| node_simmanager
node_simulationapi -->|"starts and monitors"| node_runner
node_graphbuilder -.->|"uses ontology"| node_ontology
node_graphbuilder -.->|"stores graph data"| node_neo4jstorage
node_neo4jstorage -->|"implements"| node_graphstorage
node_neo4jstorage -->|"extracts entities"| node_ner
node_neo4jstorage -->|"embeds content"| node_embedding
node_neo4jstorage -->|"searches graph"| node_search
node_neo4jstorage -->|"reads and writes"| node_neo4j
node_embedding -->|"requests embeddings"| node_ollama
node_ner -->|"requests extraction"| node_ollama
node_process -->|"generates personas"| node_profiles
node_process -->|"configures platforms"| node_simconfig
node_simmanager -->|"prepares profiles"| node_profiles
node_simmanager -->|"generates config"| node_simconfig
node_runner -->|"runs agents"| node_oasis
node_runner -->|"updates memories"| node_memory
node_reportapi -->|"generates analysis"| node_reportagent
node_reportagent -->|"queries graph"| node_graphtools
node_reportagent -.->|"requests analysis"| node_ollama
node_reportui -->|"displays report"| node_reportapi
node_process -->|"explores graph"| node_graphui
node_interactionui -->|"chats with agents"| node_simulationapi

click node_web "https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/App.vue"
click node_process "https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/views/Process.vue"
click node_history "https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/HistoryDatabase.vue"
click node_graphui "https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/GraphPanel.vue"
click node_reportui "https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/Step4Report.vue"
click node_interactionui "https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/Step5Interaction.vue"
click node_graphapi "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/graph.py"
click node_simulationapi "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/simulation.py"
click node_reportapi "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/report.py"
click node_entityreader "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/entity_reader.py"
click node_graphbuilder "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/graph_builder.py"
click node_ontology "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/ontology_generator.py"
click node_graphstorage "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/graph_storage.py"
click node_neo4jstorage "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/neo4j_storage.py"
click node_ner "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/ner_extractor.py"
click node_embedding "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/embedding_service.py"
click node_search "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/search_service.py"
click node_profiles "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/oasis_profile_generator.py"
click node_simconfig "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/simulation_config_generator.py"
click node_simmanager "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/simulation_manager.py"
click node_runner "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/simulation_runner.py"
click node_memory "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/graph_memory_updater.py"
click node_reportagent "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/report_agent.py"
click node_graphtools "https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/graph_tools.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_web,node_process,node_history,node_graphui,node_reportui,node_interactionui,node_user toneBlue
class node_graphapi,node_simulationapi,node_reportapi,node_neo4j toneAmber
class node_entityreader,node_graphbuilder,node_ontology,node_graphstorage,node_neo4jstorage,node_ner,node_embedding,node_search toneMint
class node_profiles,node_simconfig,node_simmanager,node_runner,node_memory toneRose
class node_reportagent,node_graphtools,node_ollama,node_oasis toneIndigo
```

## Components

### User Interface

- [Vue application](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Workflow steps](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/views/Process.vue): `frontend/src/views/Process.vue`
- [Project history](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/HistoryDatabase.vue): `frontend/src/components/HistoryDatabase.vue`
- [Graph explorer](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/GraphPanel.vue): `frontend/src/components/GraphPanel.vue`
- [Report view](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/Step4Report.vue): `frontend/src/components/Step4Report.vue`
- [Agent chat](https://github.com/pgarvie/mirofish-offline/blob/main/frontend/src/components/Step5Interaction.vue): `frontend/src/components/Step5Interaction.vue`

### Simulation Workflow

- [Graph API](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/graph.py): `backend/app/api/graph.py`
- [Simulation API](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/simulation.py): `backend/app/api/simulation.py`
- [Report API](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/api/report.py): `backend/app/api/report.py`

### Knowledge Graph

- [Entity reader](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/entity_reader.py): `backend/app/services/entity_reader.py`
- [Graph builder](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/graph_builder.py): `backend/app/services/graph_builder.py`
- [Ontology generator](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/ontology_generator.py): `backend/app/services/ontology_generator.py`
- [Storage interface](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/graph_storage.py): `backend/app/storage/graph_storage.py`
- [Neo4j storage](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/neo4j_storage.py): `backend/app/storage/neo4j_storage.py`
- [NER extraction](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/ner_extractor.py): `backend/app/storage/ner_extractor.py`
- [Embedding service](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/embedding_service.py): `backend/app/storage/embedding_service.py`
- [Hybrid search](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/storage/search_service.py): `backend/app/storage/search_service.py`

### Simulation Runtime

- [Persona generator](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/oasis_profile_generator.py): `backend/app/services/oasis_profile_generator.py`
- [Simulation config](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/simulation_config_generator.py): `backend/app/services/simulation_config_generator.py`
- [Simulation manager](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/simulation_manager.py): `backend/app/services/simulation_manager.py`
- [Simulation runner](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/simulation_runner.py): `backend/app/services/simulation_runner.py`
- [Memory updater](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/graph_memory_updater.py): `backend/app/services/graph_memory_updater.py`

### Analysis and Interaction

- [Report agent](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/report_agent.py): `backend/app/services/report_agent.py`
- [Graph tools](https://github.com/pgarvie/mirofish-offline/blob/main/backend/app/services/graph_tools.py): `backend/app/services/graph_tools.py`

### Other components

- **User**
- **Neo4j database**
- **Ollama services**
- **OASIS engine**

## Connections

- User → Vue application: uses
- Vue application → Workflow steps: shows workflow
- Workflow steps → Graph API: builds graph
- Workflow steps → Simulation API: runs simulation
- Project history → Simulation API: loads history (evidence: `frontend/src/components/HistoryDatabase.vue`)
- Workflow steps → Report API: requests report
- Graph API → Graph builder: builds graph
- Graph API → Neo4j storage: persists graph
- Simulation API → Entity reader: reads entities (evidence: `backend/app/api/simulation.py`)
- Simulation API → Simulation manager: manages simulation (evidence: `backend/app/api/simulation.py`)
- Simulation API → Simulation runner: starts and monitors (evidence: `backend/app/api/simulation.py`)
- Graph builder → Ontology generator: uses ontology
- Graph builder → Neo4j storage: stores graph data
- Neo4j storage → Storage interface: implements (evidence: `backend/app/storage/neo4j_storage.py`)
- Neo4j storage → NER extraction: extracts entities (evidence: `backend/app/storage/neo4j_storage.py`)
- Neo4j storage → Embedding service: embeds content (evidence: `backend/app/storage/neo4j_storage.py`)
- Neo4j storage → Hybrid search: searches graph (evidence: `backend/app/storage/neo4j_storage.py`)
- Neo4j storage → Neo4j database: reads and writes
- Embedding service → Ollama services: requests embeddings (evidence: `backend/app/storage/embedding_service.py`)
- NER extraction → Ollama services: requests extraction
- Workflow steps → Persona generator: generates personas
- Workflow steps → Simulation config: configures platforms
- Simulation manager → Persona generator: prepares profiles (evidence: `backend/app/services/simulation_manager.py`)
- Simulation manager → Simulation config: generates config (evidence: `backend/app/services/simulation_manager.py`)
- Simulation runner → OASIS engine: runs agents
- Simulation runner → Memory updater: updates memories (evidence: `backend/app/services/simulation_runner.py`)
- Report API → Report agent: generates analysis
- Report agent → Graph tools: queries graph (evidence: `backend/app/services/report_agent.py`)
- Report agent → Ollama services: requests analysis
- Report view → Report API: displays report (evidence: `frontend/src/components/Step4Report.vue`)
- Workflow steps → Graph explorer: explores graph
- Agent chat → Simulation API: chats with agents
