U
You
Can you explain how retrieval-augmented generation works?
AiMessage
Headless message container with slots for content, reasoning, tools, and sources.
You
Can you explain how retrieval-augmented generation works?
Assistant
RAG (Retrieval-Augmented Generation) combines a retrieval system with a language model. First, relevant documents are fetched from a knowledge base using semantic search. Then, these documents are passed as context to the LLM, which generates a grounded response based on the retrieved information.
<AiMessage role="assistant" content="Hello!" status="complete">
<template #content="{ content }">
<p class="text-sm">{{ content }}</p>
</template>
</AiMessage>| Prop | Type | Default | Description |
|---|---|---|---|
| role* | 'user' | 'assistant' | 'system' | 'tool' | — | Message role |
| content | string | — | Plain text content |
| htmlContent | string | — | Sanitized HTML content |
| status | 'pending' | 'streaming' | 'complete' | 'error' | 'complete' | Message status |
| reasoning | string | — | Reasoning text for slot |
| sources | AiSource[] | — | Citation sources |
| toolCalls | AiToolCall[] | — | Tool invocations |
| attachments | AiAttachment[] | — | File attachments |
avatarreasoningtool-callsattachmentscontentsourcesmetadataactions