<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucas Pinheiro</title>
    <description>The latest articles on DEV Community by Lucas Pinheiro (@lucaspinheiro).</description>
    <link>https://dev.to/lucaspinheiro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4224715%2Ff0b1fdd9-42ce-48fa-9776-009e99a3de1a.png</url>
      <title>DEV Community: Lucas Pinheiro</title>
      <link>https://dev.to/lucaspinheiro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lucaspinheiro"/>
    <language>en</language>
    <item>
      <title>Como construímos um assistente financeiro no WhatsApp com IA e Open Finance</title>
      <dc:creator>Lucas Pinheiro</dc:creator>
      <pubDate>Mon, 16 Nov 2026 19:52:13 +0000</pubDate>
      <link>https://dev.to/lucaspinheiro/como-construimos-um-assistente-financeiro-no-whatsapp-com-ia-e-open-finance-29jd</link>
      <guid>https://dev.to/lucaspinheiro/como-construimos-um-assistente-financeiro-no-whatsapp-com-ia-e-open-finance-29jd</guid>
      <description>&lt;h1&gt;
  
  
  Como construímos um assistente financeiro no WhatsApp com IA e Open Finance
&lt;/h1&gt;

&lt;p&gt;A maior parte dos controles financeiros não quebra no gráfico de fim de mês. Quebra no lançamento. A pessoa paga o almoço, guarda o cupom “para anotar depois” e, à noite, o depois vira um palpite. Não falta planilha. Falta um caminho curto entre o fato e o registro.&lt;/p&gt;

&lt;p&gt;Sou Lucas Pinheiro, cofundador do ZapGastos com Anderson Nunes. Sou engenheiro de formação, não sou planejador financeiro certificado, e este texto não é recomendação de investimento. É uma nota de engenharia: como um &lt;a href="https://zapgastos.com/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=parasite" rel="noopener noreferrer"&gt;assistente financeiro whatsapp&lt;/a&gt; registra o gasto a tempo, e como a conexão bancária entra nisso sem fingir que resolve tudo sozinha.&lt;/p&gt;

&lt;h2&gt;
  
  
  O canal já existia. O razão, não
&lt;/h2&gt;

&lt;p&gt;No Brasil, o comprovante já circula no WhatsApp: o grupo da casa, o pix encaminhado, o “paguei aquilo.” Pedir que a pessoa abra mais um aplicativo na padaria acrescenta um passo no pior momento. Por isso o ZapGastos começou na conversa. Você manda um texto (“mercado 87”), um áudio (“paguei 45 na farmácia”) ou a foto do cupom, e o assistente propõe um lançamento na categoria certa.&lt;/p&gt;

&lt;p&gt;Depois vieram outros acessos ao mesmo controle: em 2026, o aplicativo para iPhone e Android; e o Telegram, com o bot oficial, depois da confirmação pelo WhatsApp. Isso só funciona se o pipeline não estiver amarrado a um cliente. As conversas e o app são portas. O razão — o registro do mês — é uma fonte só.&lt;/p&gt;

&lt;h2&gt;
  
  
  O pipeline, em alto nível
&lt;/h2&gt;

