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

@agentproto/knowledge-engine

v0.2.1

Published

Pure, backend-agnostic knowledge (retrieval) contract (IKnowledgeProvider) + the AIP-14 `kb_query` / `kb_ingest` tools, their AIP-30 builtin provider, and AIP-29/31/32 surface projections. Names no retrieval engine — a backend is injected via the tool con

Readme

@agentproto/knowledge-engine

Pure, backend-agnostic knowledge (retrieval) contract plus the AIP-14 kb_query / kb_ingest tools, their AIP-30 builtin provider, and thin AIP-29/31/32 surface projections. The retrieval sibling of @agentproto/code-brain.

This package names no concrete retrieval engine (vector store, graph db, BM25). A backend implements the IKnowledgeProvider contract in a separate adapter and is injected via the tool context — which is what lets kb_query and kb_ingest be authored, typed, and tested against a fake provider before any real backend exists.

The contract + data types are lifted verbatim from the studio integration package (packages/integration/knowledge/src/providers/base-knowledge.provider.ts and .../types/knowledge.types.ts), which were already vendor-neutral with zero cross-app imports; the only change is the import path to fit the new package boundary.

The contract — IKnowledgeProvider

interface IKnowledgeProvider {
  readonly id: string
  readonly capabilities: KnowledgeCapabilities
  ingest(input: KnowledgeIngestInput): Promise<KnowledgeSource>
  query(q: KnowledgeQuery): Promise<KnowledgeQueryResult>
  listSources(filter?: ListSourcesFilter): Promise<readonly KnowledgeSource[]>
  getSource(id: string): Promise<KnowledgeSource | null>
  deleteSource(id: string): Promise<void>
  healthCheck(): Promise<boolean>
  dispose(): Promise<void>
}

It is deliberately idiom-free: no backend's query dialect appears in these types. KnowledgeQuery.mode (vector | graph | hybrid | none) is a hint — an engine that can't serve the requested mode falls back and echoes the mode it actually used in KnowledgeQueryResult.modeUsed. "none" is the cold-start sentinel (no recall this turn). Data types: KnowledgeCapabilities, KnowledgeSource, KnowledgeIngestInput, KnowledgeQuery, KnowledgeHit, KnowledgeQueryResult, ListSourcesFilter, CorpusFilter.

The tools — kb_query / kb_ingest

defineTool → implementTool → defineDriver, mirroring @agentproto/code-brain. The backend is injected via contextSchema.knowledgeEngine; each body dispatches to one contract method:

| tool | contract method | output | mutation | |---|---|---|---| | kb_query | query(...) | hits, tookMs, engine, modeUsed + rendered answer | none — mutates: [], idempotent: true, riskLevel: 0 | | kb_ingest | ingest(...) | source + rendered answer | mutates: ["knowledge_source"], idempotent: false, riskLevel: 1 |

Exports

| Subpath | What | |---|---| | . | contract + data types + zod schemas + both tools + knowledgeEngineProvider | | ./types | the pure data types + zod mirrors | | ./tools | kbQueryTool, kbIngestTool | | ./provider | knowledgeEngineProvider (builtin) + kbQueryBuiltin + kbIngestBuiltin | | ./mcp | defineKnowledgeEngineMcpDriver — AIP-32 projection | | ./http | defineKnowledgeEngineHttpDriver — AIP-31 projection | | ./cli | defineKnowledgeEngineCliDriver — AIP-29 projection |

The projections are wiring only — a later adapter supplies the transport config (MCP server, HTTP base URL, CLI binary). Nothing connects at import time and no backend ships in this package.