# MemorySettings

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.memorysettings/
> Summary: MemorySettings: Determines the memory providers bound to an agent.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Determines the memory providers bound to an agent.

```csharp
public sealed record MemorySettings : IEquatable<MemorySettings>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.memorysettings/">MemorySettings</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;MemorySettings&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

[MemorySettings.EnableVectorSearch](/api/tracon.memorysettings/#Tracon_MemorySettings_EnableVectorSearch) and [MemorySettings.EnableConversationMemory](/api/tracon.memorysettings/#Tracon_MemorySettings_EnableConversationMemory) are different
things. The first opens a semantic search tool over a knowledge base a host loaded; the
second remembers what one user said to this agent in earlier sessions.

## Constructors

### <a id="Tracon_MemorySettings__ctor"></a> MemorySettings\(\)

```csharp
public MemorySettings()
```

## Properties

### <a id="Tracon_MemorySettings_ConversationMemoryMaxResults"></a> ConversationMemoryMaxResults

Gets the most records one search returns. The framework's default (3) applies when it is
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). Must be between 1 and 20.

```csharp
public int? ConversationMemoryMaxResults { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)?

### <a id="Tracon_MemorySettings_ConversationMemorySearch"></a> ConversationMemorySearch

Gets when the agent searches its conversation memory. Read only while
`EnableConversationMemory` is on.

```csharp
public ConversationMemorySearch ConversationMemorySearch { get; init; }
```

#### Property Value

 [ConversationMemorySearch](/api/tracon.conversationmemorysearch/)

### <a id="Tracon_MemorySettings_EnableConversationMemory"></a> EnableConversationMemory

Gets a value that turns on conversation memory: the agent finds what the same user said
to this agent in earlier sessions and gets it as context.

```csharp
public bool EnableConversationMemory { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Remarks

It needs `UseConversationMemory` and a `VectorStore` in the service collection;
when either is missing, the build stops with [TraconCompilationException](/api/tracon.traconcompilationexception/) and
names it. Records are scoped by tenant, agent and user. A run with no user, or no session,
neither reads nor writes memory. The records live in the host's vector store and go when
their session goes: an erasure of its data subject, `DELETE /api/sessions/{id}` or its
retention period.

The store embeds what it keeps; Tracon does not see that model call, so its tokens and cost
are not on the run.

### <a id="Tracon_MemorySettings_EnableFileMemory"></a> EnableFileMemory

Gets a value that turns on file-based memory. It reads whichever
`AgentFileStore` is registered; the built-in store keeps files in
memory, so they do not survive a restart unless you register your own.

```csharp
public bool EnableFileMemory { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_EnableTextSearch"></a> EnableTextSearch

Gets a value that turns on text search over the file store. The search runs over
the registered `AgentFileStore`, which is the in-memory store unless you
register another one.

```csharp
public bool EnableTextSearch { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_EnableTodo"></a> EnableTodo

Gets a value that turns on todo tracking.

```csharp
public bool EnableTodo { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_EnableVectorSearch"></a> EnableVectorSearch

Gets a value that turns on the `search_knowledge` tool.
PostgreSQL only: the single concrete implementation of
[IVectorSearchStore](/api/tracon.ivectorsearchstore/) lives in `Tracon.PostgreSql`. When this
flag is turned on while another provider is registered, the build stops with
[TraconCompilationException](/api/tracon.traconcompilationexception/); it does not silently return an
empty result.

```csharp
public bool EnableVectorSearch { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_VectorCollection"></a> VectorCollection

Gets the name of the collection to search. The agent name is used when it is empty.

```csharp
public string? VectorCollection { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

## Methods

### <a id="Tracon_MemorySettings_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_Equals_Tracon_MemorySettings_"></a> Equals\(MemorySettings?\)

```csharp
public bool Equals(MemorySettings? other)
```

#### Parameters

`other` [MemorySettings](/api/tracon.memorysettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_MemorySettings_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_MemorySettings_op_Equality_Tracon_MemorySettings_Tracon_MemorySettings_"></a> operator ==\(MemorySettings?, MemorySettings?\)

```csharp
public static bool operator ==(MemorySettings? left, MemorySettings? right)
```

#### Parameters

`left` [MemorySettings](/api/tracon.memorysettings/)?

`right` [MemorySettings](/api/tracon.memorysettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_MemorySettings_op_Inequality_Tracon_MemorySettings_Tracon_MemorySettings_"></a> operator \!=\(MemorySettings?, MemorySettings?\)

```csharp
public static bool operator !=(MemorySettings? left, MemorySettings? right)
```

#### Parameters

`left` [MemorySettings](/api/tracon.memorysettings/)?

`right` [MemorySettings](/api/tracon.memorysettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
