HiveLLM.Umicp 0.2.2

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

๐ŸŒ UMICP C# SDK

License .NET Version BIP-05

Production-Ready C# bindings for the Universal Matrix Intelligent Communication Protocol (UMICP) with MCP-compatible tool discovery

๐Ÿ“‹ What is UMICP?

UMICP enables efficient inter-model communication between AI systems with:

  • ๐Ÿš€ High Performance: Sub-millisecond latency, >10,000 msg/sec throughput
  • ๐Ÿ”’ Secure: Envelope-based secure communication with capability negotiation
  • ๐Ÿ“ฆ Efficient: Binary protocol with optional compression
  • โšก Real-time: WebSocket transport with HTTP support
  • ๐Ÿค Peer-to-Peer: True multiplexed architecture - each peer is server AND client
  • ๐Ÿ”ง Tool Discovery: MCP-compatible automatic tool introspection with JSON Schema

๐Ÿ› ๏ธ Installation

NuGet Package (Coming Soon)

dotnet add package Umicp

Build from Source

git clone https://github.com/hivellm/umicp.git
cd umicp/bindings/csharp
dotnet build
dotnet test

๐Ÿš€ Quick Start

๐Ÿ†• Custom Endpoint Support (v0.2.2)

using Umicp.Core.Transport;

// C# HttpClient supports custom endpoints via method parameters
var client = new HttpClient("http://localhost:8000");

// Send to Vectorizer endpoint
var response = await client.PostAsync<Envelope>("/umicp", envelope);

// Send to standard UMICP endpoint
var response2 = await client.PostAsync<Envelope>("/message", envelope);

๐Ÿ”ง Tool Discovery (v0.2.0)

using Umicp.Core.ToolDiscovery;
using System.Text.Json;

// Implement discoverable service
public class MyService : IDiscoverableService
{
    public List<OperationSchema> ListOperations()
    {
        return new List<OperationSchema>
        {
            new OperationSchema(
                "search_vectors",
                JsonDocument.Parse(@"{
                    ""type"": ""object"",
                    ""properties"": {
                        ""query"": {""type"": ""string""},
                        ""limit"": {""type"": ""integer"", ""default"": 10}
                    },
                    ""required"": [""query""]
                }").RootElement
            )
            .WithTitle("Search Vectors")
            .WithDescription("Search for semantically similar content")
            .WithAnnotations(JsonDocument.Parse(@"{""read_only"": true}").RootElement)
        };
    }

    public ServerInfo GetServerInfo()
    {
        return new ServerInfo("my-service", "1.0.0", "UMICP/0.2")
            .WithFeatures(new List<string> { "discovery", "search" })
            .WithMcpCompatible(true);
    }
}

// Use discovery helpers
var service = new MyService();
var operationsResponse = DiscoveryHelpers.GenerateOperationsResponse(service);
var schemaResponse = DiscoveryHelpers.GenerateSchemaResponse(service, "search_vectors");
var infoResponse = DiscoveryHelpers.GenerateServerInfoResponse(service);

Basic Envelope Creation

using Umicp.Core;
using Umicp.Core.Types;

// Create an envelope
var envelope = new Envelope(
    fromId: "client-001",
    toId: "server-001",
    operation: OperationType.Data
);

// Serialize to JSON
var json = envelope.ToJson();
Console.WriteLine(json);

// Using builder pattern
var builtEnvelope = new EnvelopeBuilder()
    .FromId("client-001")
    .ToId("server-001")
    .Operation(OperationType.Request)
    .Capability("version", "1.0.0")
    .Build();

Matrix Operations (SIMD Accelerated)

using Umicp.Core;

// Dot product
var a = new float[] { 1.0f, 2.0f, 3.0f };
var b = new float[] { 4.0f, 5.0f, 6.0f };
var result = Matrix.DotProduct(a, b); // 32.0

// Cosine similarity
var similarity = Matrix.CosineSimilarity(a, b);

// Matrix operations
var sum = Matrix.Add(a, b);
var scaled = Matrix.Scale(a, 2.0f);
var distance = Matrix.EuclideanDistance(a, b);

WebSocket Client

using Umicp.Core.Transport;
using Umicp.Core.Events;

// Create WebSocket client
using var client = new WebSocketClient("ws://localhost:8080");

// Subscribe to events
client.Events.On(EventType.Connect, evt =>
{
    Console.WriteLine("Connected!");
});

client.Events.On(EventType.DataReceived, evt =>
{
    var data = evt.Data["data"];
    Console.WriteLine($"Received: {data}");
});

