# leofroeder-stack/aria-decision-engine architecture

> Architecture diagram of the GitHub repository leofroeder-stack/aria-decision-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leofroeder-stack/aria-decision-engine
- Repository: https://github.com/leofroeder-stack/aria-decision-engine

## Overview

aria-decision-engine accepts text, a plain-language output schema, and optional few-shot examples, then returns a structured classification with latency and token metadata. Users can invoke it through the command-line interface or import `decide()` as a JavaScript module; MCP-compatible agents can call the same function through the stdio MCP server. The decision function sends a constrained JSON-mode request to Groq and parses the response. README examples document triage, urgency, spam, content filtering, and DTC severity use cases; example implementations are not mapped here. Runtime relationships are based on the sampled entry-point sources.

Main entry points: [`index.js`](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js) (Decision function), [`mcp-server.js`](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/mcp-server.js) (MCP tool server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Invocation interfaces"]
  node_cli["CLI entry<br/>[index.js]"]
  node_module_api["Module API<br/>[index.js]"]
  node_mcp_server["MCP tool server<br/>[mcp-server.js]"]
end

subgraph group_decision["Decision runtime"]
  node_decide["Decision function<br/>[index.js]"]
  node_result["Decision result<br/>[index.js]"]
end

node_cli_user(("CLI user"))
node_js_caller(("JS caller"))
node_mcp_client(("MCP client"))
node_groq["Groq API"]

node_cli_user -->|"provides input"| node_cli
node_cli -->|"calls"| node_decide
node_js_caller -->|"calls"| node_module_api
node_module_api -->|"invokes"| node_decide
node_mcp_client -->|"calls tool"| node_mcp_server
node_mcp_server -->|"invokes"| node_decide
node_decide -->|"sends request"| node_groq
node_groq -->|"returns response"| node_decide
node_decide -->|"parses and measures"| node_result
node_result -->|"prints JSON"| node_cli
node_result -->|"returns"| node_module_api
node_result -->|"returns"| node_mcp_server
node_mcp_server -->|"sends result"| node_mcp_client

click node_cli "https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js"
click node_module_api "https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js"
click node_mcp_server "https://github.com/leofroeder-stack/aria-decision-engine/blob/main/mcp-server.js"
click node_decide "https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js"
click node_result "https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js"

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_module_api,node_mcp_server,node_cli_user,node_mcp_client toneBlue
class node_decide,node_result toneAmber
class node_js_caller toneIndigo
class node_groq toneMint
```

## Components

### Invocation interfaces

- [CLI entry](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js): `index.js`
- [Module API](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js): `index.js`
- [MCP tool server](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/mcp-server.js): `mcp-server.js`

### Decision runtime

- [Decision function](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js): `index.js`
- [Decision result](https://github.com/leofroeder-stack/aria-decision-engine/blob/main/index.js): `index.js`

### Other components

- **CLI user**
- **JS caller**
- **MCP client**
- **Groq API**

## Connections

- CLI user → CLI entry: provides input
- CLI entry → Decision function: calls
- JS caller → Module API: calls
- Module API → Decision function: invokes
- MCP client → MCP tool server: calls tool
- MCP tool server → Decision function: invokes
- Decision function → Groq API: sends request
- Groq API → Decision function: returns response
- Decision function → Decision result: parses and measures
- Decision result → CLI entry: prints JSON
- Decision result → Module API: returns
- Decision result → MCP tool server: returns
- MCP tool server → MCP client: sends result
