MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

MentorRagResult record

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

View as Markdown
On this page

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.

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

public sealed record MentorRagResult : IEquatable<MentorRagResult>

Terminal
dotnet add package Novior.MentorAgent.Abstractions

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.

public string Content { get; init; }

The retrieved document content injected into the system prompt.

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.

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

public float Score { get; init; }

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

public string? SourceUrl { get; init; }

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

public string? Title { get; init; }

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