.NET
Install the .NET SDK and start building AI applications with semantic memory.
Installation
dotnet add package GraphlitQuick 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)
Common Patterns
Ingest Content
Search Memory
Chat with Context
Next Steps
Last updated