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

@raj-sadan/ai-knowledge

v0.1.2

Published

Capability registry for AI agents — neural graph, Hebbian strengthening, LSD discovery, manifest-driven adapter runner. Mockable defaults so it runs without SQLite, Ollama, or Langflow.

Readme

@vraj0703/ai-knowledge

Capability registry for AI agents — neural graph, Hebbian strengthening, LSD discovery, manifest-driven adapter runner. Mockable defaults so it runs without SQLite, Ollama, or Langflow.

CI License: MIT Node: 18+

The "what tools do I have and which one fits this task" layer. Five interfaces (graph store, manifest store, credential store, adapter runner, LSD provider), five default mocks, one DI container that picks per-integration. The manifest store ships with a small generic seed set so search returns sensible results out of the box.

Status: v0.1.0. Lifted from raj-sadan. Mock-default DI runs clone + npm install + npm start in seconds with no backing service.

What it does

| Surface | Purpose | |---|---| | Manifest store | Per-capability TOML manifest (id, name, description, tier, categories) | | Graph store | Nodes (capabilities) + weighted edges (consumer / category / co-usage / lsd) | | Hebbian strengthening | Edges between capabilities used together get reinforced; unused edges decay | | LSD (Latent Semantic Discovery) | LLM finds new edges between nodes that weren't explicitly linked | | Adapter runner | Per-capability TOML manifest names a Node adapter that knows how to invoke the underlying service (Cloudflare API, GitHub, Exa, etc.) | | Credential store | Per-capability secrets (API tokens, etc.) — stays out of the graph |

The pattern: an agent searches for "what tool does X", picks one, invokes it, the act of invoking strengthens edges to other tools that often go together. Over time the graph self-organizes by usage.

Install

npm install @vraj0703/ai-knowledge

Zero dependencies for the default (mock) path. Real path needs three optional peer deps:

  • better-sqlite3 — for the real SQLite graph store
  • @modelcontextprotocol/sdk + zod — for ai-knowledge mcp

Use

Standalone HTTP service

ai-knowledge serve                       # mocks, port 3489
ai-knowledge --version
ai-knowledge --help

# CLI shortcuts
ai-knowledge search "fetch a URL"
ai-knowledge lookup http-fetch
ai-knowledge register my-tool "My Tool" "Does X for me"

MCP server

ai-knowledge mcp

Four tools auto-discovered:

  • knowledge_search — find capabilities by query
  • knowledge_lookup — fetch one by id
  • knowledge_register — add a new manifest
  • knowledge_use — record a capability use (Hebbian reinforce)

From code

const { createContainer } = require("@vraj0703/ai-knowledge/container");

const c = createContainer();              // all mocks
const found = await c.manifestStore.search("llm");
// → matches "ollama-chat" from the seed set

const real = createContainer({ useReal: "graph,manifests" });

Switch to real integrations

KNOWLEDGE_USE_REAL=all ai-knowledge serve
KNOWLEDGE_USE_REAL=graph,manifests ai-knowledge serve

Five known keys: graph, manifests, credentials, adapters, lsd.

Mockability contract

Every external integration ships with a stub:

  • InMemoryGraphStore — Map-backed nodes + edges; Hebbian strengthening works in process
  • InMemoryManifestStore — seeded with 5 generic capabilities (file-read, http-fetch, ollama-chat, shell-exec, json-extract) so search returns hits out of the box
  • StubCredentialStore — returns [mock]-tagged fake secrets, never reads real ones
  • StubAdapterRunner — records would-be invocations; nothing executes
  • StubLSDProvider — deterministic suggestions based on shared categories (no LLM call)

11 smoke tests run in <150 ms. None touch disk, network, or any LLM.

Configuration

| Var | Default | Purpose | |---|---|---| | KNOWLEDGE_PORT | 3489 | HTTP port | | KNOWLEDGE_USE_REAL | (empty) | Comma-separated integrations to switch to real, or all | | KNOWLEDGE_DB_PATH | data/data_sources/local/knowledge.db | SQLite file | | KNOWLEDGE_OLLAMA_HOST | http://localhost:11434 | LLM provider for direct LSD | | KNOWLEDGE_OLLAMA_MODEL | gemma4:e4b | Model name | | KNOWLEDGE_LANGFLOW_HOST | http://100.108.180.118:7860 | Langflow server (raj-sadan default) | | KNOWLEDGE_HEBBIAN_REINFORCE | 0.1 | Edge weight bump per use | | KNOWLEDGE_DECAY_HALF_LIFE | 30 | Days for unused edges to halve |

What's not here yet

  • Generic seed manifests are 5 placeholders. raj-sadan has 71 specific manifests (Cloudflare zones, Exa API key, GitHub OAuth, etc.) that stay raj-sadan-side via KNOWLEDGE_MANIFESTS_DIR.
  • Vector similarity search — current search is text matching. Adding an embedder + vector store (could share ai-memory's) is a v0.2 follow-up.
  • Live integration tests — only mocks tested. Real SQLite + Ollama + Langflow are exercised by raj-sadan's boot smoke via KNOWLEDGE_USE_REAL=all.

See also

License

MIT.