Engine
FastAPI service that runs the buy for one kitchen at a time: knowledge base, fixed pipeline, live progress, signed calls to AimoGuard.
Architecture
Engine architecture
What it does
| Area | Job |
|---|---|
| Entries | Web asks, Telegram (text / voice / photo), assist for transcription and vision |
| Knowledge | Diet, dishes, slip, memory loaded in full every run |
| Pipeline | Understand → quantify → match → quote → packs → score → exceptions → validate → policy → cart |
| Models | Read and choose (Gemini Decisions + Flash). Numbers stay in code |
| AimoGuard | Search, signed quotes, policy dry-run, place order (slip + Agent-Signature) |
| Cart chat | Propose edits in words; never signs for the human |
| Submit | Human approvals + signed confirmation |
| Learning | Preferences and portions, with an eval gate |
| Scheduler | Weekly standing orders and stock-out watch |
Hard rules
- Prices, packs, on-time scores, carbon, and policy outcomes come from code
- Diet and allergen rules always load completely
- AimoGuard re-checks every quote and order
- Learning cannot change diet or budget without a new signed slip
Deep dives: Order flow · Understanding models · Learning · Scheduling