# MentorVectorStoreRagOptions<TRecord>

> The MentorVectorStoreRagOptions<TRecord> class of Novior.MentorAgent.Rag: How a MentorVectorStoreRagSource<TRecord> reads a collection of…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-rag/mentorvectorstoreragoptions-1
- Verified with: MentorAgent 1.4.0
- Last updated: 2026-11-18
- Packages: Novior.MentorAgent

How a [`MentorVectorStoreRagSource<TRecord>`](https://docs.mentoragent.net/api/novior-mentoragent-rag/mentorvectorstoreragsource-1) reads a collection of `Microsoft.Extensions.VectorData`: what of a record becomes the document and its citation, which records a request may see, and the collection's distance function, which says what its scores mean.

## Definition

Namespace: `Novior.MentorAgent.Rag`. Package: `Novior.MentorAgent`.

`public sealed class MentorVectorStoreRagOptions<TRecord>`

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

## Constructors

`public MentorVectorStoreRagOptions()`

## Properties

### `Content`

`public required Func<TRecord, string?> Content { get; init; }`

The text of the document, the part the model reads. A record with no text is left out.

### `DefaultMinScore`

`public float DefaultMinScore { get; init; }`

The threshold for this source's scores, used when the host does not set `RagMinScore` ([`IMentorRagSource.DefaultMinScore`](https://docs.mentoragent.net/api/novior-mentoragent-rag/imentorragsource#defaultminscore)). Default: 0.5, a loose cosine similarity.

### `DistanceFunction`

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

The collection's distance function, one of the `DistanceFunction` values. It says what a score means: with `CosineDistance`, the Postgres default, a lower score is nearer, and the source turns it into a similarity (1 − distance) so that `RagMinScore` keeps the nearest documents. `null`: read from the `VectorStoreVectorAttribute` of the record's vector property. When neither names one, registering the source fails: each store has a default of its own. `CosineSimilarity`, `CosineDistance`, `DotProductSimilarity` and `NegativeDotProductSimilarity` are accepted; a Euclidean, Manhattan or Hamming distance has no scale a threshold could be set on, and is refused.

### `EmbeddingGenerator`

`public IEmbeddingGenerator<string, Embedding<float>>? EmbeddingGenerator { get; init; }`

The model that embeds the user's message, which must be the one the collection's documents were embedded with. `null`: `MentorOptions.EmbeddingGenerator`, whose vector of the message is computed once per turn and shared with routing, tool filtering and memory. When neither is set, the message's text goes to the collection, which embeds it with its own generator.

### `Filter`

`public Func<MentorRagRequest, Expression<Func<TRecord, bool>>?>? Filter { get; init; }`

The records this request may see, as the collection's filter: the tenant's own ([`MentorRagRequest.TenantId`](https://docs.mentoragent.net/api/novior-mentoragent-rag/mentorragrequest#tenantid)), those the user may read ([`MentorRagRequest.User`](https://docs.mentoragent.net/api/novior-mentoragent-rag/mentorragrequest#user)). `null`, or a filter that returns `null`, searches the whole collection. With an `IMentorTenantResolver` and no filter, the first search with a tenant is logged as a warning: every tenant would be shown every tenant's documents.

### `Metadata`

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

Facts about the document the model should weigh with it — a date, a version, the product it applies to ([`MentorRagResult.Metadata`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorragresult#metadata)).

### `SourceUrl`

`public Func<TRecord, string?>? SourceUrl { get; init; }`

The link of the citation chip, if the document has one.

### `Title`

`public Func<TRecord, string?>? Title { get; init; }`

The title shown to the model above the document and on its citation chip.

### `VectorProperty`

`public Expression<Func<TRecord, object?>>? VectorProperty { get; init; }`

The vector property to search, for a record with more than one; the only one otherwise.

---

- Previous: [MentorRagRequest class](https://docs.mentoragent.net/api/novior-mentoragent-rag/mentorragrequest.md)
- Next: [MentorVectorStoreRagSource<TRecord> class](https://docs.mentoragent.net/api/novior-mentoragent-rag/mentorvectorstoreragsource-1.md)
