MonceApp v0.1.0
System Architecture
User: "Train this CSV and solve this CNF"
│
▼
┌───────────────────────────────────────────────────────┐
│ (-monceai) PRE-CHECK │
│ npcalc: formula? → exact result, skip model │
└───────────────────┬───────────────────────────────────┘
│ not a formula
▼
┌───────────────────────────────────────────────────────┐
│ (monceai-) INPUT LAYER │
│ enhance_system() → system prompt + domain context │
│ Factory context injected only if factory_id > 0 │
└───────────────────┬───────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────┐
│ CONVERSE CALL 1 — Bedrock Converse API │
│ Model sees: user message + tool definitions │
│ Model returns: N toolUse blocks (parallel request) │
└───────────────────┬───────────────────────────────────┘
│
┌──────────┼──────────┬───────────┐
▼ ▼ ▼ ▼
snake_csv sat_cnf snake_match ask_charles
snakebatch npdollars local JSON charles API
/v6/train /cnf/solve (~50ms) (~500ms)
│ │ │ │
└──────────┼──────────┴───────────┘
│ ThreadPoolExecutor
│ all results collected
▼
┌───────────────────────────────────────────────────────┐
│ CONVERSE CALL 2 — Synthesize │
│ Model sees: original + ALL tool results │
│ Model returns: one natural language response │
└───────────────────┬───────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────┐
│ (-monceai) OUTPUT LAYER │
│ sat_validate() → glass mentions → Snake SAT audit │
│ np_calc result attached if formula was pre-computed │
└───────────────────┬───────────────────────────────────┘
│
▼
One response to user
3 Payloads, 1 Response
| # | Payload | Direction | What |
| 1 | Converse call | → Bedrock | User message + tools → model decides what to call |
| 2 | Tool results | → Bedrock | Parallel tool outputs → model synthesizes answer |
| 3 | Final response | → User | Clean text, no tool internals visible |
Parallel Tool Execution
When the model requests multiple tools in one response, they fire simultaneously
via ThreadPoolExecutor. Wall clock = slowest tool, not sum.
# Model returns 2 toolUse blocks:
[snake_csv(csv=...), sat_cnf(dimacs=...)]
# Both fire in parallel:
snake_csv ████░░░░░░ 166ms → snakebatch.aws.monce.ai
sat_cnf ████████░░ 362ms → npdollars.aws.monce.ai
↑
wall clock: 362ms (not 528ms)
10 Tools (invisible to user)
| Tool | Backend | Latency | What |
snake_csv | snakebatch.aws.monce.ai/v6/train | ~200ms | Train SAT classifier from inline CSV |
sat_cnf | npdollars.aws.monce.ai/cnf/solve | ~400ms | Solve DIMACS CNF via swarm |
snake_match | Local JSON | ~50ms | Match glass field against SAT model |
snake_train | snakebatch.aws.monce.ai | ~2-15s | Full distributed training |
sat_solve | monceai SDK → npdollars | ~1-60s | SAT solve via SDK |
run_extraction | claude.aws.monce.ai | ~30-60s | 8-stage VLM extraction pipeline |
ask_charles | charles.aws.monce.ai | ~500ms | Memory bot — team/project context |
get_pipeline_stats | claude.aws.monce.ai/stats | ~200ms | Live pipeline metrics |
model_inventory | Local | ~1ms | List Snake models on disk |
query_articles | data.aws.monce.ai | ~300ms | Article catalog search |
Tool Routing
| Provider | Tools | Why |
| Anthropic (Claude) | All 10 | Converse tool_use works reliably |
| Amazon (Nova) | None | Context-only — enhanced system prompt, no tool_use |
charles-auma Pipeline — 3 Execution Paths
User: "6x7"
│
▼
[REGEX] parse_multiplication("6x7") → (6, 7) ✓
│
▼
[mulcnf] encode_multiplication(6, 7)
│ A=110 B=111 → 27-var carry-chain adder CNF
▼
[npdollars/Kissat] SAT in 97ms → assignment
│
▼
[decode] bits → 42 = 6×7
│
▼ DONE — 0 Haiku calls, 0 tokens, ~200ms
User: "solve x^3 - 6x + 4 = 0"
│
▼
[REGEX] no multiplication/division detected
│
▼
[Haiku UPHILL] encode for 3 engines (1 LLM call)
│ auma: f="-(x**3-6*x+4)**2", Real(-10,10)
│ dimacs: constraint encoding
│ csv: training data
│
├───── RACE ──────────────────
│ AUMA x≈0.733 ← FIRST
│ npdollars SAT ...
│ snakebatch trained ...
├─────────────────────────────
│
▼
[Haiku DOWNHILL] synthesize (1 LLM call)
│ "x ≈ 0.733, verified by NP calc"
▼
DONE — 2 Haiku calls
charles-science Pipeline
User: "factor 10403"
|
v
[Haiku] extract 16 boolean features
| {has_equation:1, has_factor:1, has_integer:1, ...}
v
[Snake SAT Router] -> "auma" @ 100% confidence (0ms)
|
v
[Haiku] extract params for auma
| f = -(10403 - x*y)^2, Integer(2,10402)
v
[AUMA + charles memory] fire in parallel
| |
v v
result context
| |
v---------v
[Sonnet] synthesize: 10403 = 101 x 103
Infrastructure (10 services)
| Service | Host | Role |
| MonceApp | monceapp.aws.monce.ai | 13 models, 8 workers, 100 concurrent users |
| AUMA | auma.aws.monce.ai | Universal maximization O(n^a). paper |
| Sudoku | sudoku.aws.monce.ai | Polynomial BCP solver. UI |
| NPDollars | npdollars.aws.monce.ai | Swarm SAT solver. /cnf |
| SnakeBatch | snakebatch.aws.monce.ai | Distributed Snake training. /csv |
| Chess | chess.aws.monce.ai | AUMA chess engine vs Stockfish d22 |
| Snake API | snake.aws.monce.ai | Production SAT models, 3-tier matching |
| Charles | charles.aws.monce.ai | Haiku memory bot |
| Claude Pipeline | claude.aws.monce.ai | 8-stage VLM extraction |
| Monce Data | data.aws.monce.ai | S3 data sync, KPIs, synonym management |
Concurrency (t3.small, $15/month)
| Test | Result | Wall clock |
| 100 concurrent Haiku | 100/100 | 26s |
| 100 concurrent charles-json | 96/100 | 90s |
| 10 concurrent charles-science | 10/10 | 65s |
| Server memory after blast | 553MB / 1.9GB | alive |