Skip to content

Mem0

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Mem0 OpenAPI specification using AutoSDK
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0

Usage

1
2
3
using Mem0;

using var client = new Mem0Client(apiKey);

Search Memories

Search for memories using semantic search.

1
2
3
4
5
6
7
using var client = new Mem0Client(apiKey);

// Search for relevant memories using a natural language query.
var results = await client.Memories.MemoriesSearchCreateAsync(
    query: "What are the user preferences?",
    userId: "test-user",
    topK: 5);

Add Memory

Add a memory from a conversation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using var client = new Mem0Client(apiKey);

// Add a memory from a user conversation.
var results = await client.Memories.MemoriesCreateAsync(
    messages: [
        new Dictionary<string, string?>
        {
            ["role"] = "user",
            ["content"] = "I prefer dark mode in all my applications.",
        },
    ],
    userId: "test-user");

Support

Priority place for bugs: https://github.com/tryAGI/Mem0/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Mem0/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.