Add agent system with Core and Librarian agent implementations

Define IAgent interface and implement CoreAgent (main conversational
agent) and LibrarianAgent (knowledge retrieval agent). Includes DI
service collection extensions for agent registration.
This commit is contained in:
2026-04-04 04:10:51 +02:00
parent 45d3ee1ed6
commit fc71d848e2
6 changed files with 206 additions and 0 deletions
@@ -0,0 +1,32 @@
using Luna.Agents.Abstractions;
using Luna.Agents.Core;
using Luna.Agents.Librarian;
using Luna.Configuration.Extensions;
using Microsoft.Extensions.DependencyInjection;
namespace Luna.Agents.Extensions;
public static class ServiceCollectionExtensions
{
extension(IServiceCollection services)
{
public IServiceCollection AddAgents()
{
services.AddAgent<CoreAgent>();
services.AddAgent<LibrarianAgent>();
return services;
}
public IServiceCollection AddAgent<TAgent>(string? name = null)
where TAgent : class, IAgent
{
name ??= TAgent.Name;
services.AddAgentOptions(name);
services.AddKeyedTransient<IAgent, TAgent>(name);
return services;
}
}
}