Mistral.Agents.Net 0.1.0

dotnet add package Mistral.Agents.Net --version 0.1.0
                    
NuGet\Install-Package Mistral.Agents.Net -Version 0.1.0
                    
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="Mistral.Agents.Net" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mistral.Agents.Net" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Mistral.Agents.Net" />
                    
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 Mistral.Agents.Net --version 0.1.0
                    
#r "nuget: Mistral.Agents.Net, 0.1.0"
                    
#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 Mistral.Agents.Net@0.1.0
                    
#: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=Mistral.Agents.Net&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Mistral.Agents.Net&version=0.1.0
                    
Install as a Cake Tool

Mistral.Agents.Net: the Mistral Agents API from .NET

unofficial .net client for the Mistral Agents & Conversations API. the community .net sdks cover chat completions, embeddings and function calling well; this covers the agentic layer they don't: persistent agents, stateful conversations, built-in connectors, and multi-agent handoffs.

not affiliated with Mistral AI. complements tghamm/Mistral.SDK rather than competing with it.

what you get

  • agents: create, list and fetch persistent agents (model, instructions, tools, handoffs)
  • conversations: stateful, resumable conversations, not just stateless chat completions
  • built-in connectors as tools: web search, code interpreter, image generation, document library (RAG)
  • handoffs: multi-agent orchestration, one agent delegating to others
  • function tools: expose your own c# code, execute it client-side, return the result
  • net8.0, zero dependencies, async-first with CancellationToken, typed requests with a raw JsonElement escape hatch, testable via an injectable HttpClient

quickstart

dotnet add package Mistral.Agents.Net
using Mistral.Agents.Net;
using Mistral.Agents.Net.Models;

using var client = new MistralAgentsClient(apiKey);

var agent = await client.CreateAgentAsync(new CreateAgentRequest
{
    Model = "mistral-medium-latest",
    Name = "Analyst",
    Instructions = "Use the code interpreter for math and web search for current facts.",
    Tools = { AgentTool.CodeInterpreter(), AgentTool.WebSearch() },
});

using var turn = await client.StartConversationAsync(new StartConversationRequest
{
    AgentId = agent.Id,
    Inputs = "What is 15% of last quarter's revenue if it was 12.4M?",
});

Console.WriteLine(turn.OutputText);

your own code as a tool

agentRequest.Tools.Add(AgentTool.FunctionTool(FunctionDefinition.FromJsonSchema(
    "get_internal_metric", "Returns a private company metric.",
    """{"type":"object","properties":{"name":{"type":"string"}}}""")));

// when the agent calls it:
foreach (var call in turn.FunctionCalls)
{
    using var args = call.ParseArguments();               // see note below
    var result = LookUp(call.FunctionName!, args.RootElement);
    using var next = await client.SubmitToolResultAsync(turn.ConversationId!, call.ToolCallId!, result);
}

Wire-format note: the Agents API returns function-call arguments as a JSON string, not a nested object (a common LLM-API quirk the docs don't call out). ParseArguments() normalizes both forms so you always get a usable document. This one cost a live debugging session, so it's handled in the library.

multi-agent handoffs

var analyst = await client.CreateAgentAsync(new CreateAgentRequest
{
    Model = "mistral-medium-latest",
    Name = "Analyst",
    Handoffs = new List<string> { researchAgent.Id! }, // delegate research to another agent
    Tools = { AgentTool.CodeInterpreter() },
});

project layout

path what
src/Mistral.Agents.Net the client
tests/Mistral.Agents.Net.SmokeTests offline API tests against a fake HTTP handler, no network/credits
samples/EnterpriseMultiAgent a financial-analyst agent that computes, researches via handoff, and calls your private data

run the tests

dotnet run --project tests/Mistral.Agents.Net.SmokeTests

roadmap

  • streaming conversations (SSE)
  • Connectors / MCP server registration
  • Microsoft.Extensions.AI bridge so it drops into the .NET AI ecosystem

license

MIT

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.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 35 7/22/2026