Skip to content

Dominando a engenharia RAG6 / 10

Prompting the Generator — Grounding & Citations

Great retrieval is wasted if the model ignores it or can't point to its sources. Grounding is a prompt-design discipline, not an afterthought.

Prompting the Generator — Grounding & Citations

You retrieved the right chunks. Now the model has to use them — and only them. Grounding is the prompt discipline that turns retrieved context into a trustworthy answer.

The three rules of a grounded prompt

  • Answer only from context. State it explicitly: "Use only the provided sources. If they don't contain the answer, say so."
  • Cite by id. Give each chunk an id and require inline citations like [3]. Citations make answers auditable and build user trust.
  • Permit "I don't know." An honest gap beats a confident fabrication. Reward abstention in the instruction.

Structure the context

SOURCES:
[1] (title, url) … chunk text …
[2] (title, url) … chunk text …

QUESTION: …

Answer using only the sources above. Cite as [n]. If the sources
do not answer the question, say you don't know.

Order matters: put the strongest re-ranked chunks first, and keep the source block visually distinct from the instruction.

Compartilhar este artigo

#PromptEngineering #RAG #LLM

LinkedInX / TwitterBlueskyThreadsRedditHacker NewsWhatsAppE-mail

Série — Dominando a engenharia RAG

  1. Parte 01Por que RAG Ingênuo Falha em ProduçãoA demo de busca vetorial de 50 linhas que impressiona no notebook desmorona no momento em que usuários reais fazem perguntas reais. Aqui está o porquê — e o mapa de saída.
  2. Parte 02Chunking — The Decision That Sets Your CeilingYou can't retrieve what you chunked badly. Chunking is the most under-rated lever in RAG — and the cheapest to get right.
  3. Parte 03Embeddings & Vector Stores 101Um embedding transforma significado em geometria. Uma vector store torna essa geometria pesquisável em milissegundos. Acerte ambos e a recuperação fica fácil.
  4. Parte 04Hybrid Retrieval — Keyword + VectorVector search compreende significado mas tropeça em termos exatos, IDs e palavras raras. Keyword search acerta nesses e erra em paráfrase. Use ambos.
  5. Parte 05Re-Ranking — The Cheap Quality WinRetrieval gets you 30 plausible chunks. A re-ranker reads them against the actual question and floats the truly relevant few to the top.
  6. Parte 06Prompting the Generator — Grounding & Citationsvocê está aquiGreat retrieval is wasted if the model ignores it or can't point to its sources. Grounding is a prompt-design discipline, not an afterthought.
  7. Parte 07Avaliação — Você Não Pode Melhorar o Que Não MedeSem um conjunto de avaliação, toda mudança em RAG é uma intuição. Com um, você afina chunking, retrieval e prompts com um número que diz se ajudou ou prejudicou.
  8. Parte 08Tratando Alucinações e GuardrailsQuando a recuperação vem vazia, um modelo prestativo inventa. Guardrails transformam 'confiantemente errado' em 'honestamente incerto' — a diferença que os usuários realmente confiam.
  9. Parte 09Disciplina de Custo e LatênciaUma consulta RAG toca embeddings, um vector DB, um re-ranker e um LLM. Cada um adiciona milissegundos e centavos. Em escala, disciplina aqui é a diferença entre uma margem e um incêndio.
  10. Parte 10The Production RAG Reference ArchitectureEvery piece, assembled: ingestion, hybrid retrieval, re-ranking, grounded generation, guardrails, eval and caching — the blueprint you can ship.

Continue aprendendo

Skill do catálogo

prompt-engineer

Transforms user prompts into optimized prompts using frameworks (RTF, RISEN, Chain of Thought, RODES, Chain of Density, RACE, RISE, STAR, SOAP, CLEAR, GROW)

Abrir o skill →

PDF — vitalício

Comandos de barra

Todos os comandos de barra integrados, e como criar os seus.

Ver o PDF →

Curso

O curso Claude Mastery

12 módulos · 5 idiomas · certificado · teste 3 dias grátis.

Ver planos →
LinkedInX / TwitterBlueskyThreads