HarmonyFidelisHarmonyFidelis
Entrar
Fundamentos de IAComo os LLMs funcionamCompetências LLMAvaliaçãoGlossárioConstrutor
Academia Aura

Seção 3 · Construção

Competências essenciais para aplicações LLM

Confiabilidade vem de arquitetura, limites e avaliação. Cada técnica resolve uma classe diferente de falha.

Intermediário30 minutos

Ao final você poderá

  • Choose between prompting, retrieval, tool use and model adaptation.
  • Explain RAG, function calling, MCP and agent loops.
  • Design a bounded workflow with validation and fallback.

Cinco capacidades de engenharia

01

Prompt contracts and structured output

State the task, relevant context, constraints and success criteria. A schema makes output machine-readable, but validation is still required and structure does not prove truth.

02

Retrieval-augmented generation

RAG retrieves external passages and places them in context. It can improve freshness and traceability, but depends on indexing, retrieval quality and faithful use of evidence.

03

Tools and MCP

Function calling lets a model propose structured tool arguments. The host validates, authorizes and executes. MCP standardizes how applications expose contextual resources, prompts and tools.

04

Agents and orchestration

An agent loop observes, plans, calls tools and updates state. Limit steps, cost, permissions and side effects; keep deterministic code in control of important invariants.

05

Adaptation and deployment

Fine-tuning or LoRA can shape repeated behavior; quantization reduces resource needs. Neither replaces missing knowledge, permissions, evaluation or a sound data pipeline.

Choose the smallest effective intervention

  1. 01

    Clarify prompt

  2. 02

    Add relevant context

  3. 03

    Call a trusted tool

  4. 04

    Adapt model if repeated

  5. 05

    Optimize runtime last

Use prompting for instruction gaps, RAG for accessible knowledge, tools for external actions or exact computation, and fine-tuning for stable repeated behavior patterns.

Confusões comuns

  • RAG does not eliminate hallucinations: retrieval can fail and the model can misread or ignore evidence.
  • The model may propose a tool call, but the application—not the model—must authorize and validate it.
  • A multi-agent design can multiply latency, cost and error propagation without improving the task.

Practice: design a grounded assistant

Sketch a support assistant that answers from a controlled knowledge base.

  • Define retrieval inputs, source metadata and an abstention rule when evidence is weak.
  • Define one read-only tool with a strict schema and server-side authorization.
  • Record the prompt, model, retrieved passages, tool outcome and final evaluation without logging secrets.

Quick check

When is RAG more appropriate than fine-tuning?

When the problem is supplying current, private or traceable knowledge that can be retrieved at request time.

Who must authorize a tool call?

The host application must validate arguments, user permissions and policy before execution.

Does valid JSON guarantee a correct answer?

No. It guarantees only that the output matches a syntax or schema; facts and business rules still need checks.

Palavras-chave

  • prompt
  • schema
  • grounding
  • RAG
  • embedding search
  • function calling
  • MCP
  • agent
  • LoRA
  • quantization

Especificações e pesquisa primária

Retrieval-Augmented GenerationPrimary paper combining parametric generation with retrieved external memory.OpenAI function calling guideCurrent provider documentation for defining tools and handling structured calls.Model Context Protocol specificationNormative specification for interoperable AI context and tool connections.ReActPrimary paper on interleaving reasoning-oriented traces and actions in language models.LoRAPrimary paper on low-rank adaptation for efficient model fine-tuning.
Anterior: Como os LLMs funcionamPróximo: Avaliação e segurança