Building ISO: A Hyperpersonalized AI Food Ordering Agent for Millions of Users
ifood · E-commerce · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Food-delivery ordering agent
iFood needed an agent that could reduce food-ordering decision paralysis for millions of users, personalize recommendations, act across app and WhatsApp channels, and keep latency acceptable for hungry users.
Constraints:
- Users may express vague or complex intents rather than exact food searches.
- The agent must use user behavior, order history, time of day, and conversation context without overloading prompts.
- The system operates in Brazil at very large consumer scale.
- Latency must be low enough for food-ordering flows.
Architecture
ISO is a hyperpersonalized food-ordering agent available in the iFood app and WhatsApp. It turns natural-language requests into search queries, uses user context to rerank options, can take actions such as coupons/cart/payment, optimizes latency through flow shortcuts and asynchronous context processing, and validates failures through evaluation cases.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR user[User] --> iso-agent[ISO Agent] iso-agent --> app-channel[App Channel] iso-agent --> whatsapp-channel[WhatsApp Channel] iso-agent --> context-builder[Context Builder] context-builder --> asynchronous-context-processing[Asynchronous Context Processing] iso-agent --> search-and-rerank-tool[Search and Rerank Tool] search-and-rerank-tool --> context-builder iso-agent --> commerce-action-tools[Commerce Action Tools] asynchronous-context-processing --> latency-optimizer[Latency Optimizer] latency-optimizer --> evaluation-suite[Evaluation Suite]
Components
| Component | Role | Interacts with |
|---|---|---|
User |
Hungry customer interacting through the iFood app or WhatsApp. | ISO Agent |
ISO Agent |
Food-ordering agent that understands intent, calls tools, and takes actions on behalf of the user. | User, App Channel, WhatsApp Channel, Context Builder, Search and Rerank Tool, Commerce Action Tools |
App Channel |
Native app surface with floating button, rich UI, follow-up questions, cart, and payment. | ISO Agent |
WhatsApp Channel |
Messaging commerce channel used heavily in Brazil. | ISO Agent |
Context Builder |
Builds conversation and user-profile context from preferences, order history, food categories, and time of day. | ISO Agent, Asynchronous Context Processing |
Asynchronous Context Processing |
Moves prior-message compaction and user-behavior selection out of the synchronous slow path. | Context Builder, Latency Optimizer |
Search and Rerank Tool |
Converts intent into searches and reranks food options using context. | ISO Agent, Context Builder |
Commerce Action Tools |
Applies coupons, manages cart, checks loyalty discounts, checkout, and payment experiments. | ISO Agent |
Latency Optimizer |
Flow shortcuts, prompt compression, smaller models, and English prompts used to reduce P95 latency. | Asynchronous Context Processing, Evaluation Suite |
Evaluation Suite |
Cases added when production errors or prompt edge cases appear. | Latency Optimizer |
Data flow
The agent receives an app or WhatsApp request, combines conversation context with preprocessed user-profile context, converts the request into semantic/exact search queries, reranks results with user context, returns UI/tool responses to the agent, and then can apply coupons, update carts, or initiate payment.
3 supporting quotes
Why this architecture
The architecture is agentic because simple search is not enough: ISO must interpret vague food intent, personalize with user context, and take commerce actions while keeping flows short and fast.
Models used: LLMs · smaller models · proprietary AI models
Scale
- iFood processes about 160 million monthly orders.“uh the company so there are 160 million monthly orders that I makes 400,000 delivery drivers 50 55 million monthly users and i food is present in 1500 cities in Brazil and it's not just a food delivery”transcript, stated
- iFood has roughly 50-55 million monthly users and is present in 1,500 Brazilian cities.“50 55 million monthly users and i food is present in 1500 cities in Brazil and it's not just a food delivery company. So if food is also a Brazilian tech company and again uh you know in the genai wave it's uh it's much easier”transcript, stated
- iFood runs 150 proprietary AI models and 14 billion real-time predictions monthly.“numbers. So there are 150 proprietary AI models and a lot of them are known as Genaii models that uh for model for logistics for example that uh so whenever someone makes an order this model connects uh how to assign a driver”transcript, stated“to that order 14 billion uh real-time predictions are made every month 16 pabytes of data uh in the data lake and so on. So I food is a truly so it's a food delivery company but it's truly a Brazilian tech company.”transcript, stated
- WhatsApp has more than 150 million active users in Brazil.“active user base. So more than 150 million users are active in WhatsApp and not just active so people are using WhatsApp in Brazil to make e-commerce decisions. So not just to chat with friends. So it's very important to be on”transcript, stated
- The team reduced P95 latency from around 30 seconds to up to 10 seconds.“high. We had around 30 seconds P95 and we decreased that uh up to 10 seconds uh by uh looking at what flows uh we could uh simplify. So we tried to make sure that um we could have a flow to handle complex requests but when things were”transcript, stated
Alternatives considered (roads not taken)
Simple food search bar or chatbot.
Rejected because: The problem includes vague intents, personalization, and commerce actions beyond search.
Run every request through the full complex agent flow.
Rejected because: Simple requests did not need the complete slow path, so shortcuts reduced latency.
Keep all context work synchronous.
Rejected because: Prior-message compaction and user-behavior selection did not need to run in the slowest path.
Patterns
tool-use-orchestration (agent-commerce)
ISO orchestrates search, coupons, cart, loyalty, checkout, and payment actions rather than only returning text.
agent-memory (personalization)
The agent uses order history, food categories, preferences, time of day, and conversation state as memory-like context.
query-rewriting (retrieval)
ISO expands vague food requests into multiple search queries before reranking results.
latency-optimization (runtime)
iFood reduced P95 latency by simplifying flows, moving context work async, compressing prompts, and using smaller models where possible.
eval-driven-development (evaluation)
Production errors and user complaints become evaluation cases before prompt changes are accepted.
Tradeoffs
Intent handling
Chose Agentic food recommender with tools and actions over Simple search/chatbot.
Rationale: The agent needed to handle vague preferences and take commerce actions, not just retrieve food items.
Latency design
Chose Separate simple fast paths from complex flows over One full agent path for every request.
Rationale: Simple requests do not need the full complex flow and can be handled faster.
Context processing placement
Chose Asynchronous preprocessing for prior messages and behavior signals over Doing all context work synchronously in the slowest flow.
Rationale: Moving tokens out of the slow path reduced latency even if total token work did not disappear.
Gotchas (what bit them)
Hungry users will not tolerate slow agent loops.
Root cause: The first simple agent flow prioritized making the flow work and landed at high latency.
Resolution: Create shortcuts, move context work async, compress prompts, and use smaller models where possible.
Prompt bloat accumulates from production edge-case fixes.
Root cause: Teams can respond to every bug, complaint, or eval failure by adding another system-prompt rule.
Resolution: Create evaluation cases for those scenarios and address root causes instead of endlessly adding prompt rules.
Non-English prompts can inflate latency and context pressure.
Root cause: Token tariffs penalize languages other than English in their measurements.
Resolution: Use English prompts to reduce tokens compared with Portuguese versions.
Evaluation
iFood adds evaluation cases from production errors, user complaints, and edge cases before changing prompts; the team also tracks latency and context optimization effects.
Metrics: P95 latency · Evaluation-case pass/fail · Prompt token count · Context processing latency · User-visible flow success
Outcomes
- ISO runs for millions of users in Brazil across app and WhatsApp.
- The team reduced P95 latency from roughly 30 seconds to up to 10 seconds.
- The agent can search, recommend, apply coupons, manage cart flows, and experiment with payments.
iFood reports 160 million monthly orders, 50-55 million monthly users, 1,500 cities, 150 proprietary AI models, 14 billion monthly predictions, and ISO live to millions.