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

@mi8y/cap-agents-memory

v0.2.0

Published

CDS Plugin for LangGraph long-term memory stores in SAP CAP applications

Downloads

18

Readme

@mi8y/cap-agents-memory

npm version

CDS-backed long-term memory for LangGraph. CdsMemoryStore implements LangGraph's Store API, so facts and preferences can be shared across threads while remaining within CAP's database and tenant context.

Installation

npm install @mi8y/cap-agents-memory
cds add agent-memory

The add command creates db/agent-memory.cds with StoreItems and StoreItemFields in the plugin.langgraph.memory namespace. It never overwrites an existing generated file.

Requires @sap/cds >= 10 and @langchain/core >= 1.

Usage

import { CdsMemoryStore } from "@mi8y/cap-agents-memory";

const store = new CdsMemoryStore({ name: "support-memory" });
const graph = builder.compile({ store });

await store.put(["users", "alice"], "profile", {
  preferredTone: "concise",
  lastTopic: "travel",
});

const profile = await store.get(["users", "alice"], "profile");

name is required and becomes graphName in CDS, isolating multiple stores that share a database. Unlike checkpointers, a Store is long-lived and can be read from any graph thread.

Custom entities

The generated entities are defaults. Define your own entities by implementing the exported aspects, then pass their fully qualified names to the Store.

using { StoreItem, StoreItemField } from '@mi8y/cap-agents-memory';

namespace my.app.memory;

entity Items : StoreItem {
    fields : Composition of many Fields on fields.item = $self;
}

entity Fields : StoreItemField {
    item : Association to Items
        on item.graphName = $self.graphName
        and item.namespace = $self.namespace
        and item.id = $self.id;
    embedding : Vector(3072);
}
const store = new CdsMemoryStore({
  name: "support-memory",
  fqnStoreItemsEntity: "my.app.memory.Items",
  fqnStoreItemFieldsEntity: "my.app.memory.Fields",
});

API

new CdsMemoryStore(config);

| Option | Type | Description | | -------------------------- | ------------ | ------------------------------------------------------ | | name | string | Required store name used for isolation. | | embeddings | Embeddings | Optional LangChain embeddings implementation. | | fqnStoreItemsEntity | string | Defaults to plugin.langgraph.memory.StoreItems. | | fqnStoreItemFieldsEntity | string | Defaults to plugin.langgraph.memory.StoreItemFields. |

Supported Store operations are put, get, delete, search, listNamespaces, and batch.

Namespaces are non-empty arrays of non-empty strings. A label cannot contain . and the root langgraph namespace is reserved.

Search and filtering

search(namespacePrefix, options) supports query, filter, limit, and offset. Without embeddings, query matches stored field values. Metadata filters support direct equality and $eq, $ne, $in, and $notIn operators.

Provide embeddings to embed stored fields on put and query text on search for vector-assisted search. The generated Vector(1536) field must be changed to match the selected embedding model's dimensions.

CAP notes

  • Use the Store inside CAP request handlers to inherit the active database and tenant context.
  • CAP-supported SQLite, SAP HANA, and PostgreSQL adapters are supported by the CDS query implementation.
  • Use a checkpointer for short-term, thread-scoped graph state; use this package for cross-thread long-term memory.

License

MIT License