// Connect and send data
await client.ConnectAsync();
await client.SendTextAsync("Hello, UMICP!");

Multiplexed Peer

using Umicp.Core.Peer;

// Create a peer
var peer = new MultiplexedPeer(
    localId: "peer-001",
    capabilities: new Dictionary<string, object>
    {
        ["version"] = "1.0.0",
        ["features"] = new[] { "chat", "file-transfer" }
    }
);

// Add another peer
var peerInfo = new PeerInfo("peer-002", "ws://localhost:8081");
await peer.AddPeerAsync(peerInfo);

// Send message to specific peer
var message = new EnvelopeBuilder()
    .FromId(peer.LocalId)
    .ToId("peer-002")
    .Operation(OperationType.Data)
    .Capability("message", "Hello!")
    .Build();

await peer.SendToPeerAsync("peer-002", message);

// Broadcast to all peers
await peer.BroadcastAsync(message);

Service Discovery

using Umicp.Core.Discovery;

// Create service discovery
using var discovery = new ServiceDiscovery(
    heartbeatInterval: TimeSpan.FromSeconds(10),
    serviceTimeout: TimeSpan.FromSeconds(30)
);

// Register a service
var service = new ServiceInfo
{
    Id = "service-001",
    Name = "API Gateway",
    Type = "gateway",
    Endpoint = "http://localhost:3000"
};
discovery.RegisterService(service);

// Find services
var gateways = discovery.FindByType("gateway");
var healthyServices = discovery.FindHealthyServices();

// Heartbeat
discovery.Heartbeat("service-001");

Connection Pool

using Umicp.Core.Pool;

// Create connection pool
var config = new PoolConfig
{
    MinConnections = 2,
    MaxConnections = 10,
    ConnectionTimeout = TimeSpan.FromSeconds(30)
};

using var pool = new ConnectionPool("ws://localhost:8080", config);
await pool.InitializeAsync();

// Execute with pooled connection
await pool.ExecuteAsync(async connection =>
{
    await connection.SendTextAsync("Hello from pool!");
});

Console.WriteLine($"Pool stats:");
Console.WriteLine($"  Total: {pool.TotalConnections}");
Console.WriteLine($"  Available: {pool.AvailableConnections}");
Console.WriteLine($"  Active: {pool.ActiveConnections}");

๐Ÿ“ฆ Features

โœ… Core Features

  • Protocol: Binary envelope-based communication with capability negotiation
  • Transport: WebSocket client/server, HTTP client/server
  • Multiplexed Architecture: Each peer functions as server AND client simultaneously
  • Message Types: CONTROL, DATA, ACK, ERROR, REQUEST, RESPONSE operations
  • Payload Types: Vector, Text, Metadata, Binary, JSON, Matrix data support
  • Matrix Operations: SIMD-accelerated dot product, cosine similarity, matrix multiplication
  • Compression: Gzip and Deflate compression with automatic detection and efficiency metrics
  • Event-Driven API: Observer pattern with EventEmitter
  • Peer Discovery: Automatic handshake (HELLO โ†’ ACK) with metadata exchange
  • Service Discovery: Automatic service registration and discovery with health checks
  • Connection Pooling: Efficient connection management with automatic scaling
  • Server Support: Production-ready WebSocket and HTTP servers with multi-client handling

๐ŸŽฏ Feature Matrix

Feature Status
Envelope/Frame โœ…
Serialization (JSON) โœ…
Message Types โœ…
Payload Types โœ…
Matrix Operations โœ… (SIMD)
WebSocket Client โœ…
HTTP Client โœ…
WebSocket Server โœ…
HTTP Server โœ…
Multiplexed Peer โœ…
Event System โœ…
Service Discovery โœ…
Connection Pooling โœ…
Compression โœ… (Gzip/Deflate)
Security/Encryption ๐Ÿ“‹

Legend: โœ… Implemented | ๐Ÿšง In Progress | ๐Ÿ“‹ Planned

๐Ÿ“š Documentation

Comprehensive documentation and review reports are available in the docs directory:

  • Executive Summary - High-level overview for stakeholders
  • Technical Report - Detailed technical implementation
  • Implementation Review - Comprehensive code review
  • Test Coverage Report - Testing analysis and coverage
  • Final Report - Consolidated evaluation
  • Second Review - Risk assessment and recommendations
  • Third Review - Developer experience and NuGet readiness

๐Ÿ“š Examples