&lt;p&gt;Não vou entrar em fornecedor nem em modelo específico. O fluxo de um lançamento manual tem quatro etapas, e cada uma falha de um jeito:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;texto / áudio / foto do cupom
   -&amp;gt; 1. interpretação   (o que aconteceu?)
   -&amp;gt; 2. estruturação    (valor, data, estabelecimento, categoria proposta)
   -&amp;gt; 3. confirmação     (a pessoa vê e corrige)
   -&amp;gt; 4. razão           (o lançamento entra no controle do período)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1. Interpretação.&lt;/strong&gt; O português do dia a dia não parece formulário. “Mercado 87” é um gasto. “Recebi 2 mil de salário” é uma receita. “Tenho R$ 50 de academia todo dia 5” é um recorrente. Áudio e foto do cupom entram na mesma etapa, só muda o caminho até a linguagem: transcrição ou leitura do comprovante. Pedimos saída estruturada, não um parágrafo: código não confere texto corrido.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Estruturação.&lt;/strong&gt; A IA propõe um registro. Ela não deveria inventar saldo bancário nem “prever” um resultado financeiro. Valor, data e uma categoria inicial bastam para o lançamento existir. Quando algo sai errado, dá para perguntar se foi a leitura, a categoria ou um dado ainda não confirmado.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Confirmação.&lt;/strong&gt; Um número confiante e errado é pior do que um rascunho visível. O chat devolve o valor, a categoria e o dia, e deixa corrigir na hora — uma decisão de produto tão importante quanto a escolha do modelo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Razão.&lt;/strong&gt; Só depois da confirmação o lançamento entra no controle. Relatórios, gráficos, lembretes e a consulta em linguagem simples (“quanto já gastei no mês?”) leem essa mesma base. Uma melhoria na categoria ou na leitura do cupom chega a todas as portas de uma vez.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open Finance é uma segunda porta, não um passe de mágica
&lt;/h2&gt;

&lt;p&gt;Quem quer menos trabalho ainda pode conectar contas e cartões pelo &lt;a href="https://zapgastos.com/open-finance/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=parasite" rel="noopener noreferrer"&gt;Open Finance&lt;/a&gt;, o sistema regulado pelo Banco Central. A autorização acontece no aplicativo do próprio banco. A pessoa escolhe o que compartilhar e pode cancelar o compartilhamento quando quiser. Sem essa conexão, o controle funciona só com o que ela manda na conversa.&lt;/p&gt;

&lt;p&gt;Segundo a página Sobre, 114 bancos podem ser conectados. O limite simultâneo (três, cinco ou dez, conforme o plano) deve ser lido na &lt;a href="https://zapgastos.com/planos/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=parasite" rel="noopener noreferrer"&gt;página de planos&lt;/a&gt; na hora de assinar.&lt;/p&gt;

&lt;p&gt;A parte difícil não é “puxar o extrato.” É reconciliar. Um almoço lançado por áudio e a mesma compra no cartão não podem virar duas despesas, nem desaparecer sem a pessoa perceber. O conflito precisa ficar visível e fácil de revisar.&lt;/p&gt;

&lt;p&gt;O ZapGastos não é um banco. Ele organiza informações que você registrou ou autorizou. Não deve ser descrito como se movimentasse dinheiro, tomasse decisão de investimento ou “cuidasse” da vida financeira no seu lugar.&lt;/p&gt;

&lt;h2&gt;
  
  
  O que foi mais difícil do que parecia
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linguagem informal.&lt;/strong&gt; A mesma padaria aparece com três nomes. Um áudio omite a data. O sistema tem de pedir o que falta, não adivinhar com segurança falsa.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foto de cupom.&lt;/strong&gt; Papel amassado, vários itens, um total que não bate com a soma. A leitura ajuda; a conferência continua sendo da pessoa.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Categoria ambígua.&lt;/strong&gt; O mesmo estabelecimento serve almoço e material de trabalho. A primeira sugestão precisa ser boa o bastante para não cansar, e fácil de trocar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duas origens, um mês.&lt;/strong&gt; Lançamento manual e movimentação autorizada pedem regras de revisão, não um botão de “confiar em tudo.”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controle compartilhado.&lt;/strong&gt; Até dez pessoas podem usar o mesmo controle, no plano mais completo. O que é gasto da casa e o que é pessoal se resolve com combinado, e com o produto respeitando esse combinado.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  O que eu diria a quem for construir algo parecido
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Trate o chat como cliente fino. O produto é o razão.&lt;/li&gt;
&lt;li&gt;Peça saída estruturada, que dá para validar.&lt;/li&gt;
&lt;li&gt;Faça da autorização um fluxo de primeira classe: dar, rever, revogar.&lt;/li&gt;
&lt;li&gt;Desenhe a revisão de duplicata no começo, não como correção tardia.&lt;/li&gt;
&lt;li&gt;Não prometa rendimento, economia garantida ou que a ferramenta decide por alguém.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;O ZapGastos é uma assinatura paga, com garantia de 7 dias, no WhatsApp, no Telegram, no iOS e no Android. Os planos começam em R$ 9,90 por mês no pagamento anual. Se quiser ver um &lt;a href="https://zapgastos.com/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=parasite" rel="noopener noreferrer"&gt;app controle financeiro&lt;/a&gt; que registra o gasto na conversa em que o comprovante já está, Comece Agora no site.&lt;/p&gt;

