SerialMemory Client SDKs

November 26, 2025 · View on GitHub

Official client libraries for SerialMemory with built-in resilience patterns.

Available SDKs

SDKPackageStatus
.NETSerialMemory.Client✅ Production Ready
Node.js/TypeScript@serialmemory/client✅ Production Ready

Features

All SDKs provide:

  • Authentication - API key and JWT token support
  • Automatic Retry - Exponential backoff with jitter
  • Rate Limit Handling - Respects retry-after headers
  • Circuit Breaker - Protects against cascading failures
  • Usage Limit Errors - Typed exceptions for plan limits
  • Multi-tenant - Tenant ID header support

Quick Comparison

Feature.NETNode.js
Runtime.NET 8+Node.js 18+
DependenciesPollyZero deps (native fetch)
Type SafetyC# recordsFull TypeScript
Asyncasync/awaitasync/await

Installation

.NET

# Via NuGet (when published)
dotnet add package SerialMemory.Client

# Or reference local project
dotnet add reference path/to/SerialMemory.Client.csproj

Node.js

# Via npm (when published)
npm install @serialmemory/client

# Or link local package
cd sdks/node && npm link
cd your-project && npm link @serialmemory/client

Basic Usage

.NET

using SerialMemory.Client;

var client = new SerialMemoryClient(new SerialMemoryOptions
{
    BaseUrl = "http://localhost:5000",
    ApiKey = "your-api-key"
});

// Search
var results = await client.SearchAsync("query");

// Ingest
var memory = await client.IngestAsync("Content to remember");

// User persona
var persona = await client.GetUserPersonaAsync();

Node.js / TypeScript

import { SerialMemoryClient } from '@serialmemory/client';

const client = new SerialMemoryClient({
  baseUrl: 'http://localhost:5000',
  apiKey: 'your-api-key'
});

// Search
const results = await client.search('query');

// Ingest
const memory = await client.ingest('Content to remember');

// User persona
const persona = await client.getUserPersona();

Error Handling

Both SDKs provide typed exceptions:

ExceptionHTTP CodeDescription
RateLimitExceededError429Too many requests, retry after delay
UsageLimitExceededError402Plan quota exhausted
AuthenticationError401/403Invalid credentials
CircuitBreakerOpenErrorN/AService temporarily unavailable

Examples

Each SDK includes example projects:

  • Personal Assistant - AI second brain pattern
  • Project Memory - Multi-project isolation

See examples/ for standalone example projects.

Configuration Reference

Option.NETNode.jsDefault
Base URLBaseUrlbaseUrlRequired
API KeyApiKeyapiKey-
JWT TokenJwtTokenjwtToken-
Tenant IDTenantIdtenantId-
TimeoutTimeouttimeout30s
Max RetriesMaxRetriesmaxRetries3
Retry Delay-retryDelay500ms
Circuit Breaker DurationCircuitBreakerDurationcircuitBreakerDuration30s

Building from Source

.NET SDK

cd sdks/dotnet
dotnet build SerialMemory.Client
dotnet pack SerialMemory.Client -c Release

Node.js SDK

cd sdks/node
npm install
npm run build
npm pack

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

License

MIT