Guides

.NET quickstart

Install the .NET SDK and give your agent durable, entity-scoped memory with async C#.

Aether's .NET SDK is a positioning wedge: no dedicated memory layer in the Mem0/Letta/Zep/Cognee set ships a first-party .NET SDK, and Aether ships Python, TypeScript, Go, and .NET from one surface. The NuGet package is named AetherDb.Sdk, but the namespace you import in code is Aether.Sdk.

1. Install the SDK

Bash
dotnet new console -n AetherQuickstart
cd AetherQuickstart
dotnet add package AetherDb.Sdk

Set your API key:

Bash
export AETHER_API_KEY="your-api-key"

The SDK targets .NET 8.0 and .NET Standard 2.0. All network operations are async and return Task or Task<T>.

2. Remember and recall

Replace Program.cs with this complete example:

C#
using Aether.Sdk;

using var memory = new Memory("user-42", new MemoryOptions
{
    ApiKey = Environment.GetEnvironmentVariable("AETHER_API_KEY"),
});

var remembered = await memory.RememberAsync("Prefers concise weekly summaries");
Console.WriteLine($"Remembered {remembered.Id}");

var memories = await memory.RecallAsync("communication style", k: 3);
foreach (var item in memories)
{
    Console.WriteLine($"{item.Score} {item.Text}");
}

Run it:

Bash
dotnet run

Expected output:

text
Remembered doc_...
0.73 Prefers concise weekly summaries

3. Raw document API

Use AetherClient directly when you need source-grounded retrieval over documents instead of short entity memory:

C#
using var client = new AetherClient(new AetherClientOptions
{
    ApiKey = Environment.GetEnvironmentVariable("AETHER_API_KEY"),
});

var doc = await client.InsertTextAsync(
    "Employees accrue 20 days of PTO per year.",
    "pto-policy.txt");

var passages = await client.RetrieveAsync("How much PTO do employees get?", k: 3);
foreach (var passage in passages)
{
    Console.WriteLine(passage.Content);
}

4. Handle errors

Catch AetherApiException for HTTP responses from Aether and inspect StatusCode, ErrorCode, and IsRetryable.

C#
using System.Net;
using Aether.Sdk;

try
{
    await memory.RememberAsync("Important note");
}
catch (AetherApiException ex) when (ex.StatusCode == HttpStatusCode.TooManyRequests)
{
    Console.WriteLine("Rate limited. Back off and retry after the retry-after header window.");
}
catch (AetherApiException ex) when (ex.ErrorCode == "free_limit_exceeded")
{
    Console.WriteLine("Plan limit reached. Upgrade before retrying this insert.");
}
catch (AetherApiException ex) when (ex.IsRetryable)
{
    Console.WriteLine($"Transient Aether error: {ex.StatusCode}");
}

5. Next steps