&lt;p&gt;Este texto é sobre construção de produto. Não substitui um profissional habilitado, não é recomendação de crédito ou investimento, e não afirma resultado financeiro.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>whatsapp</category>
      <category>fintech</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How we built an AI calorie counter that understands Brazilian food from a photo</title>
      <dc:creator>Lucas Pinheiro</dc:creator>
      <pubDate>Wed, 04 Nov 2026 02:49:23 +0000</pubDate>
      <link>https://dev.to/lucaspinheiro/how-we-built-an-ai-calorie-counter-that-understands-brazilian-food-from-a-photo-ccn</link>
      <guid>https://dev.to/lucaspinheiro/how-we-built-an-ai-calorie-counter-that-understands-brazilian-food-from-a-photo-ccn</guid>
      <description>&lt;p&gt;Most calorie apps are built around a search box. You type "rice", scroll through 40 entries with different numbers, pick one, guess the grams, and repeat for every item on the plate. In my experience that is the moment people give up. It isn't the diet. It's the data entry.&lt;/p&gt;

&lt;p&gt;I'm Lucas Pinheiro. I've worked on digital products, SEO, ads and AI since I founded LucasPro in 2016. In 2025 I built ZapGastos, and in 2026 I started ContaCal, a calorie counter where you log a meal by sending a photo. I'm not a nutritionist, and this post isn't nutrition advice. It's about the engineering problem: turning a phone photo of a very Brazilian plate into a useful calorie and macro estimate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with "global" food recognition
&lt;/h2&gt;

&lt;p&gt;A typical lunch in Brazil is rice, beans, a protein, salad, maybe farofa, all on one plate and often touching. Add regional dishes (baião de dois, feijão tropeiro, tapioca, açaí bowls with toppings), the &lt;em&gt;marmita&lt;/em&gt; (a packed lunchbox), and &lt;em&gt;comida por quilo&lt;/em&gt; (buffets where you pay by weight), and you get a lot of cases that generic food datasets cover badly.&lt;/p&gt;

&lt;p&gt;There are two separate failure modes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Recognition&lt;/strong&gt;: the model sees "brown stuff with grains" and calls it chili instead of feijão, or misses the farofa sprinkled over everything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nutrition lookup&lt;/strong&gt;: even when the item is named correctly, the reference values come from a database built around another country's recipes and serving sizes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fixing only the first doesn't help much if the second is still wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline, at a high level
&lt;/h2&gt;

&lt;p&gt;I won't go into vendor specifics, but the flow has four stages and each one can fail in its own way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;photo / text / voice
   -&amp;gt; 1. item recognition   (what is on the plate?)
   -&amp;gt; 2. portion estimation (how much of each?)
   -&amp;gt; 3. nutrition mapping  (match each item to a food in a Brazilian database)
   -&amp;gt; 4. aggregation        (calories, protein, carbs, fat, meal Health Score)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1. Item recognition.&lt;/strong&gt; A vision-capable AI model gets the image and returns a structured list of items rather than prose. Asking for structure (item name, a rough preparation like "fried" or "grilled", and a portion guess) makes the later stages much easier to validate. Prose reads nicely, but code can't check it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Portion estimation.&lt;/strong&gt; This is the hardest part, and I'd rather say so than pretend it's solved. A single photo has no reliable scale. A plate, a fork and the lunchbox walls give some hints, but a deep pot of beans and a shallow one can look the same from above. We treat portions as estimates and make them easy to edit after logging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Nutrition mapping.&lt;/strong&gt; We don't let the model invent calorie numbers. The recognized items get matched to entries in a food database built for Brazilian meals (600+ foods today, including regional dishes, lunchbox staples and restaurant food), and the numbers come from those entries. Users can also look up a food directly before logging. That split gives a clear line between two kinds of error, which makes debugging much easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Aggregation.&lt;/strong&gt; Per-item values get summed into calories, protein, carbs and fat for the meal, plus a simple Health Score, and the meal goes into the user's day. From the user's side the whole round trip takes about three seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Text and voice use the same pipeline
