Agentic

A lightweight .NET library for building LLM-powered agents.

Get Started View on GitHub


NuGet License: MIT


Agentic is a lightweight .NET library for building LLM-powered agents with streaming chat, MCP tool hosting, context compaction, and vector storage — all via a clean, attribute-driven API.

Features

FeatureDescription
ILLMBackendUnified abstraction over any inference source; swap backends without touching agent code
OpenAIBackendOpenAI-compatible REST client with streaming, embeddings, vision and health-check
NativeBackendLocal llama.cpp inference with auto-install from GitHub releases
LlamaRuntimeInstallerOn-demand runtime installer for CPU, CUDA and Vulkan on Windows and Linux
AgentMulti-turn streaming agent with automatic MCP tool orchestration
Image InputSend images alongside text as URL, local file, or base64
WorkflowsOrdered multi-step execution with per-step async guardrails and retry
Tool SystemDefine tools with [Tool] / [ToolParam] attributes; zero boilerplate
Tool ContextHTTP headers forwarded to tool methods via ToolContext
MCP ServerExpose any IAgentToolSet over HTTP as a Model Context Protocol server
Context CompactionAuto-summarise older history into a structured checkpoint
Vector StorageIStore / ICollection<T> with SQLite or PostgreSQL + pgvector
Reasoning ControlControl chain-of-thought effort at global, agent, or request level
Inference ConfigSampling and penalty parameters with three-level override

Installation

dotnet add package Theoistic.Agentic

Requirements: .NET 10 · ASP.NET Core (included via Microsoft.AspNetCore.App framework reference)

Quick Example

using Agentic;

// 1. Connect to any OpenAI-compatible endpoint
var lm = new OpenAIBackend(new LMConfig
{
    Endpoint  = "http://localhost:1234",
    ModelName = "your-model-name",
});

// 2. Create an agent
var agent = new Agent(lm, new AgentOptions
{
    SystemPrompt = "You are a helpful assistant.",
    OnEvent      = e =>
    {
        if (e.Kind == AgentEventKind.TextDelta)
            Console.Write(e.Text);
    },
});

// 3. Chat
await agent.ChatStreamAsync("Hello! What can you do?");

Read the full Getting Started guide →