# nahom32/nars-trader architecture

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

- Interactive diagram: https://gitdiagram.com/nahom32/nars-trader
- Repository: https://github.com/nahom32/nars-trader

## Overview

NARS-Trader appears to be a MeTTa-based reasoning and planning project with a modeled environment. The README provides only the project name, and the available source excerpt covers only a benchmark helper; therefore, the graph identifies runtime modules from the file tree but does not infer how they call one another. The benchmark helper is omitted as peripheral to the product workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reasoning["Reasoning and Planning"]
  node_main["Main Runtime<br/>[main.metta]"]
  node_reasoning_core["Reasoning<br/>[reasoning.metta]"]
  node_planner["NARS Planner<br/>[nars-planner.metta]"]
  node_rule_helpers["Rule Helpers<br/>[rule-helpers.metta]"]
  node_reasoning_utils["Reasoning Utilities<br/>[utils.metta]"]
end

subgraph group_sampling["Rule Sampling"]
  node_sampler["Sampler<br/>[sampler.metta]"]
  node_rule_sampler["Rule Sampler<br/>[ruleSampler.metta]"]
end

subgraph group_environment["World Environment"]
  node_environment_rules["Galactic Rules"]
  node_world["World Model<br/>[world.metta]"]
  node_environment_utils["Environment Utilities<br/>[utils.metta]"]
end

node_user(("User"))

click node_main "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/main.metta"
click node_reasoning_core "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/reasoning.metta"
click node_planner "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/nars-planner.metta"
click node_rule_helpers "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/rule-helpers.metta"
click node_reasoning_utils "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/utils.metta"
click node_sampler "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/sampler.metta"
click node_rule_sampler "https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/ruleSampler.metta"
click node_environment_rules "https://github.com/nahom32/nars-trader/blob/main/environment/galactic-rules.metta"
click node_world "https://github.com/nahom32/nars-trader/blob/main/environment/world.metta"
click node_environment_utils "https://github.com/nahom32/nars-trader/blob/main/environment/utils.metta"

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_main,node_reasoning_core,node_planner,node_rule_helpers,node_reasoning_utils,node_user toneBlue
class node_sampler,node_rule_sampler toneAmber
class node_environment_rules,node_world,node_environment_utils toneMint
```

## Components

### Reasoning and Planning

- [Main Runtime](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/main.metta): `nars-reasoning/main.metta`
- [Reasoning](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/reasoning.metta): `nars-reasoning/reasoning.metta`
- [NARS Planner](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/nars-planner.metta): `nars-reasoning/nars-planner.metta`
- [Rule Helpers](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/rule-helpers.metta): `nars-reasoning/rule-helpers.metta`
- [Reasoning Utilities](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/utils.metta): `nars-reasoning/utils.metta`

### Rule Sampling

- [Sampler](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/sampler.metta): `nars-reasoning/sampler.metta`
- [Rule Sampler](https://github.com/nahom32/nars-trader/blob/main/nars-reasoning/ruleSampler.metta): `nars-reasoning/ruleSampler.metta`

### World Environment

- [Galactic Rules](https://github.com/nahom32/nars-trader/blob/main/environment/galactic-rules.metta): `environment/galactic-rules.metta`
- [World Model](https://github.com/nahom32/nars-trader/blob/main/environment/world.metta): `environment/world.metta`
- [Environment Utilities](https://github.com/nahom32/nars-trader/blob/main/environment/utils.metta): `environment/utils.metta`

### Other components

- **User**