&lt;/h2&gt;

&lt;p&gt;Photos aren't always practical. Sometimes the food is already eaten, or you're on a bus. So the same flow accepts a typed description ("1 pão de queijo and a latte") or a voice note. Only stage 1 changes: we parse language instead of pixels, and stages 2 to 4 stay the same. One normalized "list of items with portions" format feeds everything downstream.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meeting users where they already are: WhatsApp
&lt;/h2&gt;

&lt;p&gt;In Brazil, WhatsApp is the default interface for almost everything. Asking people to open yet another app at lunch adds friction, so ContaCal also works through an official WhatsApp number. You send a photo, text or audio, get calories and macros back in the chat, and the entry syncs to the app dashboard.&lt;/p&gt;

&lt;p&gt;On the engineering side this means the logging pipeline can't be tied to any one client. The app and the WhatsApp channel are both thin front ends over the same backend flow, and there's one source of truth for the user's day. When we fix something in recognition or in the database, both channels get it at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things that were harder than expected
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mixed plates.&lt;/strong&gt; Rice and beans touching, sauces covering the protein, farofa on top. Splitting a single "blob" into separate items matters more than spotting exotic dishes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same name, different food.&lt;/strong&gt; Regional names vary, and the same dish changes a lot from one state to the next. The database has to carry those variations instead of one "average" entry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restaurant and buffet food.&lt;/strong&gt; Cooking oil and preparation are mostly invisible in a photo. That's a real source of error, and we say so instead of hiding it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust.&lt;/strong&gt; A confident number that's wrong is worse than a rough number the user can see and adjust. Making the estimate editable was a product decision as much as a technical one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The deterministic part: calculators
&lt;/h2&gt;

&lt;p&gt;Not everything needs AI. Daily calorie targets, BMR, TDEE, macros and similar numbers come from published formulas. The site's calorie calculator, for example, uses Mifflin-St Jeor. We keep those as plain, deterministic calculators that anyone can use without signing up, and the app uses the same logic for goals. If you want to look at the math, the &lt;a href="https://contacal.com/en/calculadoras?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=parasite" rel="noopener noreferrer"&gt;ContaCal calculators&lt;/a&gt; are open on the web.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell anyone building something similar
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep the model on &lt;strong&gt;recognition&lt;/strong&gt; and the database on &lt;strong&gt;numbers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Ask the model for &lt;strong&gt;structured output&lt;/strong&gt; you can validate.&lt;/li&gt;
&lt;li&gt;Treat &lt;strong&gt;portion size as uncertain&lt;/strong&gt; and design the UI around fixing it.&lt;/li&gt;
&lt;li&gt;Build the pipeline &lt;strong&gt;once&lt;/strong&gt;, and plug in channels (app, chat, voice) as thin clients.&lt;/li&gt;
&lt;li&gt;Test with &lt;strong&gt;local food&lt;/strong&gt;, not stock photos. Your users' plates are your real test set.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If you want to try it
&lt;/h2&gt;

&lt;p&gt;ContaCal is a subscription app with a 7-day money-back guarantee, available on iOS, Android, the web and WhatsApp. If you want to see the photo-to-macros flow on a real plate, it's at &lt;a href="https://contacal.com/en?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=parasite" rel="noopener noreferrer"&gt;contacal.com&lt;/a&gt;. I'm happy to answer questions about the architecture in the comments.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Note: ContaCal's numbers are estimates meant to help with logging and organization. They don't replace guidance from a doctor or a registered dietitian/nutritionist.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mobile</category>
      <category>webdev</category>
      <category>health</category>
    </item>
  </channel>
</rss>
