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

@tencentdb-agent-memory/memory-sdk-ts

v1.0.0

Published

TypeScript SDK for TencentDB Agent Memory v2 API

Readme

@tencentdb-agent-memory/memory-sdk-ts

TypeScript SDK for the TencentDB Agent Memory v2 API.

Install

# From npm (after publish)
npm install @tencentdb-agent-memory/memory-sdk-ts

# From local .tgz
npm install ./tencentdb-agent-memory-memory-sdk-0.1.0.tgz

Quick Start

import { MemoryClient } from "@tencentdb-agent-memory/memory-sdk-ts";

const client = new MemoryClient({
  endpoint: "http://127.0.0.1:8420",
  apiKey: "your-api-key",
  serviceId: "your-memory-space-id",
});

// L0: append a conversation
const result = await client.addConversation({
  session_id: "sess-1",
  messages: [
    { role: "user", content: "Hello" },
    { role: "assistant", content: "Hi!" },
  ],
});
console.log(result.accepted_ids);

// L1: search structured memories
const hits = await client.searchAtomic({ query: "user preferences", limit: 5 });
console.log(hits.items);

// L1: update a memory note
await client.updateAtomic({ id: "note-xxx", content: "updated content", background: "context" });

// L2: list scenario files
const scenarios = await client.listScenarios({ path_prefix: "" });
console.log(scenarios.entries);

// L2: read a scenario file
const file = await client.readScenario({ path: "工作.md" });
console.log(file.content);

// L2: update a scenario file (must already exist)
await client.writeScenario({ path: "工作.md", content: "# Updated", summary: "new summary" });

// L3: read core memory (persona)
const core = await client.readCore();
console.log(core.content);

// L3: write core memory
await client.writeCore({ content: "# User Profile\n..." });

// Read memory pipeline artifacts (e.g. persona.md, scene_blocks/*.md)
const raw = await client.readFile("scene_blocks/工作.md");

API Methods

| Layer | Method | Endpoint | |-------|--------|----------| | L0 | addConversation() | POST /v2/conversation/add | | L0 | queryConversation() | POST /v2/conversation/query | | L0 | searchConversation() | POST /v2/conversation/search | | L0 | deleteConversation() | POST /v2/conversation/delete | | L1 | updateAtomic() | POST /v2/atomic/update | | L1 | queryAtomic() | POST /v2/atomic/query | | L1 | searchAtomic() | POST /v2/atomic/search | | L1 | deleteAtomic() | POST /v2/atomic/delete | | L2 | listScenarios() | POST /v2/scenario/ls | | L2 | readScenario() | POST /v2/scenario/read | | L2 | writeScenario() | POST /v2/scenario/write | | L2 | rmScenario() | POST /v2/scenario/rm | | L3 | readCore() | POST /v2/core/read | | L3 | writeCore() | POST /v2/core/write |

Error Handling

All non-zero code responses throw TDAMError:

import { TDAMError } from "@tencentdb-agent-memory/memory-sdk-ts";

try {
  await client.readCore();
} catch (e) {
  if (e instanceof TDAMError) {
    console.error(`code=${e.code} message=${e.message} request_id=${e.requestId}`);
  }
}

Build & Pack

# Build
npm run build

# Pack as .tgz for distribution
npm pack
# → tencentdb-agent-memory-memory-sdk-0.1.0.tgz

License

MIT