# 47thtechcorner/raycodes_needle3 architecture

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

- Interactive diagram: https://gitdiagram.com/47thtechcorner/raycodes_needle3
- Repository: https://github.com/47thtechcorner/raycodes_needle3

## Overview

Needle 3 is a small on-device automation example. Its main workflow accepts a command and document text, routes the command through the Needle SDK, extracts invoice fields, and writes a summary report. The tool handlers are illustrative stubs that return status data; the shown code prints generated tool calls but does not demonstrate dispatching them to physical devices. The repository has only one runtime source file, so the graph stays compact.

Main entry points: [`main.py`](https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py) (Automation runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_orchestrator["Automation runner<br/>[main.py]"]
node_needle["Needle SDK"]
node_lighting["Lighting tool<br/>[main.py]"]
node_climate["Climate tool<br/>[main.py]"]
node_invoice["Invoice schema<br/>[main.py]"]
node_report["Execution report"]

node_user -->|"runs with inputs"| node_orchestrator
node_orchestrator -->|"routes command"| node_needle
node_orchestrator -->|"registers tool"| node_lighting
node_orchestrator -->|"registers tool"| node_climate
node_orchestrator -->|"requests extraction"| node_needle
node_needle -->|"uses schema"| node_invoice
node_orchestrator -->|"writes summary"| node_report

click node_orchestrator "https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py"
click node_lighting "https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py"
click node_climate "https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py"
click node_invoice "https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.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_user toneBlue
class node_orchestrator,node_lighting,node_climate,node_invoice toneTeal
class node_needle,node_report toneIndigo
```

## Components

### Other components

- **User**
- [Automation runner](https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py): `main.py`
- **Needle SDK**
- [Lighting tool](https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py): `main.py`
- [Climate tool](https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py): `main.py`
- [Invoice schema](https://github.com/47thtechcorner/raycodes_needle3/blob/master/main.py): `main.py`
- **Execution report**

## Connections

- User → Automation runner: runs with inputs (evidence: `README.md`)
- Automation runner → Needle SDK: routes command (evidence: `main.py`)
- Automation runner → Lighting tool: registers tool (evidence: `main.py`)
- Automation runner → Climate tool: registers tool (evidence: `main.py`)
- Automation runner → Needle SDK: requests extraction (evidence: `main.py`)
- Needle SDK → Invoice schema: uses schema (evidence: `main.py`)
- Automation runner → Execution report: writes summary (evidence: `main.py`)
