Mnemosyne.NET 0.2.0

dotnet add package Mnemosyne.NET --version 0.2.0
                    
NuGet\Install-Package Mnemosyne.NET -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mnemosyne.NET" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mnemosyne.NET" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Mnemosyne.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mnemosyne.NET --version 0.2.0
                    
#r "nuget: Mnemosyne.NET, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mnemosyne.NET@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mnemosyne.NET&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Mnemosyne.NET&version=0.2.0
                    
Install as a Cake Tool

Mnemosyne.NET

Reasonlet selection and ranking: find the best known procedure for a question.

An agent asks a question and gets back the few Reasonlets most worth trying, best first, each with a score breakdown of similarity, success rate and freshness. The agent still makes the final call. This package holds:

  • ReasonletMemory, the default IReasonletMemory facade. It ties together a store, a selector, an embedding generator, an optional intent extractor and an optional evaluator.
  • ReasonletSelector, the default IReasonletSelector, with its ReasonletRankingOptions.
  • MnemosyneOptions and the AddMnemosyne registration.
dotnet add package Mnemosyne.NET
dotnet add package Mnemosyne.NET.PostgreSql

Setup and recall

Register a store, an embedding generator and the facade. The store here is Mnemosyne.NET.PostgreSql, which the host migrates at startup; see Migrations. The embedding generator is any IEmbeddingGenerator<string, Embedding<float>> from Microsoft.Extensions.AI.

using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
using Mnemosyne.NET;
using Mnemosyne.NET.Abstractions;
using Mnemosyne.NET.PostgreSql;
using Npgsql;

// connectionString and embeddingGenerator come from your host. The store's Dimensions must match the
// generator's output.
services.AddSingleton(_ => NpgsqlDataSource.Create(connectionString));
services.AddMnemosynePostgreSql(new MnemosynePostgreSqlOptions { Dimensions = 1536 });
services.AddSingleton<IEmbeddingGenerator<string, Embedding<float>>>(embeddingGenerator);
services.AddMnemosyne(new MnemosyneOptions
{
    Ranking = new ReasonletRankingOptions { MinSimilarity = 0.6 },
});

// Later, with the built IServiceProvider and the request's CancellationToken:
var memory = provider.GetRequiredService<IReasonletMemory>();
var recalled = await memory.RecallAsync(
    new ReasonletQuery { Scope = new ReasonletScope("tenant-42"), Question = "How do I export the monthly report?" },
    ct);
if (recalled.IsSuccess)
{
    foreach (var match in recalled.Value)
    {
        Console.WriteLine($"{match.Reasonlet.Name} {match.Reasonlet.Version}: {match.Score.Total:F3}");
    }
}

Judging runs

By default a run counts as a success when the agent says it worked. Register an IReasonletEvaluator and give the run its question and answer, and the evaluator's verdict counts instead. The answer goes to the evaluator and is never stored. A judge that is down, or slower than MnemosyneOptions.EvaluationTimeout (30 seconds by default), doesn't fail the call: the run is stored with the agent's verdict. So is a run whose answer is blank or longer than 32,000 code points, which is not judged. The receipt says which verdict counted. A person's verdict, recorded with feedback, overrides both. The Mnemosyne.NET.Minos package is a ready-made judge that asks a Minos.NET decision model: see Judging runs with Minos. The core package also has AddMnemosyneChatEvaluator, which judges with any Microsoft.Extensions.AI IChatClient: see Judging runs with a chat model.

// myEvaluator is your IReasonletEvaluator; register it as a singleton.
services.AddSingleton<IReasonletEvaluator>(myEvaluator);

// After the agent follows a recalled Reasonlet:
var recorded = await memory.RecordExecutionAsync(
    new ReasonletRun
    {
        Scope = scope,
        Id = match.Reasonlet.Id,
        Outcome = new ReasonletOutcome(Success: true, Duration: elapsed, Score: null),
        Provenance = new ReasonletProvenance { Source = "support-agent" },
        Question = question,
        Answer = answer,
    },
    ct);

if (recorded.IsSuccess)
{
    // Evaluator when the judge answered; Agent when it was down or the answer was not usable.
    Console.WriteLine($"Run {recorded.Value.Execution}: {recorded.Value.Source} says {recorded.Value.Success}");

    // Later, when a person says whether it worked:
    var feedback = await memory.RecordFeedbackAsync(
        scope, recorded.Value.Execution, new ReasonletFeedback(Utility: 0.2, Correctness: 0.1, Reusability: 0.5, Worked: false), ct);
    if (feedback.IsFailure)
    {
        Console.Error.WriteLine($"Feedback failed: {feedback.Error.Code}: {feedback.Error.Message}");
    }
}

Feedback with Worked null keeps an earlier verdict, so a verdict can be changed but not withdrawn.

Documentation

See the repository README.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 0 10/30/2026
0.1.0 46 10/28/2026