For the complete documentation index, see llms.txt. This page is also available as Markdown.

.NET

Install the .NET SDK and start building AI applications with semantic memory.

Build AI applications with C# using the Graphlit SDK.

New to Graphlit? Complete the Quickstart tutorial for a hands-on introduction.


Installation

Install the Graphlit client with NuGet:

dotnet add package Graphlit

Requirements:


Quick Start

using System;
using System.Net.Http;
using System.Threading.Tasks;
using Graphlit;

class Program
{
    static async Task Main(string[] args)
    {
        // Reads from environment variables
        using var httpClient = new HttpClient();
        var graphlit = new Graphlit(
            httpClient,
            organizationId: Environment.GetEnvironmentVariable("GRAPHLIT_ORGANIZATION_ID"),
            environmentId: Environment.GetEnvironmentVariable("GRAPHLIT_ENVIRONMENT_ID"),
            jwtSecret: Environment.GetEnvironmentVariable("GRAPHLIT_JWT_SECRET")
        );
        
        // Ingest content
        var response = await graphlit.IngestText.ExecuteAsync(
            name: "Product Requirements",
            text: "Our AI agent needs persistent memory across sessions..."
        );
        
        response.EnsureNoErrors();
        
        Console.WriteLine($"✅ Memory created: {response.Data?.IngestText?.Id}");
    }
}

Configuration

Environment Variables (Production)

Option 1: launchSettings.json (Development)

Option 2: User Secrets (Development)

Option 3: appsettings.json (Never commit secrets)

Load with IConfiguration:


Common Patterns

Ingest Content

Search Memory

Chat with Context


Next Steps

Quickstarts:

Examples:

Resources:

Last updated