Skip to content

Getting started

This guide takes you from zero to storing and recalling a memory with the .NET SDK.

The fastest way to a fully working server — graph DB, embeddings, and an LLM all included — is the batteries-included compose. Everything runs on CPU (no GPU needed):

Terminal window
curl -O https://raw.githubusercontent.com/cortadel/cortadel/main/docker-compose.yml
docker compose up

First run pulls a few GB (images + models); then open the dashboard at http://localhost:3001 and check health:

Terminal window
curl http://localhost:3001/api/health
Terminal window
dotnet add package Cortadel.Sdk
using Cortadel.Sdk;
using var cortadel = new CortadelClient("http://localhost:3001", userId: "alice");
// Store a memory. Entities and categories are extracted in the background.
var created = await cortadel.AddAsync("Alice prefers dark mode and ships on Fridays.");
Console.WriteLine($"stored {created.Id} ({created.Event})");
// Recall with hybrid search.
var hits = await cortadel.SearchAsync("what are alice's working preferences?", new() { TopK = 5 });
foreach (var h in hits.Results)
Console.WriteLine($"{h.RrfScore:F2} {h.Content}");

Let the server distill atomic facts from a transcript instead of writing them yourself:

await cortadel.AddConversationAsync(new[]
{
new ChatMessage("user", "I just moved to Berlin and I'm vegetarian."),
new ChatMessage("assistant", "Got it — Berlin, vegetarian. I'll keep that in mind."),
});
var page = await cortadel.ListAsync(new() { Page = 1, Size = 20 });
Console.WriteLine($"{page.Total} memories across {page.Pages} pages");
var detail = await cortadel.GetAsync(page.Items[0].Id); // null if not found
await cortadel.DeleteAsync(new[] { page.Items[0].Id });