WeaveLLM.Core
0.1.0-alpha
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
<PackageReference Include="WeaveLLM.Core" Version="0.1.0-alpha" />
<PackageVersion Include="WeaveLLM.Core" Version="0.1.0-alpha" />
<PackageReference Include="WeaveLLM.Core" />
paket add WeaveLLM.Core --version 0.1.0-alpha
#r "nuget: WeaveLLM.Core, 0.1.0-alpha"
#:package WeaveLLM.Core@0.1.0-alpha
#addin nuget:?package=WeaveLLM.Core&version=0.1.0-alpha&prerelease
#tool nuget:?package=WeaveLLM.Core&version=0.1.0-alpha&prerelease
WeaveLLM ๐งต
The AI orchestration framework built for .NET โ strongly typed, production-ready, and genuinely extensible.
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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
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 |