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

ava-langchain-inquiry-routing

v0.1.2

Published

Inquiry Routing primitives for the Ava LangStack — transforms PDE decompositions into structured Inquiries routed to QMD (local semantic) and deep-search (academic) channels, grounded in Medicine Wheel epistemology and Wilson's relational ontology

Readme

ava-langchain-inquiry-routing

Inquiry Routing primitives for the Narrative Intelligence Stack — transforms PDE decomposition output into structured Inquiries routed to knowledge channels, enriched with Wilson's relational ontology and Two-Eyed Seeing epistemology.

What It Does

After PDE decomposes a complex prompt into Four Directions, this package generates structured questions (Inquiries) from that decomposition and routes each to the appropriate knowledge channel:

| Channel | Code | Purpose | |---------|------|---------| | QMD Local | qmd-local | Semantic search against workspace knowledge (lex/vec/hyde) | | Deep Search Academic | deep-search-academic | Research-grade queries for scholarly sources | | Workspace Scan | workspace-scan | File system exploration and dependency discovery |

Every inquiry carries relational grounding (Wilson 2008), accountability markers, and optional Two-Eyed Seeing (Etuaptmumk) epistemological annotations.

Installation

pnpm add ava-langchain-inquiry-routing ava-langchain-prompt-decomposition

Quick Start

import { generateInquiries } from "ava-langchain-inquiry-routing";
import { decompose } from "ava-langchain-prompt-decomposition";

const pde = await decompose("Build a knowledge graph grounded in indigenous epistemology...");
const result = generateInquiries(pde.decomposition);

console.log(`Generated ${result.batch.total} inquiries`);
console.log(result.markdown);

Core Modules

| Module | Direction | Purpose | |--------|-----------|---------| | InquiryGenerator | 🌅 EAST | Extracts inquiries from PDE decomposition output | | InquiryRouter | 🌿 SOUTH | Classifies and routes inquiries to channels | | RelationalEnricher | 🌊 WEST | Adds Wilson's relational fields and Two-Eyed Seeing markers | | InquiryFormatter | ⚡ NORTH | Formats inquiries for QMD, deep-search, markdown, JSON |

API

generateInquiries(decomposition, options?)

Convenience function that runs the full pipeline: Generate → Enrich → Route → Format.

import { generateInquiries } from "ava-langchain-inquiry-routing";

const result = generateInquiries(decomposition, {
  generator: { includeAmbiguities: true, minConfidence: 0.3 },
  enricher: { addTwoEyedSeeing: true },
  routing: { confidenceThreshold: 0.4 },
});

// result.batch: RoutedInquiryBatch
// result.markdown: string
// result.json: string

InquiryGenerator

Extracts inquiries from PDE decomposition output — directional insights become questions, ambiguities become verification inquiries, assumptions become verifiable claims.

import { InquiryGenerator } from "ava-langchain-inquiry-routing";

const generator = new InquiryGenerator({
  includeAmbiguities: true,
  includeAssumptions: true,
  minConfidence: 0.3,
});

const batch = generator.generate(decomposition);
const flat = generator.flatten(batch);

InquiryRouter

Routes inquiries to channels based on keyword classification and directional affinity.

import { InquiryRouter } from "ava-langchain-inquiry-routing";

const router = new InquiryRouter({
  confidenceThreshold: 0.4,
  qmdKeywords: ["schema", "model"],
  deepSearchKeywords: ["Wilson", "ceremony"],
});

const decision = router.classify(inquiry);
const routedBatch = router.routeAll(batch);

RelationalEnricher

Enriches inquiries with Wilson's relational accountability and Two-Eyed Seeing markers.

import { RelationalEnricher } from "ava-langchain-inquiry-routing";

const enricher = new RelationalEnricher({
  addTwoEyedSeeing: true,
  addCeremonialIntent: true,
});

const enriched = enricher.enrich(inquiry, "Additional relational context");
const enrichedBatch = enricher.enrichBatch(batch);

InquiryFormatter

Formats inquiries for different output channels.

import { InquiryFormatter } from "ava-langchain-inquiry-routing";

const formatter = new InquiryFormatter();

const qmd = formatter.toQmdQuery(inquiry);       // { mode: "vec", query, direction }
const ds = formatter.toDeepSearchQuery(inquiry);  // { query, academic_context, search_terms }
const md = formatter.toMarkdown(batch);           // Structured markdown report
const json = formatter.toJSON(batch);             // JSON serialization

Inquiry Structure

interface Inquiry {
  id: string;
  timestamp: string;
  direction: 'east' | 'south' | 'west' | 'north';
  source: 'qmd-local' | 'deep-search-academic' | 'workspace-scan';
  query: string;
  response?: string;
  status: 'pending' | 'routed' | 'completed' | 'failed';

  // Relational grounding (Wilson's axiology)
  relational_context: string;
  accountability: string;
  ceremonial_intent?: string;

  // Two-Eyed Seeing markers
  indigenous_lens?: string;
  western_lens?: string;

  // Traceability
  pde_id: string;
  action_index?: number;
  confidence: number;
}

Direction → Channel Affinity

| Direction | Default Channel | Rationale | |-----------|----------------|-----------| | 🌅 EAST (Vision) | QMD Local | Vision questions seek clarity from existing context | | 🌿 SOUTH (Analysis) | Deep Search Academic | Learning questions seek external knowledge | | 🌊 WEST (Validation) | QMD Local | Reflection questions test against existing work | | ⚡ NORTH (Action) | Workspace Scan | Execution questions need file/dependency awareness |

Related Packages

References

  • Wilson, S. (2008). Research is Ceremony: Indigenous Research Methods
  • Bartlett, C., Marshall, M., & Marshall, A. (2012). Two-Eyed Seeing (Etuaptmumk)