Skip to main content

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
EntriesEngine coreModels & Valio doorHuman clientweb appTelegramtext · voice · photoAssisttranscribe · visionEngine · FastAPISSE progress · agent keys · one KB per kitchenUnderstandQuantifyMatchQuotePacksScoreExceptionsValidatePolicyCartCart + chatedit · propose · never signsSubmitapprovals → orderAgent keysper kitchenKnowledge basediet · dishes · slip · memorySQLite fileone per kitchenGeminiDecisions · Flash · voiceAimoGuardsearch · quote · policy · orderCatalogFTSValio APIpriceLearningmemory · portions · eval gateSchedulerweekly orders · stock watchHard rulesnumbers in code · diet full-load · gateway re-checks · learning cannot raise budget
12/12Whole picture. Entries and assist in, knowledge and pipeline in the middle, models for reading and choosing, AimoGuard for signed prices and orders, learning and schedule on the side.

What it does​

AreaJob
EntriesWeb asks, Telegram (text / voice / photo), assist for transcription and vision
KnowledgeDiet, dishes, slip, memory loaded in full every run
PipelineUnderstand → quantify → match → quote → packs → score → exceptions → validate → policy → cart
ModelsRead and choose (Gemini Decisions + Flash). Numbers stay in code
AimoGuardSearch, signed quotes, policy dry-run, place order (slip + Agent-Signature)
Cart chatPropose edits in words; never signs for the human
SubmitHuman approvals + signed confirmation
LearningPreferences and portions, with an eval gate
SchedulerWeekly 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