Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

pi-qmd-ledger

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pi-qmd-ledger

Universal configurable JSONL ledger with qmd hybrid search, tiered HITL, and dynamic context injection.

latest
Source
npmnpm
Version
0.5.3
Version published
Weekly downloads
78
-62.14%
Maintainers
1
Weekly downloads
 
Created
Source

pi-qmd-ledger

npm version license pi-extension

Universal append-only JSONL ledger with hybrid semantic search (qmd) and dynamic context injection for pi.

Features

  • Universal — user-defined schema per ledger. Works for research, decisions, requirements, experiments, docs-anything.

  • Append-only — immutable history with configurable dedup.

  • Tiered HITL — strict (confirm each), gated (queue for review), autopilot (auto-append).

  • Semantic search — fuzzy retrieval via qmd across raw documents.

  • Context injection — regex triggers auto-inject ledger entries into prompts.

  • Self-adapting — runtime config changes, schema evolution, multiple named ledgers.

  • Extension Compatibility — Integrates with other pi extensions (e.g., pi-context) for enhanced features, dynamically loading capabilities when extensions are present.

Architecture

┌─────────────────────────────────────────┐
│  User prompt                             │
│  e.g. "draft login"                      │
└──────┬──────────────────────────────────┘
       │
       ▼
┌─────────────────────────────────────────┐
│  Injector regex match                    │
│  → matches "draft\s+(\S+)"              │
└──────┬──────────────────────────────────┘
       │
       ▼
┌─────────────────────────────────────────┐
│  query main.jsonl where tag="login"   │
│  + inject artifact.md                   │
└──────┬──────────────────────────────────┘
       │
       ▼
┌─────────────────────────────────────────┐
│  Appended to system prompt               │
│  → LLM now has pre-fetched context       │
└─────────────────────────────────────────┘

For more details on extension integration, see topics/EXTENSIONS.md.

Quick Start

Prerequisites

  • qmd binary on PATH (prebuilt or via cargo install --git https://github.com/kylebrodeur/qmd --branch patch-0.3.2 qmd-cli)
  • Node.js 20+ (matches engines in package.json)

1. Install with pi

pi install npm:pi-qmd-ledger              # latest
pi install npm:pi-qmd-ledger@0.2.4       # pinned
pi -e npm:pi-qmd-ledger                  # try without installing

Or from git (SSH):

pi install git:git@github.com:kylebrodeur/pi-qmd-ledger
pi install git:git@github.com:kylebrodeur/pi-qmd-ledger@v0.1.1

2. Verify the install

/pi list
/qmd-validate

You should see pi-qmd-ledger in the package list and a green health check for qmd, config, and ledgers.

3. Scaffold your ledger

Inside any project:

/qmd-init
/qmd-validate

This creates pi-qmd-ledger.config.json and empty ledger files.

4. Index your documents

Before qmd_search works, you need to build the search index:

# Add a collection (run from the directory containing your .md files)
qmd collection add ./docs --name my-docs

# Build the full-text (BM25) and vector indexes
/qmd-index

# Check status
qmd_status

5. Adapt the config

Edit pi-qmd-ledger.config.json to match your domain. See Config Reference.

Install from npm (classic)

If you are not using pi's package manager:

npm install pi-qmd-ledger
# or
pnpm add pi-qmd-ledger
# or
yarn add pi-qmd-ledger

Then register in your project's package.json:

{
  "pi": {
    "extensions": ["./node_modules/pi-qmd-ledger/dist/index.js"]
  }
}

Installing from source

git clone https://github.com/kylebrodeur/pi-qmd-ledger.git
cd pi-qmd-ledger
pnpm install && pnpm build

Example domains

Research project

{
  "ledgers": {
    "findings": {
      "path": "research/findings.jsonl",
      "schema": ["id", "paper", "claim", "evidence", "confidence", "tag"],
      "dedupField": "claim"
    }
  },
  "injectors": [
    {
      "name": "lit-review",
      "regex": "review\\s+(\\S+)",
      "ledger": "findings",
      "filterField": "tag",
      "artifactPath": "research/synthesis.md"
    }
  ]
}

Decision log

{
  "ledgers": {
    "decisions": {
      "path": "decisions/log.jsonl",
      "schema": [
        "id",
        "date",
        "context",
        "decision",
        "rationale",
        "status",
        "owner"
      ],
      "dedupField": "decision"
    }
  },
  "injectors": [
    {
      "name": "decide",
      "regex": "decide\\s+(\\S+)",
      "ledger": "decisions",
      "filterField": "context"
    }
  ]
}

Tools

ToolPurpose
qmd_searchFuzzy semantic search via qmd
qmd_statusShow qmd collections, indexed docs, and embedding state
query_ledgerDeterministic JSONL search by ledger name
append_ledgerAppend with strict/gated/autopilot modes
configure_ledgerRead or update config at runtime
describe_ledgerIntrospect schema, count, and sample entries
ledger_statsDashboard: counts, sizes, qmd version
ledger_exportExport to JSON, CSV, or Markdown

Commands

CommandPurpose
/qmd-initScaffold config + ledgers + artifact templates
/qmd-validateHealth check everything
/qmd-index [--no-embed]Re-index all collections (BM25 + embeddings)
/qmd-approve [target]Batch-review pending entries
/qmd-list-extensionsList available and enabled extension integrations
/qmd-extension-statusShow detailed extension compatibility status
/qmd-enable-pi-contextEnable or disable pi-context integration

Documentation

DocDescription
SkillWhat pi auto-loads about this extension
Config ReferenceFull config schema, env overrides, resolution order
Tool ReferenceAll 7 tools: parameters, behavior, return types
TroubleshootingCommon issues and fixes

Contributing

See CONTRIBUTING.md for dev setup, testing, and commit conventions.

License

MIT — see LICENSE (or package.json).

Keywords

pi-package

FAQs

Package last updated on 17 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts