AI.MemOS 0.0.1

dotnet add package AI.MemOS --version 0.0.1
                    
NuGet\Install-Package AI.MemOS -Version 0.0.1
                    
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="AI.MemOS" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AI.MemOS" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="AI.MemOS" />
                    
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 AI.MemOS --version 0.0.1
                    
#r "nuget: AI.MemOS, 0.0.1"
                    
#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 AI.MemOS@0.0.1
                    
#: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=AI.MemOS&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=AI.MemOS&version=0.0.1
                    
Install as a Cake Tool

该 NuGet 包用于测试 MAF 智能体接入 MemOS 的记忆云平台接口。使用前需在云平台申请 Token(目前免费):https://memos.openmem.net/cn/pricing/

使用方式

1. 定义 HttpClient

using HttpClient mem0sHttpClient = new();
mem0sHttpClient.BaseAddress = new Uri("https://memos.memtensor.cn/api/openmem");
mem0sHttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", "mpg-****************你的token");

var userId="1234",ConversationId="12345678";
var chatoptions = new ChatClientAgentOptions()
{
    Name = $"{userId}",
    AIContextProviderFactory = ctx => new MemOSProvider(mem0sHttpClient, new MemOSProviderScope()
    {
        ConversationId = ConversationId,
        UserId = userId,
        AgentId = "agent",
        AppId = "app1",
        // KeyWords = new List<string> { "喜欢", "订单", "住址" }, // 只记忆关键词
        ExcludedKeyWords = new List<string>()
        {
            "你知道", "想问下", "我该", "吗", "哪儿呢", "在哪", "怎么", "怎样", "请问", "?", "?"
        }, // 忽略记忆的关键词
        FeedBackKeyWords = new List<string>()
        {
            "不对", "错了", "得这样", "我现在不喜欢", "我不再", "你说的不对",
            "我现在喜欢", "我已经不喜欢", "我开始讨厌", "我现在已经不喜欢"
        } // 修正记忆的关键词
    }, new Mem0SearchProviderScope()
    {
        ConversationId = ConversationId,
        UserId = userId.ToString(),
        AllowKnowledgebaseIds = new string[] { "base14282445-cf2e-4adc-8797-53bb938e638a" } // 使用的知识库 ID
    })
    // 使用 MemOS
};

AIAgent uagent = _chatClient.CreateAIAgent(chatoptions);

// 新对话线程处理
await foreach (var chunk in uagent.RunStreamingAsync(msg))
{
    Console.WriteLine(chunk); // 输出
}
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.0.1 114 12/29/2025

memos  使用云平台接口  ,非本地部署版  详情查看 https://memos-docs.openmem.net/