{"id":10535,"date":"2025-10-02T16:57:39","date_gmt":"2025-10-02T19:57:39","guid":{"rendered":"https:\/\/dev.superchargerd7.com\/?p=10535"},"modified":"2025-10-02T17:02:47","modified_gmt":"2025-10-02T20:02:47","slug":"como-criar-agentes-ai-em-python-o-case-andrade-gutierrez-botcity","status":"publish","type":"post","link":"https:\/\/dev.superchargerd7.com\/pt-br\/2025\/10\/02\/como-criar-agentes-ai-em-python-o-case-andrade-gutierrez-botcity\/","title":{"rendered":"Como criar Agentes AI em Python: o case Andrade Gutierrez + BotCity"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Com <\/span><b>mais de 230 automa\u00e7\u00f5es<\/b><span style=\"font-weight: 400;\"> j\u00e1 rodando em produ\u00e7\u00e3o, a Andrade Gutierrez precisava ir al\u00e9m da execu\u00e7\u00e3o mec\u00e2nica e acrescentar intelig\u00eancia que aprendesse com exce\u00e7\u00f5es e gerasse insights instant\u00e2neos, sem perder o controle da governan\u00e7a.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para isso, o CoE de Hiperautoma\u00e7\u00e3o usou a plataforma BotCity para criar e orquestrar agentes de IA que complementam essas automa\u00e7\u00f5es. Uma dessas automa\u00e7\u00f5es, voltada \u00e0 governan\u00e7a do pr\u00f3prio CoE, analisa o c\u00f3digo e produz documenta\u00e7\u00e3o. O resultado foi de <\/span><b>250 SDDs gerados em 15 segundos cada, algo que levava em m\u00e9dia 2 horas para ser produzido.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Segundo Pieter Voloshyn, gerente de TI da Andrade Gutierrez e respons\u00e1vel pelo projeto, \u201c<\/span><i><span style=\"font-weight: 400;\">APA n\u00e3o substitui o RPA, ele o expande e complementa. \u00c9 um novo paradigma para repensar como automatizamos o conhecimento e a tomada de decis\u00e3o.\u201d<\/span><\/i><\/p>\n<h2><span style=\"font-weight: 400;\">RPA vs. APA: Uma Nova Gera\u00e7\u00e3o de Automa\u00e7\u00f5es<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Mesmo j\u00e1 operando um ambiente robusto de RPA, a Andrade Gutierrez precisava de automa\u00e7\u00f5es que <\/span><b>aprendessem<\/b><span style=\"font-weight: 400;\"> e <\/span><b>reagissem<\/b><span style=\"font-weight: 400;\"> \u00e0s mudan\u00e7as di\u00e1rias do neg\u00f3cio. Ao criar <\/span><b>Agentes AI em Python na plataforma BotCity<\/b><span style=\"font-weight: 400;\">, as automa\u00e7\u00f5es passaram a:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Adaptar-se<\/b><span style=\"font-weight: 400;\">: cada agente avalia o contexto em tempo real; quando a regra muda, o fluxo se ajusta sem necessariamente haver a reescrita extensa de c\u00f3digo.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Consumir fontes de dados n\u00e3o-estruturados<\/b><span style=\"font-weight: 400;\">: LLMs s\u00e3o excelentes em trabalhar com dados n\u00e3o-estruturados, como PDFs, imagens e e-mails.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Entregar r\u00e1pido<\/b><span style=\"font-weight: 400;\">: a prototipa\u00e7\u00e3o de um agente funcional vai de idea\u00e7\u00e3o \u00e0 valida\u00e7\u00e3o em poucas horas, contra dias em RPA tradicional.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><b style=\"font-size: 19px;\">Cobrir exce\u00e7\u00f5es<\/b><span style=\"font-weight: 400;\">: o uso de LLMs e valida\u00e7\u00f5es Python aumentam a abrang\u00eancia das automa\u00e7\u00f5es reduzindo quebras que antes exigiam interven\u00e7\u00e3o humana.<\/span><\/span><\/li>\n<\/ul>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-10537 \" src=\"http:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/pt-300x140.png\" alt=\"\" width=\"652\" height=\"304\" srcset=\"https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/pt-300x140.png 300w, https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/pt-1024x477.png 1024w, https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/pt.png 1121w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/p>\n<h2><span style=\"font-weight: 400;\">Como funciona um Agente AI em Python<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A base do APA s\u00e3o os Agentes de IA, que s\u00e3o componentes aut\u00f4nomos de software\u00a0 capazes de analisar o ambiente, tomar decis\u00f5es estrat\u00e9gicas para alcan\u00e7ar metas e executar as a\u00e7\u00f5es necess\u00e1rias, tudo isso com um alto grau de independ\u00eancia e adaptabilidade.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para entender como eles operam na pr\u00e1tica, a arquitetura b\u00e1sica de um agente de IA, inspirada nos conceitos abordados por Erimateia Lima, inclui:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Motor de Racioc\u00ednio (LLMs):<\/b><span style=\"font-weight: 400;\"> Modelos de Linguagem Grandes (LLMs) como OpenAI, Anthropic, Gemini AI, s\u00e3o respons\u00e1veis por elaborar a estrat\u00e9gia de pensamento, tomar a\u00e7\u00f5es e fazer observa\u00e7\u00f5es.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Planejamento:<\/b><span style=\"font-weight: 400;\"> Baseado em prompts (como o system prompt) e estrat\u00e9gias como Chain of Thoughts (CoT) e Reasoning &amp; Action (ReAct), que guiam o comportamento do agente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Mem\u00f3ria:<\/b><span style=\"font-weight: 400;\"> De curto prazo (intera\u00e7\u00e3o atual) e longo prazo (informa\u00e7\u00f5es \u00fateis armazenadas, por exemplo, em bases de dados vetoriais).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tools (Fun\u00e7\u00f5es\/Capacidades):<\/b><span style=\"font-weight: 400;\"> Permitem ao agente interagir com o ambiente externo, como bancos de dados, sistemas BPMS, RPAs, APIs, e scripts complexos.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Base de Conhecimento (Aumento de Contexto\/RAG):<\/b><span style=\"font-weight: 400;\"> Utiliza bases de dados vetoriais para indexa\u00e7\u00e3o de conte\u00fado, permitindo que o agente acesse informa\u00e7\u00f5es relevantes como normas jur\u00eddicas ou de suprimentos para an\u00e1lises complexas.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Guardrails (Barreiras Protetoras):<\/b><span style=\"font-weight: 400;\"> Imposi\u00e7\u00e3o de limites e filtragem de conte\u00fado para garantir que o agente opere dentro de par\u00e2metros seguros e \u00e9ticos, evitando respostas inadequadas.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">O ciclo de um agente, baseado no conceito ReAct, envolve: <\/span><b>Pensamento<\/b><span style=\"font-weight: 400;\"> (definindo o objetivo), <\/span><b>A\u00e7\u00e3o<\/b><span style=\"font-weight: 400;\"> (executando uma tarefa com as ferramentas dispon\u00edveis), e <\/span><b>Observa\u00e7\u00e3o<\/b><span style=\"font-weight: 400;\"> (analisando o resultado e comparando com o objetivo, ajustando o pensamento se necess\u00e1rio).<\/span><\/p>\n<p><img decoding=\"async\" class=\" wp-image-10540 aligncenter\" src=\"http:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/1-pt-300x142.png\" alt=\"\" width=\"628\" height=\"297\" srcset=\"https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/1-pt-300x142.png 300w, https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/1-pt-1024x485.png 1024w, https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/1-pt-1536x728.png 1536w, https:\/\/dev.superchargerd7.com\/wp-content\/uploads\/2025\/10\/1-pt-2048x970.png 2048w\" sizes=\"(max-width: 628px) 100vw, 628px\" \/><\/p>\n<h2><span style=\"font-weight: 400;\">Arquitetura Multiagentes aplicada na Andrade Gutierrez<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Para enfrentar os desafios de processos complexos, a Andrade Gutierrez aproveitou a <\/span><b>BotCity<\/b><span style=\"font-weight: 400;\"> para implementar <\/span><b>arquiteturas multi-agentes<\/b><span style=\"font-weight: 400;\">. Isso significa que, em vez de uma \u00fanica automa\u00e7\u00e3o, v\u00e1rios agentes de IA trabalham juntos para um objetivo maior.<\/span><\/p>\n<h3><b>Como isso funciona na pr\u00e1tica para a Andrade Gutierrez?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Um exemplo real \u00e9 a <\/span><b>elabora\u00e7\u00e3o de SDDs (Solution Design Documents)<\/b><span style=\"font-weight: 400;\">. Em vez de um \u00fanico agente sobrecarregado, a BotCity permitiu que a Andrade Gutierrez criasse um sistema multiagentes para essa tarefa.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Este sistema inteligente pode delegar tarefas a agentes especializados, como:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Um agente para &#8220;inspecionar_codigo&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Outro para &#8220;descrever_automacao&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Um terceiro para &#8220;descrever_componentes&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">E assim por diante, com agentes para &#8220;descrever_requisitos&#8221;, &#8220;desenhar_fluxo&#8221;, &#8220;gerar_resumo_executivo&#8221; e &#8220;gerar_sdd&#8221;.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Cada um desses agentes especializados possui seu pr\u00f3prio &#8220;c\u00e9rebro&#8221; (motor de racioc\u00ednio LLM), &#8220;m\u00e3os&#8221; (ferramentas para interagir com o c\u00f3digo-fonte), &#8220;mem\u00f3ria&#8221; (para o contexto da documenta\u00e7\u00e3o), &#8220;conhecimento&#8221; (sobre os padr\u00f5es de SDD) e &#8220;barreiras protetoras&#8221; (para garantir a qualidade do documento).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Isso permitiu que a Andrade Gutierrez automatize processos que antes seriam impens\u00e1veis, garantindo velocidade, precis\u00e3o e governan\u00e7a. Esse modelo multiagente s\u00f3 foi poss\u00edvel porque a<\/span><b> infraestrutura t\u00e9cnica da BotCity permitiu<\/b><span style=\"font-weight: 400;\">:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Execu\u00e7\u00e3o nativa de Python:<\/b><span style=\"font-weight: 400;\"> Ideal para qualquer l\u00f3gica definida por agentes, com integra\u00e7\u00e3o a LLMs (locais, inclusive!), APIs e scripts complexos.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>N\u00e3o depende de estruturas engessadas:<\/b><span style=\"font-weight: 400;\"> Proporciona total liberdade de modelagem e orquestra\u00e7\u00e3o.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Compat\u00edvel com diversos frameworks:<\/b><span style=\"font-weight: 400;\"> Integra facilmente com LangGraph, CrewAI, PydanticAI, OpenAI SDK, Semantic Kernel.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Execu\u00e7\u00e3o em m\u00faltiplos ambientes:<\/b><span style=\"font-weight: 400;\"> Suporta execu\u00e7\u00e3o local, em servidor, nuvem, VMs e containers.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Interoperabilidade com sistemas diversos:<\/b><span style=\"font-weight: 400;\"> Conecta-se a SAP, Web, Windows, APIs, Bancos de Dados, Arquivos e mais de 500.000 bibliotecas open-source.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Casos de Aplica\u00e7\u00e3o Reais na Andrade Gutierrez<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A Andrade Gutierrez j\u00e1 colhe frutos da APA em diversas frentes, demonstrando o potencial transformador dessa tecnologia.<\/span><\/p>\n<h4><b>Case #1: Elabora\u00e7\u00e3o de SDDs (Solution Design Document)<\/b><\/h4>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Objetivo:<\/b><span style=\"font-weight: 400;\"> Automatizar a elabora\u00e7\u00e3o de SDDs com base no c\u00f3digo-fonte da automa\u00e7\u00e3o.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Como foi feito:<\/b><span style=\"font-weight: 400;\"> Agentes criados com LangGraph. O processo envolve &#8220;inspecionar_codigo&#8221;, &#8220;descrever_automacao&#8221;, &#8220;descrever_componentes&#8221;, &#8220;descrever_requisitos&#8221;, &#8220;desenhar_fluxo&#8221;, &#8220;gerar_resumo_executivo&#8221; e &#8220;gerar_sdd&#8221;.<\/span><\/li>\n<\/ul>\n<p><b>Resultado:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Tempo m\u00e9dio caiu de <\/span><b>2 horas para apenas 15 segundos<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>+250 documentos gerados automaticamente.<\/b><\/li>\n<\/ul>\n<h4><b>Case #2: An\u00e1lise de Integra\u00e7\u00f5es para SAP HCM<\/b><\/h4>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Objetivo:<\/b><span style=\"font-weight: 400;\"> Mapear integra\u00e7\u00f5es SQL com o sistema de folha de pagamento para a pr\u00e9-migra\u00e7\u00e3o do SAP HCM.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Como foi feito:<\/b><span style=\"font-weight: 400;\"> Agentes criados com LangGraph. O fluxo inclui &#8220;inspecionar_codigo&#8221;, &#8220;extrair_comandos_sql&#8221;, &#8220;descrever_comandos_sql&#8221; e &#8220;gerar_relatorio&#8221;.<\/span><\/li>\n<\/ul>\n<p><b>Resultado:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Toda a an\u00e1lise realizada em <\/span><b>~10 minutos<\/b><span style=\"font-weight: 400;\">, tarefa antes manual e extensa.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Projetos Futuros com APA na Andrade Gutierrez<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A Andrade Gutierrez j\u00e1 est\u00e1 expandindo o uso de agentes inteligentes em novas frentes de automa\u00e7\u00e3o, todas utilizando frameworks como <\/span><b>Langgraph<\/b><span style=\"font-weight: 400;\">, <\/span><b>Pydantic-AI<\/b><span style=\"font-weight: 400;\"> e <\/span><b>CrewAI<\/b><span style=\"font-weight: 400;\">, integrados \u00e0 plataforma da BotCity.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Al\u00e9m disso, automa\u00e7\u00f5es que j\u00e1 usavam Generative AI ser\u00e3o aprimoradas para fazer o uso de agentes.<\/span><\/p>\n<h4><b>1. Processamento de Faturas de Telecom<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">A automa\u00e7\u00e3o atual ser\u00e1 aprimorada com agentes que realizam valida\u00e7\u00f5es de regras de neg\u00f3cio e geram feedback autom\u00e1tico sobre inconsist\u00eancias na extra\u00e7\u00e3o de dados. Isso aumenta a confiabilidade e reduz o retrabalho humano.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><b>Fluxo principal: <\/b><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">abrir_fatura<\/span><span style=\"font-weight: 400;\"> ? <\/span><span style=\"font-weight: 400;\">extrair_dados<\/span><span style=\"font-weight: 400;\"> ? <\/span><span style=\"font-weight: 400;\">validar_dados<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<h4><b>2. Identifica\u00e7\u00e3o do Respons\u00e1vel por Documentos Assinados Digitalmente<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Agentes interpretar\u00e3o os metadados de documentos assinados para identificar de forma precisa o respons\u00e1vel legal por cada assinatura. A l\u00f3gica do agente garante valida\u00e7\u00e3o contextual e robusta.<\/span><\/p>\n<p><b>Fluxo principal: <\/b><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">abrir_documento<\/span><span style=\"font-weight: 400;\"> ? <\/span><span style=\"font-weight: 400;\">extrair_responsavel<\/span><span style=\"font-weight: 400;\"> ? <\/span><span style=\"font-weight: 400;\">validar_dados<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Conclus\u00e3o<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A experi\u00eancia da Andrade Gutierrez mostra que, ao adotar a BotCity, equipes t\u00e9cnicas podem criar e colocar em produ\u00e7\u00e3o agentes de IA escritos em Python em pouco tempo, mantendo controle total de versionamento, auditoria e permiss\u00f5es na mesma plataforma que orquestra as automa\u00e7\u00f5es existentes. Esse modelo acelera a entrega de valor, reduz falhas operacionais e garante governan\u00e7a incorporada desde o primeiro commit at\u00e9 o monitoramento em escala.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para saber mais sobre este caso de uso, <a href=\"https:\/\/meetings.hubspot.com\/andreabotcity\/botcity-sales-global-calls?uuid=f7f68462-1b6e-4a0a-9515-f417728f78d9\">entre em contato com nosso time de especialistas<\/a>!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Com mais de 230 automa\u00e7\u00f5es j\u00e1 rodando em produ\u00e7\u00e3o, a Andrade Gutierrez precisava ir al\u00e9m da execu\u00e7\u00e3o mec\u00e2nica e acrescentar intelig\u00eancia que aprendesse com exce\u00e7\u00f5es e gerasse insights instant\u00e2neos, sem perder o controle da governan\u00e7a.\u00a0 Para isso, o CoE de Hiperautoma\u00e7\u00e3o usou a plataforma BotCity para criar e orquestrar agentes de IA que complementam essas [&hellip;]<\/p>\n","protected":false},"author":214060741,"featured_media":10545,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[773019],"tags":[],"class_list":["post-10535","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nao-categorizado"],"_links":{"self":[{"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/posts\/10535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/users\/214060741"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/comments?post=10535"}],"version-history":[{"count":6,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/posts\/10535\/revisions"}],"predecessor-version":[{"id":10550,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/posts\/10535\/revisions\/10550"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/media\/10545"}],"wp:attachment":[{"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/media?parent=10535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/categories?post=10535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.superchargerd7.com\/pt-br\/wp-json\/wp\/v2\/tags?post=10535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}