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

@exellix/memorix-narrix-adapter

v2.0.0

Published

Memorix-to-Narrix adapter: converts Memorix database payloads into Narrix run inputs (record/text/docs/chat) with interpretable metadata.

Readme

@exellix/memorix-narrix-adapter

Memorix-to-Narrix adapter: converts Memorix database payloads into Narrix run inputs (record / text / docs / chat) with interpretable metadata.

  • Layer: Adapter (bridge between Memorix entity/event/knowledge memory and Narrix SDK).
  • Ecosystem: Exellix Memorix + Narrix.
  • Capability: Interprets arbitrary memorix payloads and produces a single NarrixRunInput plus interpretation (kind, strategy, confidence).

Uses @x12i/memorix-retrieval and @x12i/memorix-descriptors for Memorix content objects and record identity on the entity / event / knowledge databases.


Installation

npm install @exellix/memorix-narrix-adapter

Clone (source)

git clone [email protected]:exellix/memorix-narrix-adapter.git
cd memorix-narrix-adapter

Quick start

import { adaptMemorixToNarrixInput } from "@exellix/memorix-narrix-adapter";

const result = adaptMemorixToNarrixInput({
  datasetId: "my-dataset",
  memorix: {
    entityMemory: { currentRecord: { entityId: "ent-123", orderId: "123" } },
    eventMemory: { input: { sourceMeta: { jobId: "j1" } } }
  }
});

if (result.ok) {
  console.log(result.narrixInput.medium);        // "record"
  console.log(result.interpretation.kind);       // "record"
  console.log(result.interpretation.confidence); // "guessed" | "hinted" | "exact"
} else {
  console.log(result.error, result.message, result.attempted);
}

Public API

Functions and class

| Export | Description | |--------|-------------| | adaptMemorixToNarrixInput(input, config?) | One-shot adaptation: builds an adapter and returns MemorixNarrixAdapterResult. | | MemorixNarrixAdapter | Class that holds config and exposes adapt(input). Use when you need to reuse one instance. | | defaultAdapterConfig | Default config object; merge or override for custom behavior. |

Deprecated aliases (adaptMemoryToNarrixInput, MemoryNarrixAdapter, MemoryNarrixAdapterInput, etc.) remain exported for migration.

Types (exported)

  • Input: MemorixNarrixAdapterInput{ datasetId: string; mediumHint?: "record" \| "text" \| "docs" \| "chat"; memorix: unknown }.
  • Result: MemorixNarrixAdapterResult = MemorixNarrixAdapterSuccess | MemorixNarrixAdapterFailure.
  • Success: ok: true, narrixInput: NarrixRunInput, interpretation, optional debug.
  • Failure: ok: false, error, message, attempted, foundSummary, interpretation.
  • Narrix run inputs: NarrixRunInput = NarrixRecordInput | NarrixTextInput | NarrixDocsInput | NarrixChatInput (each has medium and datasetId).
  • Config: MemorixNarrixAdapterConfig — optional overrides for walker, record, sourceMeta, text, summary, debug.

How it works

Memorix database memory tiers

Default record and sourceMeta paths align with Memorix databases:

| Tier | Database (default) | Typical paths | |------|-------------------|---------------| | entity | memorix-entities | entityMemory.currentRecord, entityMemory.sourceMeta | | event | memorix-events | eventMemory.input.record, eventMemory.input.sourceMeta | | knowledge | memorix-knowledge | knowledgeMemory.currentRecord, knowledgeMemory.sourceMeta |

Strategy pipeline

The adapter runs a fixed list of strategies in order. The first strategy that returns a match produces the result.

  1. detect-existing-narrix-input — If memorix is already a valid NarrixRunInput, pass it through. Confidence: exact.
  2. legacy-normalization — Legacy shapes without medium (record, text, pages, messages).
  3. record-from-memorix — Walk the payload and pick record-like objects on configured record.preferPaths. Uses resolveMemorixRecordIdentity when the path is under a Memorix tier.
  4. chat-from-memorixthread.messages or root messages.
  5. docs-from-memorixdocument.pages, root pages, or string arrays.
  6. text-from-memorix — Plain string, .text, memorix-content-object (contentKey + preview via @x12i/memorix-retrieval), or JSON serialization fallback.

If no strategy matches, returns error: "NO_USABLE_INPUT" with attempted and foundSummary.

Medium hint

mediumHint reorders the pipeline so strategies for that medium run first (it does not force a medium).


Build and test

npm run build
npm run test
npm run test:watch

Publishing

npm run build
npm run test
npm publish

Set repository in package.json to your Git repo (default: https://github.com/exellix/memorix-narrix-adapter).

To point the Git remote at SSH:

git remote set-url origin [email protected]:exellix/memorix-narrix-adapter.git

License

ISC.