Architecture live

The live topology of snake.aws.monce.ai โ€” modules, routes, the request flow, and how the knowledge engine stays off the workers. Read from the code, not memory.
โ€ฆ
factories on /health
โ€ฆ
knowledge factories
โ€ฆ
store entries
โ€ฆ
API version

Request flow

                Route53  โ†’  nginx (TLS, write-IP gate)  โ†’  gunicorn (uvicorn workers)
                                                                โ”‚
                                                                โ–ผ  FastAPI app
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ”‚ /query /batch                โ”‚ /lookup                   โ”‚ /knowledge          โ”‚
      โ”‚  matcher.py (Snake SAT โ†’      โ”‚  lookup.py (value_        โ”‚  knowledge_routes โ†’ โ”‚
      โ”‚   fuzzy โ†’ LLM cascade)        โ”‚   corrected memory)       โ”‚   subprocess        โ”‚
      โ”‚  models resident per factory  โ”‚  in-proc matcher          โ”‚   inference.py      โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚                               โ”‚                      โ”‚
              ensemble=true (default)                 โ”‚             load model โ†’ predict โ†’ EXIT
                      โ”‚                               โ”‚                      โ”‚  (no resident model)
                      โ–ผ                               โ”‚                      โ–ผ
                 assess.py  โ”€โ”€ gathers all four votes โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ  store (disk + S3)
                      โ”‚                                              compute once, then lookup
                      โ–ผ
             400-point weighted verdict  โ†’  match / candidates / composite audit

Modules

matcher.py

3-tier Snake SAT โ†’ fuzzy โ†’ LLM cascade; per-factory resident models; field-bucket routing. Powers /query /batch.

lookup.py

Deterministic value_corrected โ†’ matching memory, field-compartmentalized, exactโ†’fuzzy fallback. Powers /lookup.

knowledge.py + inference.py

Catalogue vLookup + algorithmeai Snake v5.5.1, per (factory,field). Subprocess load-and-unload, store-backed.

assess.py

The 400-point weighted vote over all four engines + composite audit. Wired seamlessly into /query//batch.

Routes

routemethodwhat
/query /batchPOSTarticle matching; ensemble default on
/lookup /lookup/batchPOSTvalue_corrected memory resolve
/knowledge/query /batchPOSTvLookup + Snake, store-backed
/knowledgeGETlanding: dropdowns, live query, truth-table editor, KPI
/assess /assess/batchPOST400-point ensemble verdict
/assess/uiGETdatasource-conflict viewer
/paper /math /economics /architectureGETthese surfaces
/healthGETfactory model stats (consumed by /economics)

The knowledge engine stays off the workers

The Feb 2026 OOM incident taught the box that every gunicorn worker loading every model does not scale. So the knowledge layer holds nothing resident: a cache miss shells out to scripts/inference.py, which loads one small Snake JSON, predicts, and the process exits. The outcome is written to a two-tier store โ€” local disk (hot) and S3 (durable, survives restart and the no-Elastic-IP instance recycling) โ€” keyed by the tokenized (factory, field, normalize(text)).

Deploy topology

spec
Instancer6i.4xlarge ยท 16 vCPU ยท 128 GB ยท eu-west-3
Workersgunicorn uvicorn workers behind nginx
Enginealgorithmeai v5.5.1 (numpy runtime), loaded per subprocess
Storelocal disk + s3://โ€ฆ/knowledge_store (box IAM role)
Datamonce_db (catalogue, value_corrected) ยท vendored knowledge bundles

See /economics for the live cost read-out.

โ€” Charles Dana ยท AI+ML @ Monce.ai ยท AWS SkillMaker
cdana@monce.ai ยท +33 6 77 60 49 48 ยท threads.com/@notjustcharles
Built by Claude Opus 4.8 (1M context) ยท 2026-07-18 ยท Snake API v7.0.0