# MentorRagResult record

> The MentorRagResult record of Novior.MentorAgent.Abstractions.Models: A single result from a RAG (Retrieval-Augmented Generation) search. Used both for…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorragresult
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Abstractions

A single result from a RAG (Retrieval-Augmented Generation) search. Used both for injecting context into the AI prompt and for rendering citation chips in the `RagSourcePanel` component.

## Definition

Namespace: `Novior.MentorAgent.Abstractions.Models`. Package: `Novior.MentorAgent.Abstractions`.

`public sealed record MentorRagResult : IEquatable<MentorRagResult>`

```shell
dotnet add package Novior.MentorAgent.Abstractions
```

## Constructors

`public MentorRagResult(string Content, string? SourceUrl, string? Title, float Score)`

A single result from a RAG (Retrieval-Augmented Generation) search. Used both for injecting context into the AI prompt and for rendering citation chips in the `RagSourcePanel` component.

**Parameters**

- `Content`: The retrieved document content injected into the system prompt.
- `SourceUrl`: Optional URL of the source document (used as link in citation chips).
- `Title`: Optional display title for the citation chip (falls back to SourceUrl).
- `Score`: Relevance score (higher = more relevant). Informational only.

## Properties

### `Content`

`public string Content { get; init; }`

The retrieved document content injected into the system prompt.

### `Metadata`

`public IReadOnlyDictionary<string, string>? Metadata { get; init; }`

Facts about the document that the model should weigh with its content — an author, a date, a version, the product it applies to. Shown to the model next to the document's title, one `key: value` per entry, so "the 2025 price list" can be told from the 2026 one. `null` or empty: nothing is added.

An init property rather than a constructor parameter, so every source written for the four positional values keeps compiling. Like the content, it also travels with the citation chips to the client.

```text title="Example"
new MentorRagResult(text, url, title, score)
{
    Metadata = new Dictionary<string, string> { ["valid from"] = "2026-01-01" },
}
```

### `Score`

`public float Score { get; init; }`

Relevance score (higher = more relevant). Informational only.

### `SourceUrl`

`public string? SourceUrl { get; init; }`

Optional URL of the source document (used as link in citation chips).

### `Title`

`public string? Title { get; init; }`

Optional display title for the citation chip (falls back to SourceUrl).

---

- Previous: [MentorModelUsage record](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentormodelusage.md)
- Next: [MentorReplyStarted record](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorreplystarted.md)
