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

@kognitivedev/cloud-knowledge-base

v0.2.29

Published

Managed cloud knowledge base SDK for Kognitive agents and workflows

Readme

@kognitivedev/cloud-knowledge-base

Managed cloud knowledge base SDK for Kognitive agents and workflows.

This package targets managed cloud pipelines, which are also the dashboard knowledge-base resource. A pipeline ID is the knowledge-base ID across SDKs, dashboard, agents, and workflows.

Managed knowledge bases are zero-config at the API level: documents are parsed into indexed artifacts and searched through Qdrant-native hybrid retrieval, using dense semantic vectors plus Qdrant BM25 sparse vectors.

Backend requirements for managed KB indexing/search are REDIS_URL, QDRANT_URL, and OPENROUTER_API_KEY. QDRANT_API_KEY is optional depending on your Qdrant deployment. Pipeline sync is asynchronous, so clients should poll the pipeline run/status endpoints before relying on newly uploaded content in search.

Every normalized hit includes citation metadata suitable for enterprise rendering and audit trails:

  • sourceId
  • snippet
  • filename
  • mimeType
  • pageNumber
  • artifactType
  • parseDocumentId

Search

Create and sync the pipeline with @kognitivedev/documents, wait for the run to complete, then search it from this package:

import { KognitiveDocumentsClient } from "@kognitivedev/documents";
import { searchCloudKnowledgeBase } from "@kognitivedev/cloud-knowledge-base";

const documents = new KognitiveDocumentsClient({
  baseUrl: process.env.KOGNITIVE_BASE_URL!,
  apiKey: process.env.KOGNITIVE_API_KEY,
});

const pipeline = await documents.pipelines.create({ name: "Support KB" });
const source = await documents.pipelines.addFile(pipeline.id, { fileId: "file-id" });
const run = await documents.pipelines.sync(pipeline.id, { sourceId: String(source.id) });
await documents.pipelines.getRun(pipeline.id, run.id);

const result = await searchCloudKnowledgeBase({
  baseUrl: process.env.KOGNITIVE_BASE_URL!,
  apiKey: process.env.KOGNITIVE_API_KEY,
  pipelineId: pipeline.id,
  query: "What is the retention policy?",
  topK: 5,
  resourceId: { userId: "user_123" },
});

Agent Context Adapter

import { createAgent } from "@kognitivedev/agents";
import { createCloudKnowledgeBaseContextAdapter } from "@kognitivedev/cloud-knowledge-base";

const agent = createAgent({
  name: "support-agent",
  instructions: "Answer using the managed knowledge base when relevant.",
  runtime,
  contextAdapters: [
    createCloudKnowledgeBaseContextAdapter({
      baseUrl: process.env.KOGNITIVE_BASE_URL!,
      apiKey: process.env.KOGNITIVE_API_KEY,
      pipelineId: "pipe_123",
      topK: 4,
    }),
  ],
});

Workflow Step

import { createWorkflow } from "@kognitivedev/workflows";
import { createCloudKnowledgeBaseAnswerStep } from "@kognitivedev/cloud-knowledge-base";

const workflow = createWorkflow<{ query: string }>({ name: "kb-answer" })
  .then(createCloudKnowledgeBaseAnswerStep({
    id: "answer",
    agent,
    baseUrl: process.env.KOGNITIVE_BASE_URL!,
    apiKey: process.env.KOGNITIVE_API_KEY,
    pipelineId: "pipe_123",
    getQuery: (input) => input.query,
  }))
  .build();

There is also a lower-level createCloudKnowledgeBaseSearchStep() when you want retrieval without the answering stage.