# surya-tn99/mrorg architecture

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

- Interactive diagram: https://gitdiagram.com/surya-tn99/mrorg
- Repository: https://github.com/surya-tn99/mrorg

## Overview

MrOrg is a local CLI agent for filesystem tasks. A user enters a request through the CLI; the agent sends its conversation to an Ollama model, invokes a selected filesystem tool, adds the result to the conversation, and asks the model for a final response. The main domain stages are listing, folder creation, and moving files or folders. The conversation is held in memory, while terminal formatting is a small supporting layer. The documented configuration template is present, but the imported key_params.py is not in the tree.

Main entry points: [`Agent.py`](https://github.com/surya-tn99/mrorg/blob/master/Agent.py) (Agent loop), [`Tools.py`](https://github.com/surya-tn99/mrorg/blob/master/Tools.py) (Tool registry), [`colour.py`](https://github.com/surya-tn99/mrorg/blob/master/colour.py) (Terminal output), [`temp_key_params.py`](https://github.com/surya-tn99/mrorg/blob/master/temp_key_params.py) (Config template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent runtime"]
  node_cli["CLI loop<br/>[Agent.py]"]
  node_conversation["Conversation state<br/>[Agent.py]"]
  node_agent_loop["Agent loop<br/>[Agent.py]"]
  node_tool_registry["Tool registry<br/>[Tools.py]"]
  node_config_template["Config template<br/>[temp_key_params.py]"]
end

subgraph group_filesystem["Filesystem tools"]
  node_list_tool["List paths<br/>[Tools.py]"]
  node_create_tool["Create folder<br/>[Tools.py]"]
  node_move_tool["Move paths<br/>[Tools.py]"]
end

subgraph group_terminal["Terminal interface"]
  node_terminal_output["Terminal output<br/>[colour.py]"]
end

node_user(("User"))
node_ollama["Ollama model"]
node_local_fs[("Local filesystem")]

node_user -->|"enters request"| node_cli
node_cli -->|"adds message"| node_conversation
node_cli -->|"starts turn"| node_agent_loop
node_agent_loop -->|"reads messages"| node_conversation
node_agent_loop -->|"invokes model"| node_ollama
node_ollama -->|"returns response"| node_agent_loop
node_agent_loop -->|"dispatches call"| node_tool_registry
node_tool_registry -->|"registers"| node_list_tool
node_tool_registry -->|"registers"| node_create_tool
node_tool_registry -->|"registers"| node_move_tool
node_list_tool -->|"lists entries"| node_local_fs
node_create_tool -->|"creates folder"| node_local_fs
node_move_tool -->|"moves paths"| node_local_fs
node_agent_loop -->|"adds tool result"| node_conversation
node_cli -->|"formats prompts"| node_terminal_output
node_agent_loop -->|"prints response"| node_terminal_output
node_config_template -.->|"configures via copy"| node_agent_loop

click node_cli "https://github.com/surya-tn99/mrorg/blob/master/Agent.py"
click node_conversation "https://github.com/surya-tn99/mrorg/blob/master/Agent.py"
click node_agent_loop "https://github.com/surya-tn99/mrorg/blob/master/Agent.py"
click node_tool_registry "https://github.com/surya-tn99/mrorg/blob/master/Tools.py"
click node_list_tool "https://github.com/surya-tn99/mrorg/blob/master/Tools.py"
click node_create_tool "https://github.com/surya-tn99/mrorg/blob/master/Tools.py"
click node_move_tool "https://github.com/surya-tn99/mrorg/blob/master/Tools.py"
click node_terminal_output "https://github.com/surya-tn99/mrorg/blob/master/colour.py"
click node_config_template "https://github.com/surya-tn99/mrorg/blob/master/temp_key_params.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_cli,node_conversation,node_agent_loop,node_tool_registry,node_config_template,node_user toneBlue
class node_list_tool,node_create_tool,node_move_tool,node_local_fs toneAmber
class node_terminal_output toneMint
class node_ollama toneIndigo
```

## Components

### Agent runtime

- [CLI loop](https://github.com/surya-tn99/mrorg/blob/master/Agent.py): `Agent.py`
- [Conversation state](https://github.com/surya-tn99/mrorg/blob/master/Agent.py): `Agent.py`
- [Agent loop](https://github.com/surya-tn99/mrorg/blob/master/Agent.py): `Agent.py`
- [Tool registry](https://github.com/surya-tn99/mrorg/blob/master/Tools.py): `Tools.py`
- [Config template](https://github.com/surya-tn99/mrorg/blob/master/temp_key_params.py): `temp_key_params.py`

### Filesystem tools

- [List paths](https://github.com/surya-tn99/mrorg/blob/master/Tools.py): `Tools.py`
- [Create folder](https://github.com/surya-tn99/mrorg/blob/master/Tools.py): `Tools.py`
- [Move paths](https://github.com/surya-tn99/mrorg/blob/master/Tools.py): `Tools.py`

### Terminal interface

- [Terminal output](https://github.com/surya-tn99/mrorg/blob/master/colour.py): `colour.py`

### Other components

- **User**
- **Ollama model**
- **Local filesystem**

## Connections

- User → CLI loop: enters request (evidence: `readme.md`)
- CLI loop → Conversation state: adds message (evidence: `Agent.py`)
- CLI loop → Agent loop: starts turn (evidence: `Agent.py`)
- Agent loop → Conversation state: reads messages (evidence: `Agent.py`)
- Agent loop → Ollama model: invokes model (evidence: `Agent.py`)
- Ollama model → Agent loop: returns response (evidence: `readme.md`)
- Agent loop → Tool registry: dispatches call (evidence: `Agent.py`)
- Tool registry → List paths: registers (evidence: `Tools.py`)
- Tool registry → Create folder: registers (evidence: `Tools.py`)
- Tool registry → Move paths: registers (evidence: `Tools.py`)
- List paths → Local filesystem: lists entries (evidence: `Tools.py`)
- Create folder → Local filesystem: creates folder (evidence: `Tools.py`)
- Move paths → Local filesystem: moves paths (evidence: `Tools.py`)
- Agent loop → Conversation state: adds tool result (evidence: `Agent.py`)
- CLI loop → Terminal output: formats prompts (evidence: `Agent.py`)
- Agent loop → Terminal output: prints response (evidence: `Agent.py`)
- Config template → Agent loop: configures via copy (evidence: `readme.md`)
