Lilith.cscsharp

Documentation

Lilith (Version 3)

Version 3 Lilith agent library. Entry point: Lilith.cs with partials under Boot/, Chat/, Ollama/, and SystemPrompt/.

Build the solution or run python ../Build-v3.py from this tree.

using Agent.Core;using Agent.Core.Logging;namespace Lilith.Agent;public record LilithCredentials(    string Model = "gemma4",    string EmbeddingModel = "nomic-embed-text",    string SystemPrompt = Lilith.DefaultSystemPrompt,    string AgentName = "Lilith");public partial class Lilith(Action<LogEntry> onLog, LilithCredentials? credentials = null){    private readonly LilithCredentials _credentials = credentials ?? new();    public LilithCredentials Credentials => _credentials;    public Logger Logger { get; } = new(onLog);    private Workspace? _workspace;    public Workspace? Workspace    {        get => _workspace;        set        {            _workspace = value;            if (_client is not null)            {                _client.InitMemory(GetMemoryFilePath());            }        }    }    private string GetMemoryFilePath()    {        if (_workspace is not null && !string.IsNullOrWhiteSpace(_workspace.ConfigFolder))        {            return System.IO.Path.Combine(_workspace.ConfigFolder, "memory.json");        }        return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "memory.json");    }    public string Name => _client?.AgentName ?? "Lilith";    public Action<string>? OnVoiceChanged { get; set; }}