Check the Examples directory for comprehensive examples:

  1. 01_BasicEnvelope.cs - Envelope creation and serialization
  2. 02_MatrixOperations.cs - SIMD-accelerated matrix operations
  3. 03_WebSocketClient.cs - WebSocket client usage
  4. 04_MultiplexedPeer.cs - Peer-to-peer communication
  5. 05_ServiceDiscovery.cs - Service registration and discovery
  6. 06_Compression.cs - Data compression with Gzip and Deflate
  7. 07_WebSocketServer.cs - Multi-client WebSocket server
  8. 08_HttpServer.cs - HTTP server with routing

Run examples:

cd Umicp.Examples
dotnet run

๐Ÿงช Testing

Run unit tests:

cd Umicp.Tests
dotnet test

Run with coverage:

dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

๐Ÿ“Š Performance

  • SIMD Acceleration: Matrix operations use System.Numerics.Vectors for hardware acceleration
  • Zero-Copy: Efficient memory management with minimal allocations
  • Async/Await: Full async support throughout the API
  • Connection Pooling: Reduces connection overhead with intelligent pooling

๐Ÿ—๏ธ Architecture

Umicp.Core/
โ”œโ”€โ”€ Types/              # Core type definitions
โ”‚   โ”œโ”€โ”€ OperationType.cs
โ”‚   โ”œโ”€โ”€ PayloadType.cs
โ”‚   โ”œโ”€โ”€ EncodingType.cs
โ”‚   โ”œโ”€โ”€ ConnectionState.cs
โ”‚   โ”œโ”€โ”€ PayloadHint.cs
โ”‚   โ””โ”€โ”€ TransportStats.cs
โ”œโ”€โ”€ Exceptions/         # Exception classes
โ”‚   โ””โ”€โ”€ UmicpException.cs
โ”œโ”€โ”€ Events/             # Event system
โ”‚   โ””โ”€โ”€ EventEmitter.cs
โ”œโ”€โ”€ Transport/          # Transport layer
โ”‚   โ”œโ”€โ”€ ITransport.cs
โ”‚   โ”œโ”€โ”€ WebSocketClient.cs
โ”‚   โ””โ”€โ”€ HttpClient.cs
โ”œโ”€โ”€ Peer/               # Peer-to-peer
โ”‚   โ”œโ”€โ”€ MultiplexedPeer.cs
โ”‚   โ”œโ”€โ”€ PeerConnection.cs
โ”‚   โ”œโ”€โ”€ PeerInfo.cs
โ”‚   โ””โ”€โ”€ HandshakeProtocol.cs
โ”œโ”€โ”€ Discovery/          # Service discovery
โ”‚   โ”œโ”€โ”€ ServiceDiscovery.cs
โ”‚   โ””โ”€โ”€ ServiceInfo.cs
โ”œโ”€โ”€ Pool/               # Connection pooling
โ”‚   โ”œโ”€โ”€ ConnectionPool.cs
โ”‚   โ””โ”€โ”€ PoolConfig.cs
โ”œโ”€โ”€ Envelope.cs         # Core envelope class
โ””โ”€โ”€ Matrix.cs           # Matrix operations

๐Ÿ”— Part of HiveLLM Ecosystem

UMICP is a core component of the HiveLLM ecosystem, providing high-performance binary protocol for agent-to-agent communication:

  • Vectorizer: Semantic search and vector database
  • Task Queue: Workflow orchestration
  • Agent Framework: Multi-language agent platform
  • Voxa: Voice AI assistant

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

๐Ÿ“„ License

MIT License - See LICENSE file for details.

๐Ÿ“ž Support

  • Open an issue on GitHub
  • Join our Discord community
  • Email: team@hivellm.org

BIP: BIP-05 - Universal Matrix Intelligent Communication Protocol Status: โœ… Production Ready (C# v0.2.2) Repository: HiveLLM UMICP C# Implementation

๐Ÿ“ Version 0.2.2 Release Notes

This release focuses on SDK consistency and custom endpoint support:

  • โœ… All SDKs aligned to version 0.2.2 for easier cross-language compatibility
  • โœ… Custom endpoint support - compatible with Vectorizer (/umicp) and standard servers (/message)
  • โœ… No breaking changes - fully backward compatible
  • โœ… Comprehensive documentation with examples for all languages
  • โœ… Integration tests for Vectorizer service

See CHANGELOG.md for detailed changes.

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

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.2.2 150 10/17/2025
0.2.0 201 10/16/2025
0.1.3 135 10/12/2025

v0.2.2: Custom Endpoint Support. Features: Configurable endpoint paths for compatibility with different servers (e.g., Vectorizer uses /umicp). All SDKs updated to 0.2.2. No breaking changes - backward compatible with defaults.