🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@memory-nexus/bot-buyer-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memory-nexus/bot-buyer-sdk

Starter TypeScript SDK for bot-native buying and memory integration

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@memory-nexus/bot-buyer-sdk

Starter TypeScript SDK for third-party bot builders to integrate:

  • bot-native purchase flow (catalog -> intent -> confirm -> entitlement)
  • memory filing and semantic recall (remember, recall, connect, context)

Install

npm install @memory-nexus/bot-buyer-sdk

Quick Start

import { BotBuyerClient } from "@memory-nexus/bot-buyer-sdk";

const client = new BotBuyerClient({
  baseUrl: "https://api.memory-nexus.org",
  apiKey: process.env.MEMORY_API_KEY,
});

const catalog = await client.getCatalog();
const product = catalog.products[0];

const create = await client.createPurchaseIntent(
  {
    product_id: "memory-api-hosted",
    tier: "solo",
    preferred_rail: "card",
    buyer_type: "bot",
    buyer_ref: "bot://agent-alpha",
    max_budget_cents: 2500,
    allow_fallback: true,
    fallback_rail: "http402",
  },
  { idempotencyKey: BotBuyerClient.createIdempotencyKey("intent") },
);

await client.confirmPurchaseIntent(
  create.intent.id,
  {
    rail: "card",
    challenge_response: "pm_xxx",
    buyer_ref: "bot://agent-alpha",
  },
  { idempotencyKey: BotBuyerClient.createIdempotencyKey("confirm") },
);

await client.remember({
  content: "Decision: adopt strict gateway contract checks.",
  context: "project:alpha:decisions",
  importance: 0.9,
  metadata: { project: "alpha", kind: "decision", owner: "planner-bot" },
});

Retry Middleware

The client applies retry middleware by default:

  • retries GET, POST, DELETE
  • retries status codes: 408, 409, 425, 429, 500, 502, 503, 504
  • exponential backoff with jitter

Override defaults:

const client = new BotBuyerClient({
  retryPolicy: {
    maxAttempts: 4,
    baseDelayMs: 300,
    maxDelayMs: 5000,
  },
});

Memory Filing Pattern

Recommended bot contexts:

  • project:<name>:decisions
  • project:<name>:research
  • project:<name>:tasks
  • ops:incidents

Recommended metadata keys:

  • project
  • kind
  • owner
  • source
  • timestamp

Keywords

memory

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts