<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oseias Magalhães on Medium]]></title>
        <description><![CDATA[Stories by Oseias Magalhães on Medium]]></description>
        <link>https://medium.com/@oseiasmagalhaes?source=rss-e72262f1c85d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*okJ5ke4xo8Fe1GpQgoQMBA.png</url>
            <title>Stories by Oseias Magalhães on Medium</title>
            <link>https://medium.com/@oseiasmagalhaes?source=rss-e72262f1c85d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:56:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oseiasmagalhaes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My Master’s Project Is Finally Taking Shape]]></title>
            <link>https://medium.com/@oseiasmagalhaes/my-masters-project-is-finally-taking-shape-2f0a0ff62159?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f0a0ff62159</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[process-automation]]></category>
            <category><![CDATA[agtech]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 22:50:06 GMT</pubDate>
            <atom:updated>2026-11-23T22:50:06.856Z</atom:updated>
            <content:encoded><![CDATA[<h3>Running an offline CNN model on portable hardware to drive real-time, selective weed control in corn crops.</h3><p>Before you watch: turn the sound on. Every click you hear in the video isn’t a sound effect — it’s a physical relay firing in real time the exact moment the system decides to act.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F1249487039%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F1249487039%3Fshare%3Dcopy%26fl%3Dsv%26fe%3Dci&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F2229869747-9642c9e64586524fb03d598431058575b5fdefaac07f929554f229e5c2095b5a-d_295x166%3Fregion%3Dus&amp;type=text%2Fhtml&amp;schema=vimeo" width="576" height="1280" frameborder="0" scrolling="no"><a href="https://medium.com/media/816ce3f7c6606bebf767dbd6d4ef942c/href">https://medium.com/media/816ce3f7c6606bebf767dbd6d4ef942c/href</a></iframe><p>One of the biggest bottlenecks in applying Artificial Intelligence to agriculture isn’t training a high-performing model in a lab. It’s getting it to run under real field conditions: without reliable internet connectivity, with low latency, and on portable hardware.</p><p>In the prototype shown above, I built an end-to-end local automation and decision-making workflow to identify weeds in corn crops:</p><ul><li><strong>Computer Vision (CNN):</strong> A model trained to detect invasive weeds directly from crop imagery.</li><li><strong>100% Offline Operation (Edge AI):</strong> All processing, inference, and decision-making happen locally, eliminating any dependency on cloud infrastructure or field connectivity.</li><li><strong>Real-Time Orchestration and Actuation:</strong> The pipeline connects model detections directly to a microcontroller and an 8-channel relay module, simulating the individual actuation of each nozzle on a spray boom.</li><li><strong>Telemetry and Observability:</strong> A local dashboard displays active nozzles, section mapping, and continuous execution logs in real time.</li></ul><p>In practice, the goal is the same one that drives any solid process automation and systems engineering effort: turning complex data into precise, auditable, and cost-effective actions — reducing input waste and environmental impact through selective spraying.</p><p>There is still validation and fine-tuning ahead, but seeing the AI layer communicate smoothly with physical hardware in a portable setup is a major milestone in my Master’s research in Applied Computing.</p><p>For those working with automation, embedded systems, or computer vision: what has been your biggest challenge when moving models out of the cloud and deploying them at the edge?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f0a0ff62159" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LexiMovi: Automating Legal Case Classification with NLP and Next.js]]></title>
            <link>https://medium.com/@oseiasmagalhaes/leximovi-automating-legal-case-classification-with-nlp-and-next-js-a7f34afee5b4?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7f34afee5b4</guid>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Sat, 10 Oct 2026 22:13:20 GMT</pubDate>
            <atom:updated>2026-10-10T22:13:20.172Z</atom:updated>
            <content:encoded><![CDATA[<p>The Brazilian judicial system generates a colossal volume of data every day. For lawyers and legal managers, tracking the progress of thousands of lawsuits by manually reading court orders and procedural updates is an exhausting task prone to error. LexiMovi was created to address this pain point; it is a full-stack LegalTech tool designed to predict case status (Active, Archived, or Suspended) using Natural Language Processing (NLP).</p><h3>The Machine Learning Strategy</h3><p>The core of LexiMovi’s intelligence lies in its ability to interpret temporal sequences of legal texts. The supervised model was trained on a labeled dataset — sourced from Kaggle as a contribution by Felipe Maia Polo regarding <a href="https://www.kaggle.com/datasets/felipepolo/brazilian-legal-proceedings?resource=download">Brazilian Legal Proceedings</a> — containing the chronological history of procedural events.</p><pre>{<br>  &quot;0&quot;: {<br>    &quot;label&quot;: &quot;H:Arquivado&quot;,<br>    &quot;texts&quot;: {<br>      &quot;-1&quot;: &quot;Tipo do Movimento:Ato Ordinatório Praticado Descrição:Certifico e dou fé que as custas pendentes de fls 685 não foram recolhidas...&quot;,<br>      &quot;-2&quot;: &quot;Tipo do Movimento:Juntada - Petição Descrição da juntada:Documento eletrônico juntado de forma automática.&quot;,<br>      &quot;-3&quot;: &quot;Tipo do Movimento:Publicado  Atos da Serventia Folhas do DJERJ.:388/416&quot;<br>    }<br>  },<br>  &quot;1&quot;: {<br>    &quot;label&quot;: &quot;H:Ativo&quot;,<br>    &quot;texts&quot;: {<br>      &quot;-1&quot;: &quot;Tipo do Movimento:Recebimento &quot;,<br>      &quot;-2&quot;: &quot;Tipo do Movimento:Despacho - Proferido despacho de mero expediente &quot;<br>    }<br>  }<br>}</pre><p>The training approach structured in the `train_leximovi_model.py` script focused on creating a robust baseline capable of rapid inference:</p><ul><li>Preprocessing: The activity logs for each case were cleaned and chronologically concatenated to form a single, sequential context for each case.</li><li>Vectorization and Pipeline: The TF-IDF method was used to transform the legal vocabulary into numerical representations via the pipeline configured in `leximovi_pipeline.py`. This captures the semantic importance of specific terms (such as “Ato Ordinatório” or “Arquive-se”). This vectorizer was seamlessly integrated with the classification algorithm.</li><li>Serialization: To ensure the AI ​​could be easily integrated into a web application, the final model was saved and exported as `leximovi_model.joblib`. This format preserves the entire state of the NLP pipeline (vectorizer + classifier) ​​to enable real-time predictions in a production environment.</li></ul><h3>Dataset Summary</h3><p>The dataset comprises a total of 6,449 cases categorized into three classes (Archived, Active, and Suspended) and is partitioned as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*5aNmLR4q3fXRgymzetnaag.png" /><figcaption>Dataset partitioning for training, validation, and testing</figcaption></figure><pre>{<br>  &quot;total_cases&quot;: 6449,<br>  &quot;classes&quot;: [<br>    &quot;Arquivado&quot;,<br>    &quot;Ativo&quot;,<br>    &quot;Suspenso&quot;<br>  ],<br>  &quot;splits&quot;: {<br>    &quot;train&quot;: {<br>      &quot;count&quot;: 4513,<br>      &quot;percentage&quot;: 69.98,<br>      &quot;distribution&quot;: {<br>        &quot;Ativo&quot;: 2041,<br>        &quot;Arquivado&quot;: 2128,<br>        &quot;Suspenso&quot;: 344<br>      }<br>    },<br>    &quot;validation&quot;: {<br>      &quot;count&quot;: 968,<br>      &quot;percentage&quot;: 15.01,<br>      &quot;distribution&quot;: {<br>        &quot;Ativo&quot;: 438,<br>        &quot;Arquivado&quot;: 456,<br>        &quot;Suspenso&quot;: 74<br>      }<br>    },<br>    &quot;test&quot;: {<br>      &quot;count&quot;: 968,<br>      &quot;percentage&quot;: 15.01,<br>      &quot;distribution&quot;: {<br>        &quot;Suspenso&quot;: 74,<br>        &quot;Ativo&quot;: 438,<br>        &quot;Arquivado&quot;: 456<br>      }<br>    }<br>  }<br>}</pre><h3>From Theory to Practice: Application Architecture</h3><p>A predictive model generates no value in isolation. To demonstrate the practical utility of LexiMovi, a full-featured web application was developed, connecting the machine learning model to a user-friendly interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wxn-wc0aSIzVOT-qL0ut0w.png" /><figcaption>LexiMovi — Classification App with Machine Learning</figcaption></figure><p>The application architecture was designed with two high-performance layers:</p><ul><li>Predictive Backend (Python): An API was built in the backend folder using dedicated scripts, such as `main.py` and `predict_service.py`. This service loads the serialized model into memory, receives transaction texts via requests, and processes status predictions in real time.</li><li>Interactive Frontend (Next.js/React): User interaction takes place on a modern platform structured within the `app` directory. The lawyer or manager enters procedural updates via an interactive form encapsulated in the `MotionForm.tsx` component. The provided history is rendered as a visual timeline interface by `HistoryFeed.tsx`, while the final AI prediction is prominently displayed via `StatusCard.tsx`.</li></ul><p>LexiMovi demonstrates that integrating machine learning algorithms with modern web architectures can deliver powerful analytical automation for the legal sector. With deployment-ready infrastructure — supported by cloud hosting configurations such as vercel.json — the project establishes a solid, scalable foundation to revolutionize the processing of case updates in Brazil.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7f34afee5b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aplicações de Inteligência Artificial para o Uso de Energia Renovável na Agricultura]]></title>
            <link>https://medium.com/@oseiasmagalhaes/aplica%C3%A7%C3%B5es-de-intelig%C3%AAncia-artificial-para-o-uso-de-energia-renov%C3%A1vel-na-agricultura-bdb9d1c47e15?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdb9d1c47e15</guid>
            <category><![CDATA[renewable-energy]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agriculture]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 22:41:50 GMT</pubDate>
            <atom:updated>2026-07-29T22:41:50.878Z</atom:updated>
            <content:encoded><![CDATA[<p>Danilo Christensen — Universidade Estadual de Ponta Grossa — UEPG</p><p>Railson Rodrigues — Universidade Estadual de Ponta Grossa — UEPG</p><p>Oséias Silva Chagas Magalhães — Universidade Estadual de Ponta Grossa — UEPG</p><p>Zito Palhano da Fonseca — Universidade Estadual de Ponta Grossa — UEPG</p><p><strong>Resumo:</strong> Este artigo aborda a crescente necessidade de substituir fontes de energia tradicionais por fontes renováveis, devido aos impactos negativos das primeiras sobre o meio ambiente e o esgotamento dos recursos naturais. A produção de energia renovável enfrenta desafios relacionados à sua variabilidade e instabilidade, o que pode ser mitigado pela aplicação de inteligência artificial (IA) e aprendizado de máquina (ML). A revisão sistemática segue seis passos, incluindo a definição de estratégias de pesquisa e a análise crítica de artigos relevantes. A integração de IA em energias renováveis, utilizando técnicas como Redes Neurais Artificiais (ANNs), Redes Neurais Convolucionais (CNNs) e Redes Neurais Recorrentes (LSTM), tem demonstrado potencial significativo na previsão precisa e eficiente da geração e consumo de energia. Estudos revelam que modelos híbridos, combinando diferentes técnicas de ML com sistemas de inferência fuzzy e otimização baseada em meta-heurísticas, melhoram a gestão de energia renovável. Apesar dos desafios de implementação e custo, a IA é essencial para otimizar a eficácia e sustentabilidade dos sistemas de energia renovável, tornando-os mais resilientes e confiáveis.</p><p><strong>Palavras-chave:</strong> Energias renováveis, Inteligência Artificial, Aprendizado de Máquina, Agricultura.</p><p><strong>Abstract:</strong> This article addresses the growing need to replace traditional energy sources with renewable ones due to the negative impacts of the former on the environment and the depletion of natural resources. Renewable energy production faces challenges related to its variability and instability, which can be mitigated by applying artificial intelligence (AI) and machine learning (ML). The systematic review follows six steps, including the definition of research strategies and the critical analysis of relevant articles. The integration of AI into renewable energies, using techniques such as Artificial Neural Networks (ANNs), Convolutional Neural Networks (CNNs), and Long Short-Term Memory Networks (LSTM), has shown significant potential in accurately and efficiently predicting energy generation and consumption. Studies reveal that hybrid models, combining different ML techniques with fuzzy inference systems and optimization based on metaheuristics, improve the management of renewable energy. Despite the challenges of implementation and cost, AI is essential for optimizing the effectiveness and sustainability of renewable energy systems, making them more resilient and reliable.</p><p><strong>Key-words:</strong> Renewable Energy, Artificial Intelligence, Machine Learning, Agriculture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JrQg-bwGAuZdSNhZefeQHw.png" /></figure><h3>1. Introdução</h3><p>A utilização de fontes de energia tradicionais tem causado diversos problemas globais, sendo o aquecimento global um dos mais graves. Como resultado, há uma tendência atual de adotar fontes renováveis em vez das tradicionais, devido à preocupação com a poluição ambiental e ao esgotamento contínuo dos recursos energéticos convencionais. As fontes de energia renovável (RESs) produzem energia limpa e não impactam negativamente o meio ambiente, ao contrário das fontes tradicionais.</p><p>No entanto, a produção irregular de energia a partir de fontes renováveis, devido à sua natureza instável e flutuações, tem gerado desafios (Sinha e Bajpai, 2020). Para otimizar os processos de energia renovável, é possível aplicar os princípios da IA (Artificial Intelligence — Inteligência Artificial) e do ML (Machine Learning — Aprendizado de Máquina), uma abordagem relativamente recente no âmbito da energia. Esses conceitos podem ser ferramentas promissoras para operar sistemas, uma vez que incorporam informações do passado e previsões futuras, visando aumentar a eficácia desses sistemas (Entezari et al., 2023).</p><p>A IA engloba diversos métodos baseados em dados capazes de solucionar uma ampla gama de questões relacionadas à energia. Embora esses métodos enfrentem desafios, eles permitem que a máquina raciocine de maneira semelhante a um ser humano, aprenda com erros e aprimore seu desempenho (Alzahrani et al., 2022). Com os avanços nas tecnologias de aprendizado de máquina e sistemas orientados por dados, a gestão e o controle dos recursos energéticos tornaram-se mais simples e práticos do que no passado (Banu et al., 2022).</p><h3>2. Material e Métodos</h3><p>Esta revisão sistemática consiste em seis passos definidos para realizar uma análise abrangente da literatura:</p><ol><li><strong>Definição de uma estratégia de pesquisa:</strong> Isso envolve a identificação de palavras-chave relevantes ao tema de estudo. Para esta revisão, as palavras-chave selecionadas foram “Energy Renewable”, “Artificial Intelligence”, “Agriculture”, “Machine Learning”, “Deep Neurals Networks” e “Energy Optimization”. Além disso, foram estabelecidos critérios de filtragem. Um limite temporal foi definido, restringindo a busca a artigos publicados nos últimos cinco anos. As bases de dados escolhidas para esta pesquisa foram o Portal de Periódicos da CAPES, IEEE Xplore, Agriculture e Scopus.</li><li><strong>Coleta e triagem inicial:</strong> Nesta etapa, aproximadamente 80 artigos foram selecionados, todos relevantes para a área de energia renovável, e que aplicavam princípios de Inteligência Artificial. Os artigos que não estavam vinculados com o termo “Agriculture”, ou tinham uma relevância superficial aos tópicos discutidos anteriormente foram excluídos.</li><li><strong>Análise e seleção de artigos:</strong> Nesta fase, os artigos são submetidos a uma análise mais detalhada. São aplicados critérios específicos como qualidade do periódico, impacto da pesquisa, e relevância com o tema de estudo. Artigos com um impacto de pesquisa menor ou com um QUALIS inferior a B2 foram excluídos.</li><li><strong>Revisão técnica e classificação:</strong> Esta etapa envolveu a identificação dos temas por meio das propostas sugeridas pelo autor, resumo, principais resultados, métodos e princípios de inteligência artificial utilizados.</li><li><strong>Análise crítica e avaliação da relevância:</strong> Para cada artigo selecionado foi realizada uma pesquisa para verificar a qualidade da pesquisa avaliada, juntamente com a relevância das soluções propostas e os métodos de inteligência artificial empregados.</li><li><strong>Síntese e apresentação dos resultados:</strong> Nesta etapa final, as descobertas e análises obtidas ao longo da pesquisa são sintetizadas e organizadas de maneira coesa.</li></ol><p><em>Figura 1. Etapas da Pesquisa</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*Qt5aIHIRQkTvJ28-sRYzng.png" /><figcaption><em>Fonte: Os autores</em></figcaption></figure><h3>3. Resultados e Discussões</h3><p>A busca por um futuro energético mais sustentável e resiliente impulsiona a rápida evolução das tecnologias renováveis com sua aplicação voltada à agricultura. Nesse cenário, a IA se destaca como uma ferramenta poderosa, capaz de revolucionar a forma como geramos, armazenamos e distribuímos energia limpa.</p><h3>3.1 Conceitos de Inteligência Artificial</h3><p>O ML tem experimentado um rápido progresso nos últimos anos. Esse avanço possibilita a implementação de funções inteligentes em aplicações que fazem uso de computação e análise de dados. Além disso, permite que sistemas aprendam e melhorem a partir da experiência, sem a necessidade de programação específica, sendo considerado uma das tecnologias mais influentes da Quarta Revolução Industrial. A eficácia e a confiabilidade das soluções baseadas em ML dependem dos dados utilizados e do desempenho dos algoritmos de aprendizado (Alloghani et al., 2020).</p><p>Além do aprendizado de máquina, as ANNs (Artificial Neural Networks — Redes Neurais Artificiais) são modelos computacionais inspirados no sistema nervoso central humano, com o objetivo de replicar suas habilidades de aprendizado. Elas são uma parte fundamental do campo de aprendizado de máquina e têm sido aplicadas com sucesso em uma ampla gama de tarefas, incluindo reconhecimento de padrões, previsão de séries temporais e diagnóstico médico (Karunakaran; Balakrishnan, 2024).</p><p>Existem vários tipos de ANNs, cada um com sua própria arquitetura e método de aprendizado. Um dos tipos mais comuns é a MLP (Multi-Layer Perceptron — Rede Neural Multicamadas), que consiste em pelo menos três camadas de nós: uma camada de entrada, uma ou mais camadas ocultas e uma camada de saída. O aprendizado em uma MLP é geralmente realizado usando o algoritmo de retropropagação, que ajusta os pesos das conexões para minimizar a diferença entre a saída da rede e a saída desejada (Muthudoss et al., 2023; Sayah et al., 2020).</p><p>As CNNs (Convolutional Neural Networks — Redes Neurais Convolucionais) são uma extensão das ANNs que têm se mostrado altamente eficazes no processamento e análise de dados visuais. A arquitetura das CNNs inclui camadas convolucionais, camadas de pooling e camadas totalmente conectadas, cada uma desempenhando uma função específica (Wu et al., 2020).</p><h3>3.2 Aplicações de IA em Energias Renováveis</h3><p>A integração de IA em sistemas de gestão de energia renovável apresenta diversos desafios, como a complexidade dos dados e a necessidade de modelos de previsão precisos. Além disso, a segurança cibernética e a privacidade dos dados são questões críticas que precisam ser abordadas. Uma área promissora de pesquisa é a formulação de modelos híbridos de previsão, que combinam dados físicos e temporais (Kumari et al., 2020; Aguilar et al., 2019).</p><p>Diversos estudos têm explorado o uso de ANNs para prever variáveis críticas em energias renováveis. Aurangzeb et al. (2023) utilizaram ANNs, especificamente três CNNs, para prever irradiância solar e velocidade do vento. Com o emprego de camadas totalmente conectadas e a função de ativação ReLU (Rectified Linear Unit — Unidade Linear Retificada), os modelos atingiram um MAPE (Mean Absolute Percentage Error — Erro Percentual Absoluto Médio) de 2,26% e um NRMSE (Normalized Root Mean Squared Error — Erro Médio Quadrático Normalizado) de 0,18 para a previsão de vento, enquanto na previsão de radiação solar os valores foram de 30,77% e 47,96%, respectivamente. Esses resultados demonstram o potencial das CNNs em capturar padrões complexos nos dados de entrada.</p><p>Outro estudo relevante é o de Ghimire et al., que utilizou uma rede neural feedforward backpropagation de três camadas para prever radiação solar. Testando 154 configurações de modelos, os autores alcançaram taxas de erro de previsão entre 77% e 87%. Esse estudo destaca a importância da experimentação na configuração de redes neurais para otimizar a precisão das previsões.</p><p>Além das ANNs padrão, redes neurais recorrentes do tipo LSTM (Long Short-Term Memory — Memória Longa de Curto Prazo) têm se mostrado eficazes na previsão de curto prazo da produção de energia solar. Harrou, Kadri e Sun (2020) aplicaram LSTM em uma planta de 9 MWp, obtendo um coeficiente de determinação R² de 0,98 e um erro percentual médio de 8,93%. A capacidade do modelo em explicar a variabilidade dos dados reforça a eficácia das LSTMs em cenários de energias renováveis.</p><p>A aplicação de técnicas híbridas, que combinam IA com métodos de otimização e inferência fuzzy, também tem mostrado resultados promissores. Dehghani et al. utilizaram o sistema ANFIS (Adaptive Neuro-Fuzzy Inference System — Sistema de Inferência Fuzzy Neuro-Adaptativo) otimizado pelo GWO (Gray Wolf Optimizer — Otimizador de Lobos Cinzentos) para prever a geração de energia hidrelétrica, alcançando uma eficiência de 78%. Este estudo ilustra como a combinação de técnicas pode aumentar a precisão das previsões.</p><p>Hanoon et al. (2023) aplicaram uma abordagem de combinação de modelos preditivos, utilizando ANN, SVM (Support Vector Machine — Máquina de Vetores de Suporte) e ARIMA (Autoregressive Integrated Moving Average — Média Móvel Integrada Autoregressiva) para prever a geração de energia hidrelétrica em diferentes escalas temporais. Embora as ANNs tenham mostrado o melhor desempenho, os modelos SVM e ARIMA também apresentaram resultados sólidos, evidenciando a eficácia de metodologias híbridas e de combinação de modelos em previsões energéticas.</p><p>Finalmente, Mohamed et al. (2022) destacaram o uso eficaz das ANNs na previsão do consumo de energia renovável na União Europeia, com um coeficiente de correlação de 0,9953. Esse estudo reforça a capacidade das ANNs de lidar com variáveis complexas e fornecer previsões precisas em contextos de grande escala.</p><p>As aplicações de IA em energias renováveis não apenas melhoram a precisão das previsões de geração e consumo de energia, mas também contribuem para a otimização do gerenciamento de recursos, tornando os sistemas de energia mais eficientes e resilientes em sua aplicação na agricultura. As técnicas avançadas de aprendizado de máquina e redes neurais continuam a evoluir, prometendo ainda mais avanços e inovações no campo das energias renováveis.</p><p><em>Tabela 2 — Resumo dos Resultados</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*QzeM36LWFgHG4WzrDMjI3g.png" /><figcaption><em>Fonte: Os autores</em></figcaption></figure><h3>Conclusões e Perspectivas de Pesquisas Futuras</h3><p>A adoção de energias renováveis tem crescido globalmente, impulsionada pela necessidade de mitigar os impactos das mudanças climáticas e do aquecimento global. Além de representar um setor estratégico de pesquisa e desenvolvimento, essas fontes de energia oferecem soluções eficazes para as economias modernas, frente ao esgotamento dos recursos naturais e à urgência de proteger o meio ambiente.</p><p>No campo da agricultura, a aplicação de energias renováveis, como a hidrelétrica, a solar e a eólica, está transformando práticas produtivas, tornando-as mais sustentáveis e eficientes. Nesse contexto, a inteligência artificial também tem sido incorporada para otimizar o uso dessas energias, melhorando a gestão de recursos e contribuindo para uma agricultura mais limpa e resiliente.</p><p>A IA apresenta uma solução a ser integrada no nível microeconômico, minimizando os riscos associados à variabilidade das fontes renováveis por meio de análises preditivas, identificação de padrões, redução dos custos de armazenamento e melhoria da conectividade entre redes e usuários, o que resulta em maior estabilidade, confiabilidade e sustentabilidade das redes energéticas.</p><p>No entanto, a adoção dessas tecnologias ainda enfrenta desafios, como o custo inicial de implementação e a necessidade de infraestrutura adequada. Incentivos governamentais, políticas de apoio e investimentos em pesquisa e desenvolvimento são essenciais para superar essas barreiras e promover a adoção generalizada de energias renováveis e IA na agricultura.</p><h3>Referências</h3><ul><li>ALASSERY, F.; ALZAHRANI, A.; KHAN, A. I.; IRSHAD, K.; ISLAM, S. An artificial intelligence-based solar radiation prophesy model for green energy utilization in energy management system. <strong>Sustainable Energy Technologies and Assessments</strong>, v. 52, p. 102060, 2022. DOI: 10.1016/j.seta.2022.102060.</li><li>ALI, H.; MUTHUDOSS, P.; RAMALINGAM, M. et al. Machine Learning–Enabled NIR Spectroscopy. Part 2: Workflow for Selecting a Subset of Samples from Publicly Accessible Data. <strong>AAPS PharmSciTech</strong>, v. 24, p. 34, 2023. DOI: 10.1208/s12249–022–02493–5.</li><li>ALLOGHANI, M.; AL-JUMEILY, D.; MUSTAFINA, J.; HUSSAIN, A.; ALJAAF, A. J. A Systematic Review on Supervised and Unsupervised Machine Learning Algorithms for Data Science. In: <strong>Supervised and Unsupervised Learning for Data Science</strong>. Berlin/Heidelberg: Springer, 2020.</li><li>AURANGZEB, K.; ASLAM, S.; HAIDER, S. I.; MOHSIN, S. M.; ISLAM, S. u.; KHATTAK, H. A.; SHAH, S. Energy forecasting using multiheaded convolutional neural networks in efficient renewable energy resources equipped with energy storage system. <strong>International Transactions on Electrical Energy Systems</strong>, 2019. DOI: 10.1002/ett.3837.</li><li>BARUA, Smita; BAJPAI, Prabodh. Power management of hybrid energy storage system in a standalone DC microgrid. <strong>Journal of Energy Storage</strong>, [s.l.], v. 30, p. 101523, 2020.</li><li>DEHGHANI, M.; RIAHI-MADVAR, H.; HOOSHYARIPOR, F.; MOSAVI, A.; SHAMSHIRBAND, S.; ZAVADSKAS, E. K.; CHAU, K. W. Prediction of hydropower generation using grey wolf optimization adaptive neuro-fuzzy inference system. <strong>Energies</strong>, v. 12, p. 289, 2019.</li><li>ENTEZARI, A.; ESAN, O. C.; YAN, X.; WANG, R.; AN, L. Sorption-Based Atmospheric Water Harvesting: Materials, Components, Systems, and Applications. <strong>Advanced Materials</strong>, v. 35, n. 9, p. 2100957, 2023. DOI: 10.1002/adma.202210957.</li><li>FARITHA BANU, J.; ATUL MAHAJAN, R.; SAKTHI, U.; KUMAR NASSA, V.; LAKSHMI, D.; NADANAKUMAR, V. Artificial intelligence with attention-based BiLSTM for energy storage system in hybrid renewable energy sources. <strong>Sustainable Energy Technologies and Assessments</strong>, v. 52, p. 102334, 2022.</li><li>GHIMIRE, et al. The Impacts of Agricultural Trade on Economic Growth and Environmental Pollution: Evidence from Bangladesh Using ARDL in the Presence of Structural Breaks. <strong>Sustainability</strong>, v. 13, p. 8336, 2021. DOI: 10.3390/su13158336.</li><li>HANOON, M. S.; AHMED, A. N.; RAZZAQ, A.; OUDAH, A. Y.; ALKHAYYAT, A.; HUANG, Y. F.; KUMAR, P.; EL-SHAFIE, A. Prediction of hydropower generation via machine learning algorithms at Three Gorges Dam, China. <strong>Ain Shams Engineering Journal</strong>, 2022. Disponível em: <a href="https://doi.org/10.1016/j.asej.2022.101919">https://doi.org/10.1016/j.asej.2022.101919</a>.</li><li>HARROU, F.; KADRI, F.; SUN, Y. Forecasting of Photovoltaic Solar Power Production Using LSTM Approach. In: <strong>Title of the Book</strong>. IntechOpen, 2023.</li><li>KARUNAKARAN, Deepak; BALAKRISHNAN, M. Prediction of Fish Yields in Lakes and Reservoirs from Simple Empirical Models using Artificial Neural Network (ANN): A Review. 2019. DOI: 10.32628/cseit195110. Disponível em: <a href="https://dx.doi.org/10.32628/cseit195110">https://dx.doi.org/10.32628/cseit195110</a>. Acesso em: 7 jun. 2024.</li><li>MOHAMED ELMI, A.; SELAM, A. A.; ATALAY, A. K. Prediction of renewable energy consumption of European Union using artificial neural networks. <strong>Black Sea</strong>, 2022.</li><li>SAYAH, Z.; KAZAR, O.; LEJDEL, B.; LAOUID, A.; GHENABZIA, A. An intelligent system for energy management in smart cities based on big data and ontology. <strong>Smart and Sustainable Built Environment</strong>, 2020.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdb9d1c47e15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Repetition: How to Transform Complex Operational Processes into Executable Efficiency]]></title>
            <link>https://medium.com/@oseiasmagalhaes/beyond-repetition-how-to-transform-complex-operational-processes-into-executable-efficiency-1b424b447db7?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b424b447db7</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[rpa-solutions]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 11:03:39 GMT</pubDate>
            <atom:updated>2026-07-29T11:03:39.959Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPRZ5KvU16MGEXIUdT7DMA.png" /><figcaption>Advanced Automation Engineering</figcaption></figure><p>Operational complexity is not an obstacle for technology; it is the fuel for true automation engineering.</p><p>Automating repetitive workflows with traditional bots no longer meets the high-scale demands of the modern corporate market. Today, the challenge demands robust backend architectures capable of orchestrating microservices in multicloud environments, integrating state-of-the-art language models for semantic analysis and document processing, and ensuring resilience in end-to-end critical routines.</p><p>The turning point in high-impact process automation and RPA projects relies on three non-negotiable pillars:</p><p>🔹 <strong>Resilient Backend Architecture:</strong> Well-designed microservices structures and data governance to ensure stability, security, and high availability under massive load.</p><p>🔹 <strong>Cognitive and Scalable RPAs:</strong> Solutions that go far beyond traditional <em>scraping</em>, incorporating artificial intelligence and computer vision to handle unstructured data and autonomous decision-making.</p><p>🔹 <strong>Focus on ROI and Efficiency:</strong> Developing technology that absorbs operational complexity to unleash the strategic and human potential of teams.</p><p>Technology must be the engine that transforms bottlenecks into measurable competitive advantage, perfectly adapting to the specific requirements of each business ecosystem.</p><p>How have you been structuring complex process automation and AI integration in your project backends? Let’s exchange ideas in the comments! 👇</p><p>#RPA #ProcessAutomation #Backend #ArtificialIntelligence #SoftwareArchitecture #TechLeadership #CloudComputing</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b424b447db7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Synth Studio: Building a Browser-Based DAW for Real-Time Sound Design]]></title>
            <link>https://medium.com/@oseiasmagalhaes/synth-studio-building-a-browser-based-daw-for-real-time-sound-design-2f35f98c4eb2?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f35f98c4eb2</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[framer-motion]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[synthesizers]]></category>
            <category><![CDATA[tonejs]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 00:34:36 GMT</pubDate>
            <atom:updated>2026-07-22T00:34:36.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6hkyF-XZHviY8MxJPCNYA.png" /><figcaption>Home — Synth Studio</figcaption></figure><p>Creating a Digital Audio Workstation (DAW) natively in the browser is a unique challenge that bridges the gap between complex audio processing and modern web development. <strong>Synth Studio</strong> is a web-based DAW designed for real-time performance, advanced sound design, and musical exploration — bringing the tactile feel of hardware synthesizers right into your browser.</p><p>🔗 <strong>Live Demo:</strong> <a href="https://synth-studio-xi.vercel.app/">Synth Studio (Vercel)</a></p><p>💻 <strong>Source Code:</strong> <a href="https://github.com/osmagal/Yamaha-PSR-Synth-Studio">GitHub Repository</a></p><h3>🚀 Architecture &amp; Implementation</h3><p>Building a reliable audio application requires a strong focus on high performance and sonic fidelity. This project leverages modern audio APIs and a robust frontend stack to ensure zero-latency interactions and high-quality sound generation.</p><h3>🎼 The Audio Engine (Core)</h3><p>At the heart of the application is the SynthEngine class, built entirely on top of the powerful <strong>Tone.js</strong> library.</p><ul><li><strong>Synthesis Engines:</strong></li><li><strong>Subtractive (PolySynth):</strong> Utilizes traditional oscillators (sawtooth, square, pulse) combined with high-order filtering for classic analog sounds.</li><li><strong>FM (Frequency Modulation):</strong> A polyphonic FM synthesizer perfect for crafting metallic, bell-like, and electric timbres.</li><li><strong>AM (Amplitude Modulation):</strong> Ideal for designing evolving atmospheric pads and organic textures.</li><li><strong>Sampler:</strong> A high-quality sampling engine loaded with the legendary Salamander grand piano and electronic drum kits.</li><li><strong>Dynamic Signal Chain:</strong> The audio routing is carefully designed to mimic physical studio gear: Source ➔ Distortion ➔ Chorus ➔ Feedback Delay ➔ Reverb ➔ 24dB/oct Lowpass Filter ➔ Master Volume</li><li><strong>Modulation &amp; Shaping:</strong> Includes a Modulation Matrix with LFOs for expressive vibrato and movement, alongside a dedicated ADSR Filter Envelope that dynamically modulates the cutoff frequency.</li></ul><h3>💻 Frontend &amp; UI/UX</h3><p>To ensure the interface feels as responsive as the audio engine sounds, the frontend was engineered with strict typing and fluid animations.</p><ul><li><strong>React 18 + TypeScript:</strong> Strict typing across the entire application guarantees stability in the complex audio data flow.</li><li><strong>Tailwind CSS:</strong> Features a modern, high-contrast “dark theme” heavily inspired by classic analog studio hardware.</li><li><strong>Framer Motion:</strong> Delivers fluid animations for interface transitions, visual feedback, and component state changes.</li></ul><p><strong>Custom Studio Components:</strong></p><ul><li><strong>Precision Knobs:</strong> Virtual rotary controls engineered to support mouse dragging and mobile touch gestures flawlessly.</li><li><strong>Visual Envelope Editor:</strong> An interactive SVG-based editor that allows users to visually sculpt their ADSR sound curves.</li><li><strong>Real-Time Oscilloscope:</strong> A dynamic waveform visualizer that processes raw audio data using Tone.Analyser.</li></ul><h3>🎹 Connectivity &amp; Performance</h3><p>Synth Studio isn’t just a toy; it’s built to integrate with real musical workflows.</p><ul><li><strong>Web MIDI API:</strong> Features native integration with external USB MIDI controllers. It fully supports Note On/Off, Pitch Bend, and Modulation Wheel messages.</li><li><strong>Programmable Arpeggiator:</strong> Synced perfectly with the internal clock, allowing for dynamic patterns (Up, Down, Random) with various rhythmic subdivisions.</li><li><strong>Professional Metronome:</strong> Includes precise BPM control and downbeat detection for accurate recording and performance.</li><li><strong>Local Persistence:</strong> A custom preset system saved via localStorage enables users to design, save, and instantly recall their own sound patches.</li></ul><h3>📱 Responsive Design</h3><p>Hardware synths are bulky, but Synth Studio goes wherever you go. The application is deeply optimized for both desktop and mobile devices:</p><ul><li>An adaptive grid layout intelligently reorganizes the control racks based on screen real estate.</li><li>The Preset Browser (sidebar) is fully collapsible on mobile to maximize the primary control area.</li><li>Touch Events are heavily optimized, particularly for the visual editors and rotary knobs, ensuring a tactile experience on tablets and smartphones.</li></ul><h3>🛠️ The Tech Stack</h3><ul><li><strong>Frontend:</strong> React, TypeScript, Vite</li><li><strong>Audio Processing:</strong> Tone.js</li><li><strong>Styling &amp; UI:</strong> Tailwind CSS, Framer Motion, Lucide React</li></ul><p><em>Synth Studio was developed with a single goal in mind: to bring the authentic, tactile experience of a hardware synthesizer into the modern web environment. Try it out, plug in your MIDI keyboard, and start creating!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f35f98c4eb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Building an Intelligent RAG Assistant: A Full-Stack Corporate Simulator]]></title>
            <link>https://medium.com/@oseiasmagalhaes/building-an-intelligent-rag-assistant-a-full-stack-corporate-simulator-b2a228a04447?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2a228a04447</guid>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 02:08:21 GMT</pubDate>
            <atom:updated>2026-07-21T02:08:21.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRTrTfhLeiJKcKS_NhUsLA.png" /><figcaption>Home — RAG Engine</figcaption></figure><p>This project is a full-stack Retrieval-Augmented Generation (RAG) system designed to simulate a smart corporate environment. It seamlessly consolidates static knowledge bases (such as Refund Policies, Contract Rules, and FAQs) with a dynamic database of partner companies’ contacts and locations hosted on Firebase Firestore. The result? Real-time, intelligent queries powered by AI.</p><p>🔗 <strong>Live Demo:</strong> <a href="https://rag-engine-project.vercel.app/">Official Access (Vercel)</a></p><p>💻 <strong>Source Code:</strong> <a href="https://github.com/osmagal/RAG-Engine">GitHub Repository</a></p><h3>🏗️ Project Architecture</h3><p>The project is structured following a unified full-stack pattern (React SPA Frontend + API Backend), highly optimized for both local development and seamless serverless deployment on Vercel.</p><p>Plaintext</p><pre>├── api/<br>│   └── index.ts               # Entry point for Vercel Serverless Functions<br>├── assets/                    # Auxiliary files and metadata<br>├── src/<br>│   ├── components/            # Modular React visual components<br>│   ├── documents/             # Knowledge base documents (Policies, Contracts, FAQs)<br>│   ├── App.tsx                # Main SPA interface and global state management<br>│   ├── index.css              # Global styles and Tailwind CSS utilities<br>│   └── main.tsx               # React initialization<br>├── server.ts                  # Express server with API routes, RAG logic, and integrations<br>├── vercel.json                # Routing and build configuration for Vercel<br>├── favicon.svg                # Modern vectorized favicon<br>└── package.json               # Script and dependency management</pre><h3>🛠️ Technology Stack &amp; Layers</h3><h3>1. Frontend (React SPA + Vite)</h3><ul><li><strong>Vite:</strong> Ensures ultra-fast frontend compilation and hot module replacement.</li><li><strong>Tailwind CSS:</strong> Modern utility-first styling for a high-fidelity visual design. It includes full responsive support and a premium dark theme (Slate/Indigo).</li><li><strong>Framer Motion:</strong> Used to create fluid micro-interactions, filter transitions, and visual feedback for list rendering.</li><li><strong>Lucide React:</strong> A clean, modern icon library used to indicate states, phone numbers, locations, and search filters.</li></ul><h3>2. Backend (Express.js + Node.js)</h3><p>The server.ts file exposes a robust REST API handling local knowledge base management and external interactions:</p><ul><li>POST /ask: Receives user queries, compiles relevant static documents alongside filtered Firebase contact context, securely formats the system guidelines, and invokes the Gemini API.</li><li>GET /api/contacts: Returns a paginated and filtered list of companies and leads, applying dynamic rules and quota protection.</li><li>GET /api/documents: Fetches the text documents that form the basic scope of the corporate knowledge base.</li><li>GET /api/firebase-status: Monitors communication health with Firestore, detecting potential failures or Spark plan quota limits.</li></ul><h3>3. Database (Firebase Firestore)</h3><p>Integrated efficiently using @firebase/firestore/lite on the backend for maximum speed in serverless environments.</p><ul><li><strong>Anti-Quota-Exceeded Strategy:</strong> Smart calls split the filtering process. Specific segments are filtered at the Firestore query level to reduce read operations, while secondary filters (Area Code, State, Country) are refined in-memory. This guarantees data persistence without violating the daily read limits of the free (Spark) tier.</li><li><strong>Fault Resilience:</strong> In the event of network errors or exhausted Firebase read quotas, the system transparently catches the exception and provides appropriate status messages without crashing the application.</li></ul><h3>4. Artificial Intelligence (Gemini API with Smart Fallback)</h3><p>Developed using the latest official @google/genai SDK.</p><ul><li><strong>Strict RAG Processing:</strong> The model is systematically instructed (with a low temperature of 0.1) to respond <em>strictly</em> based on the corporate documents provided in the prompt, entirely preventing hallucinations.</li><li><strong>Model Orchestration:</strong> Implements a resilient Fallback Chain. This guarantees high AI availability by attempting to process the query sequentially through multiple models if one fails:</li><li>gemini-3.5-flash (Default)</li><li>gemini-3.1-pro-preview</li><li>gemini-flash-latest</li><li>gemini-3.1-flash-lite</li><li>gemini-2.5-pro</li><li>gemini-2.5-flash</li></ul><h3>⚡ Serverless Hosting on Vercel</h3><p>To ensure the Express backend and React frontend work harmoniously on Vercel’s cloud without needing a 24/7 Virtual Machine, the following infrastructure was designed:</p><ul><li><strong>Route Mapping (</strong><strong>vercel.json):</strong> Any request starting with /api/* or /ask is redirected to /api/index.ts. Express&#39;s internal routing processes these routes and returns standard JSON responses. All other static routes resolve to /index.html (the native behavior for a React SPA).</li><li><strong>Dynamic File Inclusion:</strong> The vercel.json configuration file declares &quot;includeFiles&quot;: &quot;src/documents/**&quot; to ensure that business rule files (FAQs, Cancellation policies, etc.) are properly packaged and readable on disk within the serverless function at runtime.</li></ul><h3>⚙️ How to Run Locally</h3><p>To run the project locally or deploy it to Vercel, simply fill in your environment variables in the .env file based on .env.example:</p><p>Snippet de código</p><pre># Google Gemini API Key for processing RAG requests<br>GEMINI_API_KEY=your_gemini_api_key_here</pre><pre># Firebase Client Authentication Keys<br>FB_API_KEY=your_firebase_api_key_here<br>FB_APP_ID=your_firebase_app_id_here<br>FB_AUTH_DOMAIN=your_firebase_auth_domain_here<br>FB_DATABASE_URL=your_firebase_database_url_here<br>FB_PROJECT_ID=your_firebase_project_id_here<br>FB_STORAGE_BUCKET=your_firebase_storage_bucket_here<br>FB_MSG_SENDER=your_firebase_msg_sender_here<br>FB_MEASUREMENT_ID=your_firebase_measurement_here</pre><p><strong>Get started in seconds:</strong></p><ul><li>Install dependencies:</li><li>npm install</li><li>Start the development server (which concurrently starts the Express backend and serves the frontend):</li><li>npm run dev</li><li>Access the application at</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2a228a04447" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building OminiExtract: Intelligent Data Extraction with Generative AI]]></title>
            <link>https://medium.com/@oseiasmagalhaes/cons-truindo-o-ominiextract-extra%C3%A7%C3%A3o-inteligente-de-dados-com-ia-generativa-122f73e4b9b9?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/122f73e4b9b9</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[classified-documents]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 17:14:19 GMT</pubDate>
            <atom:updated>2026-07-20T17:17:46.406Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*il_aL1TPO8Bm9oIRjd1QdQ.png" /><figcaption>Home — OminiExtract</figcaption></figure><p>Dealing with document data extraction can be a complex challenge, especially when formats vary and information is unstructured. That’s exactly why <a href="https://omini-extract.vercel.app/"><strong>OminiExtract</strong></a> was born: an advanced intelligent data processing and extraction platform, powered by next-generation generative models.</p><p>In this article, I’ll share a bit about the architecture and technical decisions behind this application, which was designed not only to be efficient but also <strong>highly resilient</strong> — operating seamlessly in both cloud-connected environments and restricted local modes.</p><p>If you want to take a closer look at the code, the repository is available on <a href="https://github.com/osmagal/Omini-Extract"><strong>GitHub</strong></a>.</p><h3>🏗️ A Resilient Full-Stack Architecture</h3><p>The application follows a traditional and robust Full-Stack model (Vite + Express), with a very clear separation of concerns between the client and the server.</p><h3>1. The Frontend: Focus on Experience (React + Tailwind CSS)</h3><p>The client was built as a reactive Single Page Application (SPA). The main focus here is user experience and real-time feedback.</p><ul><li><strong>Reactive Interface:</strong> Built with React and modular components.</li><li><strong>Continuous Feedback:</strong> We implemented a smart polling system for real-time monitoring of the extraction status.</li><li><strong>State and Styling:</strong> We used custom hooks to manage jobs and sessions, all wrapped in a clean and responsive design provided by Tailwind CSS and Lucide React icons.</li></ul><h3>2. The Backend: Orchestration and AI Abstraction (Node.js + Express)</h3><p>The server acts as the brain of the operation. It manages the lifecycle of the received documents, performs conversions when necessary, and communicates with the Artificial Intelligence APIs. The backend’s highlight is our <strong>Fallback Engine</strong>: a proprietary in-memory cache system that ensures the application continues to run smoothly even if the connection to the remote database fails.</p><h3>3. Hybrid Persistence: The Best of Both Worlds</h3><p>To ensure high availability, the data architecture uses a hybrid approach with bidirectional synchronization:</p><ul><li><strong>Cloud:</strong> We use Firebase Firestore for long-term persistence and synchronization across multiple devices.</li><li><strong>Local:</strong> Through an <em>In-Memory Database</em> based on a Map on the server, the application can be started instantly in development environments or without cloud infrastructure. The server tries to persist to Firebase by default but gracefully reverts to the local state if it encounters network errors.</li></ul><blockquote><em>📐 </em>For the more visual readers, the complete system modeling and data flows are documented on our <a href="https://miro.com/"><strong>Miro Board — OminiExtract</strong></a> (illustrative link).</blockquote><h3>🧠 The Intelligence Behind It: Gemini 1.5 Flash</h3><p>The true “core” of the application is powered by the Google Generative AI SDK, specifically using the <strong>Gemini 1.5 Flash</strong> model.</p><p>For the extraction to be precise, we invested heavily in <strong>Prompt Engineering</strong>, passing structured instructions that force the AI to return data in standardized JSON formats, making parsing easier on the frontend.</p><p>Furthermore, we thought about the end-to-end experience:</p><ul><li><strong>Quota Resilience:</strong> If the API hits usage limits (RESOURCE_EXHAUSTED), the system handles it elegantly, returning friendly messages and guiding the user.</li><li><strong>Reprocessing:</strong> We created dedicated logic that allows the user to try extracting the data again with different parameters if the initial result isn’t what they expected.</li></ul><h3>🔒 Security and Isolation</h3><p>Building with AI requires care regarding data and infrastructure. Therefore, we implemented:</p><ul><li><strong>Anonymous Authentication:</strong> Using Firebase Auth, we ensure that each user has their own data context and isolation (acessoId), even without needing to go through a formal login flow.</li><li><strong>Error Sanitization:</strong> Any backend error is strictly filtered before reaching the client, preventing the leakage of stack traces or sensitive information.</li></ul><p>OminiExtract is an excellent example of how we can combine the raw power of Generative Artificial Intelligence with good software engineering practices to create resilient, scalable, and useful tools for everyday use.</p><p>🚀 <strong>Want to test it in practice?</strong> Access the application in production: <a href="https://omini-extract.vercel.app/"><strong>OminiExtract Vercel</strong></a></p><p>Leave a comment on what you thought of the architecture or if you have any questions about the integration with Gemini!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=122f73e4b9b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Projeto Receita WS + Click Sistema]]></title>
            <link>https://medium.com/@oseiasmagalhaes/projeto-receita-ws-click-sistema-b902e32c4e97?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b902e32c4e97</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[prospects]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 00:58:05 GMT</pubDate>
            <atom:updated>2024-04-19T01:01:44.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Um notebook mostrando um código na tela." src="https://cdn-images-1.medium.com/max/1024/0*ekXIosiHfy3B6m7V" /></figure><p>Eu, <a href="http://oseiasmagalhaes.com.br/"><strong>Oséias Magalhães</strong></a>, criei este projeto com o objetivo de criar uma base de dados a partir de CNPJs, utilizando duas APIs gratuitas e com dados públicos para criação de listas de prospecção.</p><p>Utilizando dados de CNPJ disponibilizados pelo <a href="https://www.portaltransparencia.gov.br/download-de-dados/favorecidos-pj"><strong>Portal Transparência para os favorecidos em 2021</strong></a> no link.</p><p>Essa lista conta com 912.476 de CNPJs. <a href="https://drive.google.com/drive/folders/1UIr-3_N7zwMKbqZCLCGBQrrCbpW88X7A?usp=sharing"><strong>Download.</strong></a></p><p>Em suma, esta lista servirá apenas para a utilização dos CNPJs como base para a busca dos dados mais importantes, os de contato, como Email e Telefone, utilizando as APIs, para enriquecer ainda mais esta lista.</p><p>Este trabalho propõe solução simples mas muito eficiente, utilizando AppScript no Google Planilhas.</p><p><a href="https://github.com/oseias-silva-magalhaes-1990/projeto-receitaws-clicksistema/blob/main/appsScript.js"><strong>Este código está público em meu GitHub.</strong></a></p><h3>Apps Script</h3><p>O Google Apps Script é uma plataforma de desenvolvimento rápido de aplicativos que facilita e agiliza a criação de aplicativos de negócios que se integram ao Google Workspace. Você escreve código em JavaScript moderno e tem acesso a bibliotecas integradas para aplicativos favoritos do Google Workspace, como Gmail, Agenda, Drive e muito mais. Não há nada para instalar — nós fornecemos a você um editor de código diretamente no seu navegador e seus scripts são executados nos servidores do Google.</p><p><a href="https://developers.google.com/apps-script/overview"><strong>Saiba mais.</strong></a></p><h3>Planilhas Google</h3><p>O Planilhas foi criado para atender às necessidades das organizações que precisam de agilidade. Com os recursos de inteligência artificial, você acessa os insights certos para tomar decisões empresariais importantes. A arquitetura baseada na nuvem permite que você colabore com quem quiser, a qualquer hora e em qualquer lugar. A compatibilidade com sistemas externos, inclusive o Microsoft Office, simplifica o trabalho com várias origens de dados. E como o Planilhas é integrado à infraestrutura do Google, você tem toda a liberdade para criar sem comprometer a segurança das suas informações.</p><h3>Receita WS</h3><p>Para entender como o sistema funciona, é necessário entender seus componentes. O sistema é composto pelos seguintes componentes:</p><ul><li>Um banco de dados;</li><li>Uma fila;</li><li>Processos que recuperam informações da Receita Federal;</li></ul><p>Ao realizar a consulta de um CNPJ através da API <a href="https://receitaws.com.br/faq"><strong>Receita WS</strong></a>, este é primeiro verificado se este existe no banco de dados. Em caso positivo, estes dados são retornados. Em caso negativo, a requisição é encaminhada para uma fila de onde alguns processos recuperam sua requisição e realizam a consulta no site da Receita Federal. Assim que a consulta é realizada com sucesso os dados são atualizados no banco de dados local e sua requisição é respondida.</p><h3>Click Sistema</h3><p>Numa iniciativa própria a API CNPJ lançou o <a href="https://clicksistema.com.br/"><strong>Click Sistema</strong></a>. Com ela a base de dados disponibilizada pelo governo é apresentada num formato mais adequado para consultas e programadores. A base é automaticamente atualizada a cada 4 meses e o resultado pode ser retornado graficamente na web ou no formato JSON, mais adequado para ser trabalhado no server side.</p><h3>Aplicação</h3><p>Embora a lista de favorecidos forneça dados recentes, neste projeto preferi realizar uma busca ainda mais atual, mesmo com um custo computacional maior. Para isto foquei em basear-se apenas pelo CNPJ e considerar apenas o que para este projeto fosse de maior importância para o preenchimento e enriquecimento desta lista.</p><h3>Definições Iniciais do código</h3><pre>var app = SpreadsheetApp;//Esta classe é a classe pai do serviço Spreadsheet <br>  var sheet = app.getActiveSheet();//Obtém a planilha ativa em uma planilha.<br>  var url_receita = &quot;https://www.receitaws.com.br/v1/cnpj/&quot;;//URL Receita WS<br>  var url_click = &quot;https://clicksistema.com.br/cnpj.json?cnpj=&quot;;//URL Click Sistema<br>  var linha = 2;//Linha para preenchimento inicial<br>  var cnpjVar;//Variável para o recebimento do CNPJ listado</pre><h3>Função buscaDados()</h3><p>Este é o coração desta aplicação pois é ela quem faz o controle do laço e das posições das linhas a serem preenchidas. Para a referência e controle da última linha preenchida utilizou-se a célula Q1, ou seja a Linha 1 e Coluna 17.</p><pre>function buscaDados(){<br>  //listarCnpjs(); //Chama gerador de cnpj aleatório<br>  <br>  <br>  //Realiza o controle das Linhas<br>  sheet.getRange(1,16).setValue(&quot;Linha&quot;);  <br>  if(sheet.getRange(1,17).getValue() != &quot;&quot;){<br>    linha = parseInt(sheet.getRange(1,17).getValue());<br>    sheet.getRange(1,17).setValue(linha);<br>  }else{<br>    sheet.getRange(1,17).setValue(linha);<br>  }<br>  <br>  //Aplica o Cabeçalho da Tabela<br>  aplicarHeaders();<br>  <br>  //Realiza a busca e chama a função de preenchimento relacionada<br>  while(cont &lt;= 30 &amp;&amp; linha &lt; 110557){<br>    <br>    cnpjVar = sheet.getRange(linha,1).getValue();<br>    <br>    //1º Tentativa API Receita WS<br>    var json1 = buscarObjJson(url_receita + cnpjVar);<br>    <br>    Logger.log(&quot;Pri Tentativa&quot;);<br>    Logger.log(url_receita + cnpjVar);<br><br>    if(json1 != 0){<br>      aplicarValoresReceita(json1, linha);<br>      linha++;<br>    }else{<br>      <br>      //2º Tentativa API ClickSistema<br>      var json2 = buscarObjJson(url_click + cnpjVar + &quot;&amp;nome=&quot;)[0];<br>     <br>      Logger.log(&quot;Seg Tentativa&quot;);<br>      Logger.log(url_click + cnpjVar + &quot;&amp;nome=&quot;);<br>      <br>      if(json2 != null){<br>        aplicarValoresClick(json2, linha);<br>        linha++;<br>      }<br>      <br>      if(json1 == 0 &amp;&amp; json2 == null){<br>        cont++;<br>        Logger.log(cont);<br>      }<br>      <br>      if(cont == 29){<br>        sheet.deleteRow(linha);<br>        cont=0;<br>      }<br>      <br>    }<br>    <br>    sheet.getRange(1,17).setValue(linha);<br>    <br>  }<br>  <br>}</pre><h3>Função de Busca para Objeto JSON buscarObjJson()</h3><p>Passa-se a url que se deseja buscar e obtém-se o retorno desejado para tratamento posterior</p><pre>function buscarObjJson(url){<br>  try{<br>    var res = UrlFetchApp.fetch(url);<br>    var content = res.getContentText();<br>    var json = JSON.parse(content);<br>    Logger.log(json);<br>    return json;<br>  }<br>  catch(err){<br>    return &quot;Erro&quot;;<br>  }<br>}</pre><h3>Definição de Cabeçalho aplicarHeaders()</h3><p>Abaixo segue função para definição de cabeçalho com seus respectivos dados para cada coluna:</p><pre>//Definição de Cabeçalho<br>function aplicarHeaders(){<br>  sheet.getRange(1, 1).setValue(&quot;Lista cnpj&quot;);//Lista de CNPJ oriunda da lista de Favorecidos<br>  sheet.getRange(1, 2).setValue(&quot;cnpj&quot;);<br>  sheet.getRange(1, 3).setValue(&quot;tipo&quot;);<br>  sheet.getRange(1, 4).setValue(&quot;abertura&quot;);<br>  sheet.getRange(1, 5).setValue(&quot;nome&quot;);<br>  sheet.getRange(1, 6).setValue(&quot;fantasia&quot;);<br>  sheet.getRange(1,7).setValue(&quot;atividade_principal&quot;);<br>  sheet.getRange(1, 8).setValue(&quot;bairro&quot;);<br>  sheet.getRange(1, 9).setValue(&quot;municipio&quot;);<br>  sheet.getRange(1, 10).setValue(&quot;uf&quot;);<br>  sheet.getRange(1, 11).setValue(&quot;email&quot;);//Ojetivo de maior interesse ausente na lista de favorecidos<br>  sheet.getRange(1, 12).setValue(&quot;telefone&quot;);//Ojetivo de maior interesse ausente na lista de favorecidos<br>  sheet.getRange(1, 13).setValue(&quot;situacao&quot;);<br>  sheet.getRange(1, 14).setValue(&quot;capital_social&quot;);<br>  sheet.getRange(1, 15).setValue(&quot;cep&quot;);<br>}</pre><h3>Aplicando Dados na Planilha</h3><p>Abaixo tem-se a aplicação dos dados encontrados utilizando um laço para o preenchimento das colunas com seus respectivos dados organizados através de um switch case. Para cada API preferi utilizar duas funções distintas já que alguns dados de retorno são representados ou formatados de forma diferente necessitando um tratamento para formatação dos mesmos.</p><pre>//Aplicar valores na planilha - Receita<br>function aplicarValoresReceita(json, linha){<br>  var app = SpreadsheetApp;<br>  var sheet = app.getActiveSheet();<br><br>    for(var col=2; col &lt;= 15; col++){<br>      switch(col){<br>        case 2:<br>          sheet.getRange(linha, col).setValue(json.cnpj);<br>          break;<br>        case 3:<br>          sheet.getRange(linha, col).setValue(json.tipo);<br>          break;<br>        case 4:<br>          sheet.getRange(linha, col).setValue(json.abertura);<br>          break;<br>        case 5:<br>          sheet.getRange(linha, col).setValue(json.nome);<br>          break;<br>        case 6:<br>          sheet.getRange(linha, col).setValue(json.fantasia);<br>          break;<br>        case 7:<br>          sheet.getRange(linha, col).setValue(json.atividade_principal[0].text);<br>          break;<br>        case 8:<br>          sheet.getRange(linha, col).setValue(json.bairro);<br>          break;<br>        case 9:<br>          sheet.getRange(linha, col).setValue(json.municipio);<br>          break;<br>        case 10:<br>          sheet.getRange(linha, col).setValue(json.uf);<br>          break;<br>        case 11:<br>          sheet.getRange(linha, col).setValue(json.email.toLowerCase());<br>          break;<br>        case 12:<br>          sheet.getRange(linha, col).setValue(formataTel(json.telefone));<br>          break;<br>        case 13:<br>          sheet.getRange(linha, col).setValue(json.situacao);<br>          break;<br>        case 14:<br>          sheet.getRange(linha, col).setValue(json.capital_social);<br>          break;<br>        case 15:<br>          sheet.getRange(linha, col).setValue(json.cep);<br>          break;<br>      }<br>    }<br>}<br><br>//Aplicar valores na planilha - Click<br>function aplicarValoresClick(json, linha){<br>  var app = SpreadsheetApp;<br>  var sheet = app.getActiveSheet();<br><br>    for(var col=2; col &lt;= 15; col++){<br>      switch(col){<br>        case 2:<br>          sheet.getRange(linha, col).setValue(trataCnpj(json.cnpj));<br>          break;<br>        case 3:<br>          sheet.getRange(linha, col).setValue(verificaMatriz(json.matriz));<br>          break;<br>        case 4:<br>          sheet.getRange(linha, col).setValue(formatarInicio(json.inicio));<br>          break;<br>        case 5:<br>          sheet.getRange(linha, col).setValue(json.razao_social);<br>          break;<br>        case 6:<br>          sheet.getRange(linha, col).setValue(json.fantasia);<br>          break;<br>        case 7:<br>          sheet.getRange(linha, col).setValue(json.cnae_fiscal);<br>          break;<br>        case 8:<br>          sheet.getRange(linha, col).setValue(json.bairro);<br>          break;<br>        case 9:<br>          sheet.getRange(linha, col).setValue(json.municipio);<br>          break;<br>        case 10:<br>          sheet.getRange(linha, col).setValue(json.uf);<br>          break;<br>        case 11:<br>          sheet.getRange(linha, col).setValue(json.email.toLowerCase());<br>          break;<br>        case 12:<br>          sheet.getRange(linha, col).setValue(formataTel(json.telefone_1));<br>          break;<br>        case 13:<br>          sheet.getRange(linha, col).setValue(&quot;ATIVA&quot;);<br>          break;<br>        case 14:<br>          sheet.getRange(linha, col).setValue(json.capital_social);<br>          break;<br>        case 15:<br>          sheet.getRange(linha, col).setValue(formataCep(json.cep));<br>          break;<br>      }<br>    }<br>}<br><br>function trataCnpj(cnpj){<br>  return cnpj.substring(0,2) +&quot;.&quot;+cnpj.substring(2,5) +&quot;.&quot;+ cnpj.substring(5,8)+&quot;/&quot;+ cnpj.substring(8,12)+&quot;-&quot; + cnpj.substring(12,14);<br>}<br><br>function formataTel(val){<br>  val = val.replace(&quot; (&quot;,&quot;55-&quot;);<br>  val = val.replace(&quot;(&quot;,&quot;55-&quot;);<br>  val = val.replace(&quot;) &quot;,&quot;-&quot;);<br>  val = val.replace(&quot;  &quot;,&quot;-&quot;);<br>  val = val.replace(&quot;) &quot;,&quot;-&quot;);<br>  <br>  return val;<br>}<br><br>function verificaMatriz(val){<br>  if(val == &quot;1&quot;){<br>    return&quot;MATRIZ&quot;;<br>  }<br>  return &quot;FILIAL&quot;;<br>}<br><br>function formatarInicio(val){<br>  var abertura = val[8]+val[9]+&quot;/&quot;+val[5]+val[6]+&quot;/&quot;+val[0]+val[1]+val[2]+val[3];<br>  return abertura;<br>}//aaaa-mm-dd<br><br>function formataCep(val){<br>  return val.substring(0,2)+&quot;.&quot;+val.substring(2,5)+&quot;-&quot;+val.substring(5,8);<br>}</pre><h3>Siga os passos abaixo:</h3><p>1º Obtenha a lista de CNPJ que deseja buscar os dados<br>2º Cole-os na Planilha do Google<br>3º Dentro do Google Planilhas abra Extensões &gt; Apps Scrript, copie e cole o código<br>4º Dentro do Apps Script clique em Acionadores do projeto atual e defina<br>4.1 — Escolha a função que será executada: buscaDados<br>4.2 — Implantação a ser executada: Teste<br>4.3 — Selecione a origem do evento: Baseada no Tempo<br>4.4 — Selecione o tipo de acionador com base no tempo: Contador de minutos<br>4.5 — Selecione o intervalo de Minutos: 30 minutos</p><p>Pronto! Basta esperar e ver sua busca de dados sendo realizada.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b902e32c4e97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Professor-Braille]]></title>
            <link>https://medium.com/@oseiasmagalhaes/professor-braille-a223fc969505?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a223fc969505</guid>
            <category><![CDATA[braille]]></category>
            <category><![CDATA[tcc]]></category>
            <category><![CDATA[inclusion]]></category>
            <category><![CDATA[projetos]]></category>
            <category><![CDATA[prototyping]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 00:44:33 GMT</pubDate>
            <atom:updated>2024-04-19T00:44:33.151Z</atom:updated>
            <content:encoded><![CDATA[<p>Trabalho de Conclusão de Curso — Engenharia de Computação</p><figure><img alt="Protótipo Professor Braille — Trabalho de Conclusão de Curso" src="https://cdn-images-1.medium.com/max/960/0*AefeUWhXxmhFfOHn.jpg" /></figure><p>Este trabalho teve por objetivo desenvolver uma ferramenta prototípica que auxilia PDV‟s (Pessoas com Deficiência Visual) no aprendizado do código braile, utilizando conceitos computacionais, robóticos, mecânicos, matemáticos, eletrônicos, design e formas de comunicação.</p><p>O projeto recebeu o nome de Professor Braille e para tanto foram buscadas formas de desenvolver uma ferramenta que seja capaz de ensinar caracteres do código braile mais utilizados pelo usuário, possibilitando que em um menor espaço de tempo este indivíduo alcance um nível de alfabetização com capacidade de identificar os caracteres apresentados, sendo estes letras do alfabeto, números de 0 a 9 e alguns símbolos mais utilizados na escrita.</p><p>Todas as técnicas foram baseadas em padrões nacionais e internacionais de utilização do código braile, e por meio de um firmware embarcado em um <a href="https://www.espressif.com/en/products/socs/esp8266"><strong>microcontrolador ESP8266</strong></a>, trabalhando em conjunto com um sistema eletromagnético, mecânico e componentes responsáveis pelo controle do circuito responsável, com isto foi possível a construção de uma célula braile.</p><p>O Professor Braille envia e recebe comandos por meio de comunicação de rede Wi-Fi para um SmartPhone com sistema Android do usuário, e por meio de um aplicativo desenvolvido com a utilização da ferramenta App Inventor, é possível a interação entre dispositivo e usuário, permitindo a realização de perguntas e respostas, que serão armazenados os resultados de erros ou acertos no banco de dados <a href="https://firebase.google.com/docs"><strong>Firebase</strong></a>.</p><p><a href="http://oseiasmagalhaes.com.br/"><strong>Oséias Silva Chagas Magalhães</strong></a><br>Engenheiro de Computação, UEPG — Universidade Estadual de Ponta Grossa, Ponta Grossa-PR</p><p>Zito Palhano da Fonseca<br>Orientador</p><p><a href="https://revistatecie.crea-pr.org.br/index.php/revista/article/view/785"><strong>Acesse: TCC Publicado na Revista CREA na íntegra.</strong></a></p><p><a href="https://github.com/oseias-silva-magalhaes-1990/Professor-Braille"><strong>Acesse: Projeto aberto no GitHub.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a223fc969505" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Criando Listas de Prospecção .vcf no Console do Navegador]]></title>
            <link>https://medium.com/@oseiasmagalhaes/criando-listas-de-prospec%C3%A7%C3%A3o-vcf-no-console-do-navegador-15fa65f7b341?source=rss-e72262f1c85d------2</link>
            <guid isPermaLink="false">https://medium.com/p/15fa65f7b341</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[leads]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[vcf]]></category>
            <category><![CDATA[prospecção]]></category>
            <dc:creator><![CDATA[Oseias Magalhães]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 00:30:24 GMT</pubDate>
            <atom:updated>2024-04-19T00:30:24.546Z</atom:updated>
            <content:encoded><![CDATA[<h3>Criando Listas de Prospecção .vcf no Console do Navegador</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*j7DHd-vveSbMCiHFu_d9TQ.png" /></figure><p>Eu, <a href="http://oseiasmagalhaes.com.br/"><strong>Oséias Magalhães</strong></a>, preparei este guia detalhado que demonstra como automatizar a criação de listas de prospecção em um algoritmo simples e funcional para o formato .vcf, utilizando Javascript, Google Maps, diretamente no navegador Chrome.</p><p>O objetivo final deste projeto é utilizar o WhatsApp ou outros apps de conversa para acessar os contatos criados, agilizando o envio de mensagens.</p><h3>1. Extensão .vcf</h3><p>O formato .vcf (Virtual Card File) é um padrão aberto para armazenar informações de contato, como nome, telefone, endereço e site. É ideal para criar listas de prospecção, pois permite importar facilmente os contatos para diversos aplicativos, como agendas e softwares de CRM.</p><h3>2. Extração de dados usando Javascript:</h3><p>A extração de dados do Google Maps para este projeto contempla apenas nome e telefone de empresas no Google Maps. Usando um código javascript para automatizar um processo que seria manual, ao final da extração este código gera um arquivo .vcf e faz o download.</p><h3>3. Siga os seguintes passos:</h3><ol><li><a href="https://github.com/oseias-silva-magalhaes-1990/Criando-Lista-de-Prospec--o-.vcf-no-navegador-com-Javascript/blob/eae7354d23e9aa55b42d720ecf2fc2846fc6a2d0/extrair-vcf-gmaps.js"><strong>Copie o código no GitHub</strong></a></li><li>Acesse o site GMaps <a href="https://maps.google.com/"><strong>https://maps.google.com/</strong></a></li><li>Faça sua busca pressione F12</li><li>Clique em Console</li><li>Cole-o no Console do Navegador *</li><li>Mantenha a página aberta para que os dados possam ser baixados</li></ol><p>*Caso o console não permita a colagem do código digite “permitir colar”, tecle enter, em seguida cole o código.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aupcC7bgno5Rt2t21Lig9Q.png" /></figure><h3>4. Análise do Código</h3><p>Uma breve análise sobre o código.</p><h4><strong>4.1 const scrollInterval = setInterval(rolarScroll, 3000)</strong></h4><p>Esse código JavaScript inicializa com uma chamada rolarScroll que rola automaticamente o scroll de um contêiner específico. Vou explicar o que cada parte faz:</p><ol><li><strong>function rolarScroll() { … }</strong>: Define uma função chamada rolarScroll que será chamada repetidamente em intervalos regulares para rolar o scroll do contêiner.</li><li><strong>const container = document.querySelector(‘#QA0Szd…’)</strong>: Seleciona o contêiner específico no qual você deseja rolar o scroll. O seletor CSS usado (#QA0Szd &gt; div &gt; div &gt; div.w6VYqd &gt; div.bJzME.tTVLSc &gt; div &gt; div.e07Vkf.kA9KIf &gt; div &gt; div &gt; div.m6QErb.DxyBCb.kA9KIf.dS8AEf.ecceSd &gt; div.m6QErb.DxyBCb.kA9KIf.dS8AEf.ecceSd) identifica o contêiner com base em sua estrutura HTML.</li><li><strong>if (container &amp;&amp; container.scrollHeight &gt; container.clientHeight + container.scrollTop) { … } else { … }</strong>: Verifica se o contêiner existe e se o scroll ainda não atingiu o final. Isso é feito comparando a altura total do contêiner (scrollHeight) com a altura visível do contêiner mais a posição atual do scroll (clientHeight + scrollTop).</li><li><strong>container.scrollTop += 800:</strong> Se o scroll ainda não atingiu o final, a posição do scroll é incrementada em 800 pixels para rolar a página para baixo.</li><li><strong>clearInterval(scrollInterval):</strong> Se o scroll atingiu o final, o intervalo de rolagem é parado usando clearInterval(scrollInterval).</li><li><strong>extrairDadosContato():</strong> Quando o scroll chegar ao final, chama a função extrairDadosContato().</li><li><strong>const scrollInterval = setInterval(rolarScroll, 3000):</strong> Define um intervalo de tempo (3000 milissegundos ou 3 segundos, neste caso) para chamar a função rolarScroll repetidamente. Isso faz com que o scroll seja rolado automaticamente a cada 3 segundos.</li></ol><h4><strong>4.2 extrairDadosContato()</strong></h4><p><strong>Seleção de elementos:</strong> O código começa selecionando todos os elementos HTML que têm a classe .UaQhfb, que é onde estão concentrados os dados de contato no Google Maps.</p><p><strong>Extração de dados de contato:</strong> Em seguida, ele extrai os dados de contato de cada elemento encontrado. Para cada elemento, ele busca os elementos com as classes .qBF1Pd e .UsdlK, que geralmente contêm o nome e o telefone do contato, respectivamente. Esses dados são armazenados em um array de objetos chamado dadosContato, onde cada objeto contém um nome e um telefone.</p><p><strong>Escrita de arquivo:</strong> Depois de extrair os dados de contato, o código itera sobre o array dadosContato e constrói uma string no formato de cartão de visita eletrônico (vCard) para cada contato. Essa string é concatenada à variável conteudoArquivo, que é inicializada fora da função. Cada linha do vCard é adicionada à conteudoArquivo, separando as informações com quebras de linha (\n).</p><p><strong>Download do arquivo: </strong>Após criar o conteúdo do arquivo, a função criarArquivoTxtEDownload é chamada, passando o conteúdo do arquivo e o nome do arquivo como parâmetros. Esta função, é responsável por criar um arquivo de texto com o conteúdo especificado na variável conteudoArquivo e iniciar o download automático desse arquivo.</p><p>Para facilitar a busca por nicho em agendas, base de contatos, concatena-se a busca ao nome da empresa extraído, por exemplo, “Nome da empresa” + “Logística em São Paulo” durante o processo de criação do arquivo .vcf.</p><h3>Conclusão</h3><p>Automatizar a criação de listas de prospecção com javascript e .vcf é uma estratégia valiosa para profissionais, empresas e pessoas em busca de oportunidades. Esse processo economiza tempo, reduz erros e melhora a organização dos contatos. Lembre-se de sempre utilizar as informações coletadas de maneira ética e respeitosa. É importante realizar a concatenação do nome da empresa com o segmento pois isso poderá facilitar a prospecção por nichos específicos.</p><h3>Benefícios para diferentes públicos:</h3><p><strong>Profissionais:</strong> Crie listas de prospecção para novos clientes. Encontre potenciais parceiros e colaboradores. Amplie sua rede de contatos profissionais.</p><p><strong>Pequenas e médias empresas: </strong>Aumente a base de clientes e leads. Gere novas oportunidades de negócios. Otimize o processo de vendas e marketing.</p><p><strong>Grandes empresas:</strong> Encontre fornecedores e parceiros estratégicos. Realize pesquisas de mercado e coleta de dados. Crie campanhas de marketing direcionadas.</p><p><strong>Pessoas em busca de oportunidades de emprego:</strong> Encontre empresas do seu segmento de atuação. Facilite o envio de currículos direcionados. Aumente suas chances de conseguir uma entrevista.</p><p><strong>Observações importantes: </strong>É fundamental respeitar as leis anti-spam e de proteção de dados ao utilizar listas de prospecção. Envie mensagens dentro do limite diário permitido pela plataforma responsável, para que você não seja banido. Utilize os contatos de forma ética e profissional. Mantenha suas listas atualizadas para garantir a sua eficácia.</p><h3><strong>Requisitos para este projeto</strong></h3><p>Os requisitos mínimos para rodar o projeto de criação de listas de prospecção com Python e .vcf dependem do seu sistema operacional e das suas necessidades específicas. No entanto, em geral, você precisará de um computador desktop que tenha um navegador Chrome ou Microsoft Edge, os quais foram testados.</p><h3>Observações</h3><p>A atualização por meio da plataforma Google Maps ao seu site implicará na descontinuidade deste código, dado que utiliza-se de referência a elementos, que ao serem modificados deixam de funcionar corretamente. De toda forma este código continua válido com objeto de estudo para a automatização de tarefas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15fa65f7b341" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>