Agente em produΓ§Γ£o β‰  POC com ChatGPT. POC funciona em 80% dos casos felizes; produΓ§Γ£o exige 99%+ correto, custo controlado, observabilidade, fallback. As liΓ§Γ΅es abaixo vΓͺm de times que escalaram agentes para milhΓ΅es de usuΓ‘rios (LinkedIn, GitHub Copilot, Anthropic Claude apps).

Componentes de um agente em produΓ§Γ£o

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Agent System β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Input β”‚ β”‚ Conversation β”‚ β”‚ Tools / Functions β”‚ β”‚ β”‚ β”‚ Guardrails β”‚ β”‚ Memory β”‚ β”‚ - search_db β”‚ β”‚ β”‚ β”‚ (PII, abuse) β”‚ β”‚ (short / long) β”‚ β”‚ - send_email β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ - update_status β”‚ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β–Ό β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ LLM Orchestrator β”‚ β”‚ β”‚ β”‚ (ReAct loop, tool calling, retry, model routing) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–² β”‚ β”‚ β”‚ β”‚ β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ RAG β”‚ β”‚ Output β”‚ β”‚ Action Guardrails β”‚ β”‚ β”‚ β”‚ (vector DB, β”‚ β”‚ Guardrails β”‚ β”‚ (permission, conf β”‚ β”‚ β”‚ β”‚ re-rank) β”‚ β”‚ (schema, fact) β”‚ β”‚ irmation, sandbox)β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Observabilityβ”‚ β”‚ Eval Pipeline β”‚ β”‚ (logs, tracesβ”‚ β”‚ (offline + β”‚ β”‚ cost, qual.)β”‚ β”‚ in-prod sampleβ”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Loop bΓ‘sico ReAct (reasoning + acting)

# Loop ReAct (Reasoning + Acting) while not_done: thought = model.generate("Given task X and state S, what next?") if thought.is_final_answer: return thought.answer action = thought.tool_call # qual tool, com quais args if needs_human_approval(action): wait_for_user_confirmation() observation = execute(action) # roda a tool state.append(thought, action, observation) if state.iterations > MAX: raise TooManyIterations # circuit breaker # Variantes: # - Plan-then-execute (plan inteiro antes de executar) # - Tree of thoughts (explora mΓΊltiplos paths) # - Reflexion (auto-crΓ­tica entre passos)

DecisΓ΅es de arquitetura

DecisΓ£oTrade-off
Single agent vs Multi-agentSingle Γ© simples e debugΓ‘vel; multi escala melhor pra tarefas heterogΓͺneas mas Γ© difΓ­cil de orquestrar e debugar
Sync vs AsyncSync Γ© UX simples; async permite tarefas longas (10+ min) mas exige notificaΓ§Γ£o e UX de "trabalhando"
Tool use vs RAGRAG Γ© estΓ‘vel; tools dΓ£o poder mas espaΓ§o de erro maior; combinar Γ© comum
Modelo ΓΊnico vs routerRouter (Haiku pra tarefa simples, Opus pra raciocΓ­nio) reduz custo 5-10x; complexidade extra de roteamento
MemΓ³ria curta vs longaCurta cabe no contexto; longa precisa vector store + retrieval; introduz staleness
Human-in-the-loopPara aΓ§Γ΅es irreversΓ­veis (delete, send email, charge); pausa fluxo mas previne desastre
Comece simples. Single-agent + ReAct + tools bem desenhados resolve 80% dos casos. Multi-agent, dynamic routing, memory complex sΓ£o otimizaΓ§Γ΅es para depois.

Tipos de tarefa de agente

  • Assistente conversacional β€” ChatGPT-like, multi-turn, baixo risco por aΓ§Γ£o
  • Workflow agent β€” executa tarefa multi-step atΓ© completar (Hiring Assistant LinkedIn)
  • Coding agent β€” modifica cΓ³digo, alta autonomia, sensores como harness (ver pΓ‘gina)
  • RPA-like β€” automatiza aΓ§Γ£o em UI, mais brittle
Quando NÃO usar um agente, e usar workflow determinístico?
Se o problema tem soluΓ§Γ£o determinΓ­stica clara, nΓ£o use LLM. LLM Γ© caro, nΓ£o-determinΓ­stico, e introduz novos modos de falha. Use agente quando: (a) o input Γ© livre/ambΓ­guo (linguagem natural, conversa); (b) o caminho de execuΓ§Γ£o varia por contexto; (c) traduΓ§Γ£o semΓ’ntica Γ© necessΓ‘ria (nΓ£o regex). Para fluxos estruturados (workflow BPMN, ETL), use orquestrador tradicional β€” vai ser mais barato e confiΓ‘vel. Anti-pattern comum: LLM substituindo um if.