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

@magda/semantic-indexer-sdk

v6.1.2

Published

MAGDA Semantic Indexer SDK

Readme

MAGDA Semantic Indexer SDK

A semantic indexer is a Magda minion that turns a chosen source — a distribution's file content, a registry record's aspects, or an external API — into vector-indexed text, so it can be retrieved by meaning rather than by keyword. The resulting vectors are written to Magda's semantic index and served by the semantic search query API (magda-semantic-search-api), which powers meaning-based retrieval for AI agents and the in-browser chatbot.

This SDK provides the framework — the minion lifecycle, chunking, embedding, and OpenSearch indexing — so you can focus on the one decision that matters: what text should represent your source.

📖 Full guide: How to build a semantic indexer — the concepts, the representation mindset (designing the text backward from how it will be searched), and a complete walkthrough.

Get Started

import semanticIndexer, {
    commonYargs,
    CreateEmbeddingText
} from "@magda/semantic-indexer-sdk";

const ID = "custom-notes-semantic-indexer";

// What text should represent this source? That is the core design decision —
// see the "Designing your representation" section of the guide.
const createEmbeddingText: CreateEmbeddingText = async ({ record }) => {
    const notes =
        (record.aspects && record.aspects["custom-dataset-notes"]) || {};
    const parts = [notes.summary, notes.usageNotes].filter(Boolean);
    return { text: parts.join("\n\n") };
};

const argv = commonYargs(6122, "http://localhost:6122");

semanticIndexer({
    argv,
    id: ID,
    // "registryRecord" indexes registry metadata / custom aspects;
    // use "storageObject" (with `formatTypes`) to index distribution file content.
    itemType: "registryRecord",
    aspects: ["custom-dataset-notes"],
    createEmbeddingText
}).catch((e: Error) => {
    console.error("Error: " + e.message, e);
    process.exit(1);
});

The itemType selects what you index (registryRecord for metadata/custom aspects, storageObject for distribution file content), and createEmbeddingText returns the text to embed. The framework then chunks, embeds, and indexes it. See the guide for the full option reference and chunking controls.

Learn more