WeaveLLM.Core 0.1.0-alpha

This is a prerelease version of WeaveLLM.Core.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package WeaveLLM.Core --version 0.1.0-alpha
                    
NuGet\Install-Package WeaveLLM.Core -Version 0.1.0-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WeaveLLM.Core" Version="0.1.0-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WeaveLLM.Core" Version="0.1.0-alpha" />
                    
Directory.Packages.props
<PackageReference Include="WeaveLLM.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WeaveLLM.Core --version 0.1.0-alpha
                    
#r "nuget: WeaveLLM.Core, 0.1.0-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WeaveLLM.Core@0.1.0-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WeaveLLM.Core&version=0.1.0-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=WeaveLLM.Core&version=0.1.0-alpha&prerelease
                    
Install as a Cake Tool

WeaveLLM ๐Ÿงต

The AI orchestration framework built for .NET โ€” strongly typed, production-ready, and genuinely extensible.

NuGet Build License: MIT .NET

Strongly typed LangChain alternative for .NET โ€” chains, agents, RAG, and multi-agent graphs built for production.


Why WeaveLLM?

Python's AI tooling is powerful but chaotic. LangChain suffers from abstraction leakage, opaque errors, and duck-typing that explodes at runtime. .NET developers deserve better.

LangChain (Python) WeaveLLM (.NET)
Type safety Duck typed Full generics + compile-time validation
Error handling Exceptions everywhere ChainResult<T> โ€” errors as values
Streaming Inconsistent Native IAsyncEnumerable<T> throughout
DI integration Manual wiring First-class IServiceCollection builder
Cancellation Often ignored CancellationToken on every async call
Observability Third-party plugins Native OpenTelemetry โ€” traces + metrics
Agent loops LangGraph AgentGraph<TState> โ€” type-safe graph engine

Quick Start

dotnet add package WeaveLLM.Core
dotnet add package WeaveLLM.Providers
dotnet add package WeaveLLM.Extensions.DependencyInjection
// Program.cs
builder.Services
    .AddWeaveLLM()
    .AddOpenAI(apiKey: "sk-...")
    .AddInMemoryMemory()
    .AddToolRegistry(r => r.RegisterFromObject(new WebSearchTool()))
    .AddReActAgent();

// In your controller / minimal API:
var result = await agent.RunAsync("What is the weather in Sheffield today?");
Console.WriteLine(result.FinalAnswer);

Core Concepts

Chains โ€” the atomic unit

// Every chain is IChain<TInput, TOutput> โ€” no surprises at runtime.
var result = await model.ChatAsync(
    messages: [Message.User("Explain transformers in one paragraph")],
    options: LLMOptions.Balanced()
);

if (result.IsSuccess)
    Console.WriteLine(result.Value.Content);
else
    Console.WriteLine($"Failed: {result.Error.Code} โ€” {result.Error.Message}");

Streaming โ€” native IAsyncEnumerable

await foreach (var chunk in model.StreamChatAsync([Message.User("Write a poem")]))
{
    Console.Write(chunk); // tokens arrive as they're generated
}

Tool use โ€” zero boilerplate

public sealed class MyTools
{
    [LLMTool("search_web", "Search the internet for current information")]
    public async Task<string> SearchAsync(
        [Description("The search query")] string query,
        [Description("Max results to return")] int maxResults = 5)
    {
        // your implementation
        return searchResults;
    }
}

// Register โ€” that's it. WeaveLLM generates the JSON schema automatically.
registry.RegisterFromObject(new MyTools());

RAG Pipeline

// Index documents
var indexResult = await rag.IndexAsync([
    new Document { Content = File.ReadAllText("docs.txt"), Source = "docs.txt" }
]);

// Query with hybrid search
var answer = await rag.QueryAsync("How do I configure authentication?");
Console.WriteLine(answer.Value);

Multi-Agent Graphs โ€” the LangGraph equivalent

var graph = AgentGraph<ResearchState>.Create()
    .AddNode("researcher", async (state, ctx, ct) => {
        state.Notes = await ResearchTopic(state.Question);
        return state;
    })
    .AddNode("writer", async (state, ctx, ct) => {
        state.Draft = await WriteDraft(state.Notes);
        return state;
    })
    .AddNode("critic", async (state, ctx, ct) => {
        state.NeedsRevision = await Critique(state.Draft);
        return state;
    })
    .SetEntryPoint("researcher")
    .AddEdge("researcher", "writer")
    .AddEdge("writer", "critic")
    .AddConditionalEdge("critic",
        state => state.NeedsRevision ? "revise" : "finalize",
        new() { ["revise"] = "writer", ["finalize"] = "done" })
    .SetEndPoint("done");

var result = await graph.RunAsync(new ResearchState { Question = "Explain quantum computing" });

Middleware โ€” cross-cutting concerns

// Apply retry + caching to any chain
var chain = myChain
    .WithMiddleware(new RetryMiddleware<Input, Output>(maxRetries: 3))
    .WithMiddleware(new CacheMiddleware<Input, Output>(ttl: TimeSpan.FromMinutes(10)));

Supported Providers

Provider Chat Streaming Embeddings
OpenAI (GPT-4o, o1, o3) โœ… โœ… โœ…
Anthropic (Claude 3.5, 4) โœ… โœ… โ€”
Azure OpenAI โœ… โœ… โœ…
Ollama (local) โœ… โœ… โœ…
Hugging Face โœ… โ€” โœ…
Google Gemini ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ

Package Structure

WeaveLLM.Core                          โ€” Interfaces, models, base abstractions
WeaveLLM.Providers                     โ€” OpenAI, Anthropic, Azure, Ollama providers
WeaveLLM.Memory                        โ€” Redis, Postgres, CosmosDB memory stores
WeaveLLM.Observability                 โ€” OpenTelemetry, metrics, LLM evaluators
WeaveLLM.Extensions.DependencyInjection โ€” IServiceCollection fluent builder

Roadmap

  • Core chain abstractions + middleware pipeline
  • OpenAI + Anthropic providers
  • In-memory store + RAG pipeline
  • ReAct agent + AgentGraph
  • OpenTelemetry integration
  • Redis + pgvector memory backends
  • Ollama local model support
  • Blazor visual chain builder (ChainForge)
  • Prompt versioning + A/B testing server (PromptVault)
  • RAGAS-equivalent evaluation suite (EvalKit.NET)
  • Azure Aspire integration dashboard

Contributing

Contributions welcome. Please read CONTRIBUTING.md first.


License

MIT โ€” free for personal and commercial use. See LICENSE.


Built with โค๏ธ for the .NET community. If this project helps you, please โญ the repo.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on WeaveLLM.Core:

Package Downloads
WeaveLLM.Providers

OpenAI, Anthropic, Azure OpenAI, and Ollama providers for WeaveLLM

WeaveLLM.Extensions.DependencyInjection

ASP.NET Core and IServiceCollection integration for WeaveLLM

WeaveLLM.Observability

OpenTelemetry tracing, metrics, and LLM evaluation for WeaveLLM

WeaveLLM.Testing

Pre-built test doubles and fakes for unit-testing WeaveLLM integrations โ€” no real API calls required.

WeaveLLM.Memory

Memory and vector store implementations for WeaveLLM โ€” in-memory, PostgreSQL/pgvector, and Qdrant stores.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.1-alpha 95 5/8/2026
0.2.0-alpha 66 5/7/2026
0.1.0-alpha 70 4/26/2026