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

@onmars/lunar-kb

v0.15.1

Published

Knowledge Base skill for Lunar — opt-in citation-grounded RAG over pgvector (schema-per-moon)

Downloads

1,639

Readme

@onmars/lunar-kb

Citation-grounded knowledge base skill for Lunar.

Status: scaffolding only — Fase 0. No functional code yet. This package lays out the directory structure, types, and DDL that Fase 1 will implement.

Purpose

A per-moon RAG system where every answer must cite the source chunk it came from. Designed so Artemis (veterinary) and Deimos (research) can answer with traceable provenance — and refuse to answer when there's no evidence.

Canonical spec lives in Craft: Lunar KB — Knowledge Base con citación obligatoria (block id 8321e434-55e8-76ae-23c1-6fc6a4ce7120). Read it before implementing anything.

Design in one paragraph

Opt-in skill activated per-moon in config.yaml under skills.kb. Data lives in Postgres + pgvector, isolated per moon by schema-per-moon (artemis_kb, deimos_kb, …) inside a user-configurable DB. Pipeline (planned): LlamaIndex.TS orchestrates Docling (Python sidecar) for PDF parsing → chunker with Anthropic Contextual Retrieval → embeddings → pgvector index. Query path: hybrid search → Cohere 3.5 rerank (or LLM-as-judge fallback) → answer generation with mandatory citations → grounding check.

Activation (opt-in)

Not enabled by default. A moon opts in by adding a skills.kb block:

# lunar.config.yaml
moon: artemis
skills:
  kb:
    mode: sources-only       # or "hybrid" for research moons
    database:
      url: postgres://...
      schema: artemis_kb
    embeddings:
      provider: openai       # required if moon provider is Claude (no embeddings)
      model: text-embedding-3-small
    # parser, reranker, contextual_retrieval, generation all inherit
    # from the moon's LLM provider (cheapest model per component) by default

Without a skills.kb block Lunar boots with no KB tables, no validations, no skill exposed to the agent.

Package layout

packages/kb/
├── src/
│   ├── index.ts            ← public exports (types + KBProvider interface)
│   ├── types/              ← config, query, document types
│   ├── lib/
│   │   ├── embeddings/     ← provider adapters (openai, voyage, ollama, …)
│   │   ├── reranker/       ← cohere + llm-as-judge fallback
│   │   ├── chunker/        ← contextual-retrieval chunker
│   │   └── ingestion/      ← doc → parse → chunk → embed → insert
│   └── __tests__/
├── migrations/
│   └── 001_init.sql        ← DDL templated per-moon schema
└── sidecar/
    └── README.md           ← Docling Python sidecar design notes

Fase 1 — pendiente (TODO)

  • Implement KBProvider (ingest, query, destroy).
  • Schema materializer that runs migrations/*.sql against the moon's schema.
  • Embeddings adapters (OpenAI, Voyage, Gemini, Ollama).
  • Reranker adapters (Cohere, LLM-as-judge).
  • Docling sidecar client (HTTP local).
  • Grounding check (regex + source-id lookup).
  • Dual citation format ([Kumar 2024, p347] human + [kumar-endo#ch42-p347] technical).
  • Bindings into @onmars/lunar-core skill system.

License

MIT — onMars Tech