# reinhardtmarta/hdm architecture

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

- Interactive diagram: https://gitdiagram.com/reinhardtmarta/hdm
- Repository: https://github.com/reinhardtmarta/hdm

## Overview

HDM is a Python library for deterministic high-dimensional vector projection, search, and adaptive DCT-II compression. Its main workflows are either a caller using HDMCompressor to reduce and reconstruct vectors or serialize sparse coefficients, or an API client submitting vectors for signatures and nearest-neighbor queries. Separate motion-analysis components derive trajectory metrics from scanner signatures, while the trajectory tensor computes angular coherence. The API, scanner, compressor, and motion modules are shown in source; other documented integration details were not independently inspected.

Main entry points: [`highdimensionsmap/scanner.py`](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/scanner.py) (HDM scanner), [`highdimensionsmap/api.py`](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/api.py) (FastAPI endpoints), [`highdimensionsmap/compressor.py`](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/compressor.py) (DCT compressor), [`highdimensionsmap/kinematics.py`](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/kinematics.py) (Motion kinematics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_projection["Projection and compression"]
  node_scanner["HDM scanner<br/>[scanner.py]"]
  node_compressor["DCT compressor<br/>[compressor.py]"]
end

subgraph group_motion["Trajectory analysis"]
  node_kinematics["Motion kinematics<br/>[kinematics.py]"]
  node_tracker["Robust tracker<br/>[tracker.py]"]
  node_tensor["Coherence tensor<br/>[tensor.py]"]
end

subgraph group_service["HTTP service"]
  node_api["FastAPI endpoints<br/>[api.py]"]
end

node_caller(("Library caller"))
node_client(("HTTP client"))

node_caller -->|"compresses vectors"| node_compressor
node_caller -->|"reconstructs vectors"| node_compressor
node_client -->|"submits requests"| node_api
node_api -->|"transforms and queries"| node_scanner
node_kinematics -->|"transforms trajectories"| node_scanner
node_tracker -->|"transforms trajectories"| node_scanner

click node_scanner "https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/scanner.py"
click node_compressor "https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/compressor.py"
click node_kinematics "https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/kinematics.py"
click node_tracker "https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/tracker.py"
click node_tensor "https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/tensor.py"
click node_api "https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/api.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_scanner,node_compressor,node_client toneBlue
class node_kinematics,node_tracker,node_tensor toneAmber
class node_api toneMint
class node_caller toneIndigo
```

## Components

### Projection and compression

- [HDM scanner](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/scanner.py): `highdimensionsmap/scanner.py`
- [DCT compressor](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/compressor.py): `highdimensionsmap/compressor.py`

### Trajectory analysis

- [Motion kinematics](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/kinematics.py): `highdimensionsmap/kinematics.py`
- [Robust tracker](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/tracker.py): `highdimensionsmap/tracker.py`
- [Coherence tensor](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/tensor.py): `highdimensionsmap/tensor.py`

### HTTP service

- [FastAPI endpoints](https://github.com/reinhardtmarta/hdm/blob/main/highdimensionsmap/api.py): `highdimensionsmap/api.py`

### Other components

- **Library caller**
- **HTTP client**

## Connections

- Library caller → DCT compressor: compresses vectors (evidence: `README.md`)
- Library caller → DCT compressor: reconstructs vectors (evidence: `README.md`)
- HTTP client → FastAPI endpoints: submits requests (evidence: `highdimensionsmap/api.py`)
- FastAPI endpoints → HDM scanner: transforms and queries (evidence: `highdimensionsmap/api.py`)
- Motion kinematics → HDM scanner: transforms trajectories (evidence: `highdimensionsmap/kinematics.py`)
- Robust tracker → HDM scanner: transforms trajectories (evidence: `highdimensionsmap/tracker.py`)
