Spaces:
Sleeping
Sleeping
File size: 1,705 Bytes
ce45eb0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # Matrix Context β frontend (control plane / admin UI)
The **single source of truth** for the web UI. A self-contained, zero-dependency
operator console (Overview Β· Inspector Β· Ingest Β· Memory Β· Experts Β· Routing Β·
Benchmarks Β· MoC Contract Β· Settings) wired to the live **MoC Contract v1** API.
Used both for native/local runs and as the app inside the Hugging Face Space
(`../hf/`, which builds from this folder β the UI is not duplicated).
```
frontend/
βββ server.py # launcher: serves app/ + the live /v1 API (reuses the backend), seeds demo data
βββ app/ # the SPA (no React/Babel/CDN for logic; fonts from Google Fonts)
βββ index.html # shell + matrix-rain canvas
βββ styles.css # emerald-glass theme
βββ api.js # live /v1 adapter (maps backend shapes for the UI)
βββ app.js # the views
βββ assets/ # logo
```
## Run (native / local)
```bash
pip install -e ".[dev]" # from the repo root
python frontend/server.py # -> http://127.0.0.1:7860
```
Environment: `HOST` (default `127.0.0.1`), `PORT` (default `7860`),
`MATRIX_CONTEXT_PATH` (default `:memory:`).
## Hugging Face
The Space packaging (Dockerfile + card + deploy) lives in [`../hf/`](../hf) and
builds from this folder. Deploy with `python hf/deploy.py --repo <user>/<space>`.
## How it talks to the backend
The UI calls the same-origin `/v1` surface; the Ingest wizard runs in Compatible
Mode (client-side chunking β `POST /v1/remember`, metadata stored as tags). It is
additive β `server.py` imports the published backend and serves the existing
`dispatch`; nothing in the engine is modified.
|