npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kyros.494/sdk

v0.1.3

Published

TypeScript SDK for Kyros — persistent memory for AI agents

Readme

Kyros TypeScript SDK

Official TypeScript/JavaScript SDK for Kyros — Persistent Memory for AI Agents.

The Kyros TypeScript SDK provides a type-safe, native interface to the Kyros Memory API, implemented using the standard Fetch API. It allows you to store, recall, and manage persistent episodic, semantic, and procedural memories for autonomous agents.


Quick Start

Installation

npm install @kyros.494/sdk

Basic Usage

import { KyrosClient } from '@kyros.494/sdk';

// Initialize the client
const client = new KyrosClient({
  apiKey: 'your-api-key',
  baseUrl: 'http://localhost:8000'
});

async function main() {
  // Store an episodic event
  const response = await client.remember('agent-123', 'User prefers TypeScript and dark mode', {
    importance: 0.8
  });

  // Recall memories using semantic search
  const results = await client.recall('agent-123', 'What are the user\'s preferences?');

  for (const memory of results.results) {
    console.log(`${memory.content} (score: ${memory.relevance_score})`);
  }
}

main().catch(console.error);

Configuration

Initialize the client with configuration parameters or environment variables:

| Option | Environment Variable | Default | Description | |--------|----------------------|---------|-------------| | apiKey | KYROS_API_KEY | Required | API key for authentication | | baseUrl | KYROS_BASE_URL | https://api.kyros.ai | Target server URL | | timeout | — | 30000 (ms) | Request timeout limit |

// Option 1: Pass config directly
const client = new KyrosClient({
  apiKey: 'your-api-key',
  baseUrl: 'http://localhost:8000',
  timeout: 15000
});

// Option 2: Fallback to environment variables
// Make sure KYROS_API_KEY is defined in process.env
const client = new KyrosClient();

Core Features

Episodic Memory

Episodic memory stores chronological conversation histories, actions, and observations.

// Store a memory
const response = await client.remember('agent-123', 'User asked about corporate pricing tiers', {
  contentType: 'text',
  role: 'user',
  sessionId: 'session-456',
  importance: 0.7,
  metadata: { category: 'sales' }
});

// Recall memories
const results = await client.recall('agent-123', 'What corporate queries did we receive?', {
  k: 5,
  minRelevance: 0.5
});

// Delete a memory
await client.forget('agent-123', 'memory-uuid-here');

Semantic Memory

Semantic memory stores structured facts as subject-predicate-object triples and updates confidence scores automatically when conflicts arise.

// Store a semantic fact
const fact = await client.storeFact(
  'agent-123',
  'user',
  'prefers',
  'TypeScript',
  {
    confidence: 0.95,
    sourceType: 'explicit'
  }
);

// Query facts
const results = await client.queryFacts('agent-123', 'user language preferences', 10);

Procedural Memory

Procedural memory stores agent skills, workflows, and procedures, calculating matching execution patterns based on task descriptions.

// Store a procedure workflow
const procedure = await client.storeProcedure(
  'agent-123',
  'Deploy Web App',
  'Standard procedure to deploy static React applications',
  'deployment',
  [
    { action: 'install', params: { cmd: 'npm install' } },
    { action: 'build', params: { cmd: 'npm run build' } },
    { action: 'sync', params: { bucket: 's3://app' } }
  ]
);

// Match execution pattern
const matches = await client.matchProcedure(
  'agent-123',
  'I need to deploy our new web interface to production',
  { k: 3 }
);

// Report execution outcome
const outcome = await client.reportOutcome('proc-uuid-here', true, {
  durationMs: 42000
});

Unified Search

Query across episodic, semantic, and procedural memory stores simultaneously.

const results = await client.search('agent-123', 'deployment configurations', 10);

Advanced Features

Causal Reasoning

Retrieve parent-child dependency chains to audit reasoning patterns.

const explanation = await client.explain('agent-123', 'memory-uuid-here', 3);

Integrity Verification

Audit cryptographic signatures of the memory ledger.

// Get proof block
const proof = await client.getMemoryProof('memory-uuid-here');

// Audit agent integrity tree
const audit = await client.auditIntegrity('agent-123');

Temporal Memory Decay

Inspect forgetting curves and configure decay coefficients.

// Get staleness details
const report = await client.getStalenessReport('agent-123');

// Get decay parameters
const rates = await client.getDecayRates();

// Modify decay parameters
await client.setDecayRates({ conversation: 0.15, facts: 0.02 });

Error Handling

All client methods throw typed errors extending KyrosError for robust validation:

import {
  KyrosClient,
  AuthenticationError,
  RateLimitError,
  NotFoundError,
  ValidationError,
  ServerError
} from '@kyros.494/sdk';

const client = new KyrosClient({ apiKey: 'invalid-key' });

try {
  await client.remember('agent-123', 'test');
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid credentials provided:', error.message);
  } else if (error instanceof RateLimitError) {
    console.error(`Rate limited. Limit: ${error.limit}, Reset: ${error.reset}`);
  } else if (error instanceof ValidationError) {
    console.error('Invalid request body:', error.message);
  } else if (error instanceof ServerError) {
    console.error('API server returned error code:', error.status);
  } else {
    console.error('Unexpected error:', error);
  }
}

License

This SDK is licensed under the Apache License 2.0. See the root LICENSE file for details.