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

@neuradex/sdk

v0.1.3

Published

Neuradex SDK for Node.js - Knowledge management and RAG API

Readme

Neuradex SDK

Neuradex APIを利用するためのTypeScript/JavaScript SDK。 Knowledge管理とRAG(セマンティック検索)機能を提供。

インストール

npm install @neuradex/sdk
# または
pnpm add @neuradex/sdk

基本的な使い方

import { NdxClient } from '@neuradex/sdk';

const client = new NdxClient({
  apiKey: 'ndx_your_api_key',
  projectId: 'your-project-id',
});

セマンティック検索

// Knowledge検索(タイトル + タグ + メタデータを返却、コンテンツは含まない)
const results = await client.knowledge.search('Reactについて教えて');

for (const result of results) {
  console.log(`${result.title} (スコア: ${result.score})`);
  console.log(`  概要: ${result.summary}`);
  console.log(`  トークン数: ${result.contentTokens}`);
  console.log(`  タグ: ${result.tags.join(', ')}`);
}

// 検索オプション
const results = await client.knowledge.search('認証', { limit: 5 });

SearchResultの構造

interface SearchResult {
  id: string;
  title: string;
  tags: string[];
  score: number;
  summary: string | null;      // LLM生成の概要
  contentTokens: number | null; // コンテンツのトークン数
  createdAt: string | null;    // 作成日時
  indexedAt: string | null;    // インデックス日時
}

詳細取得

// フルコンテンツ + 関連Knowledgeを取得
const detail = await client.knowledge.get('knowledge-id');

console.log(detail.title);
console.log(detail.content);
console.log(detail.tags);

// 関連Knowledge
for (const connected of detail.connectedKnowledge) {
  console.log(`関連: ${connected.title} (${connected.relationType})`);
}

検索→詳細取得のパターン

// 1. 検索でタイトルを取得
const results = await client.knowledge.search('Reactのフック');

// 2. 上位の結果から詳細を取得
if (results.length > 0) {
  const detail = await client.knowledge.get(results[0].id);
  console.log(detail.content);
}

Knowledge CRUD操作

一覧取得

const allKnowledge = await client.knowledge.list();

作成

// 単体作成
const knowledge = await client.knowledge.create({
  title: 'Reactの基本',
  content: 'Reactは...',
  tags: ['react', 'frontend'],
});

// 一括作成
const items = await client.knowledge.bulkCreate([
  { title: 'Item 1', content: 'Content 1', tags: ['tag1'] },
  { title: 'Item 2', content: 'Content 2', tags: ['tag2'] },
]);

更新

// タイトルとコンテンツを更新
const updated = await client.knowledge.update('knowledge-id', {
  title: '新しいタイトル',
  content: '更新されたコンテンツ',
});

// タイトルのみ更新
const updated = await client.knowledge.update('knowledge-id', {
  title: '新しいタイトル',
});

// コンテンツのみ更新
const updated = await client.knowledge.update('knowledge-id', {
  content: '更新されたコンテンツ',
});

削除

await client.knowledge.delete('knowledge-id');

エクスポート

const exported = await client.knowledge.export();
// [{ title: '...', content: '...' }, ...]

認証確認

const auth = await client.verifyAuth();
if (auth.valid) {
  console.log('認証成功');
} else {
  console.error('認証失敗:', auth.error);
}

型エクスポート

import type {
  NdxClientOptions,
  VerifyAuthResult,
  Knowledge,
  CreateKnowledgeInput,
  UpdateKnowledgeInput,
  KnowledgeViewResponse,
  ConnectedKnowledge,
  SearchResult,
  SearchResponse,
} from '@neuradex/sdk';

開発・テスト

# 環境変数設定(supabase/seed.sqlのテストデータ使用)
cp .env.example .env

# テスト実行
pnpm test

ライセンス

MIT