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-langgraph-inquiry-routing-engine

v0.1.1

Published

Inquiry Routing Engine for LangGraph.js — Graph-level orchestration of PDE-to-Inquiry pipelines with Four Directions routing, relational accountability gating, and multi-channel dispatch

Downloads

242

Readme

ava-langgraph-inquiry-routing-engine

Graph-level orchestration for the Inquiry Routing pipeline. This package provides a state-based graph that transforms PDE decomposition results into dispatch-ready inquiries, routing them through Four Directions with relational accountability gating and multi-channel formatting.

Overview

The Inquiry Routing Engine sits downstream of the Prompt Decomposition Engine (PDE). It consumes a DecompositionResult and orchestrates a four-stage pipeline:

  1. EAST (Generate) — Produce structured inquiries from decomposition actions
  2. SOUTH (Route) — Classify and route each inquiry to source channels (QMD, deep-search, workspace-scan)
  3. WEST (Validate) — Relational validation checks accountability, ceremonial markers, and Two-Eyed Seeing fields
  4. NORTH (Dispatch) — Format inquiries for their target channels as actionable query payloads

Features

  • InquiryRoutingGraph: Orchestrates the Generate→Route→Validate→Dispatch pipeline
  • RelationalValidator: Validates relational integrity with Wilson's axiological grounding
  • DispatchFormatter: Multi-channel formatting (QMD lex/vec/hyde, academic deep-search, workspace glob/grep)
  • createInquiryRoutingStateGraph(): LangGraph-compatible StateGraph factory for subgraph composition
  • Ceremony Hold: Configurable halt when Indigenous/ceremonial content lacks proper relational markers

Installation

npm install ava-langgraph-inquiry-routing-engine

Peer Dependencies

npm install ava-langchain-prompt-decomposition ava-langchain-inquiry-routing

Quick Start

import { DecompositionGraph } from "ava-langgraph-prompt-decomposition-engine";
import { InquiryRoutingGraph } from "ava-langgraph-inquiry-routing-engine";

// First: decompose the prompt
const pdeGraph = new DecompositionGraph();
const pdeState = await pdeGraph.invoke("Research relational patterns. Build the API. Test integration.");

// Then: route the inquiries
const routingGraph = new InquiryRoutingGraph();
const state = await routingGraph.invoke(pdeState.decomposition!);

console.log("Status:", state.status);
console.log("Inquiries generated:", state.inquiryBatch?.total);
console.log("Relational score:", state.relationalValidation?.score);
console.log("Dispatch payloads:", state.dispatchPayloads?.length);

// Check for ceremony hold
if (state.ceremonyRequired) {
  console.log("⚠️ Ceremony required:", state.relationalValidation?.summary);
}

Architecture

State Flow

DecompositionResult
        │
        ▼
  ┌─────────────┐
  │ EAST:       │
  │ Generate    │──→ InquiryBatch
  └─────────────┘
        │
        ▼
  ┌─────────────┐
  │ SOUTH:      │
  │ Route       │──→ RoutedInquiryBatch + RoutingDecisions
  └─────────────┘
        │
        ▼
  ┌─────────────┐       ceremony_hold
  │ WEST:       │──────────────────────→ HALT
  │ Validate    │
  └─────────────┘
        │ (pass)
        ▼
  ┌─────────────┐
  │ NORTH:      │
  │ Dispatch    │──→ FormattedDispatch[] (QMD/deep-search/workspace)
  └─────────────┘

Source Channels

| Channel | Direction Affinity | Query Format | |---------|-------------------|--------------| | QMD Local | EAST, WEST | lex/vec/hyde semantic searches | | Deep Search Academic | SOUTH | Academic retrieval with Two-Eyed Seeing context | | Workspace Scan | NORTH | glob/grep patterns against codebase |

Relational Validation

The RelationalValidator checks every inquiry for:

  • relational_context — relational grounding (Wilson's axiology)
  • accountability — relational obligations
  • indigenous_lens — required when Indigenous content is detected
  • ceremonial_intent — recommended for WEST-direction inquiries

Missing fields produce warnings or hold-level flags. Hold flags trigger ceremony_hold status.

LangGraph Integration

Use createInquiryRoutingStateGraph() to embed as a subgraph:

import { createInquiryRoutingStateGraph } from "ava-langgraph-inquiry-routing-engine/graphs";

const graph = await createInquiryRoutingStateGraph({ enforceCeremony: true });
const compiled = graph.compile();

const result = await compiled.invoke({
  decomposition: myDecomposition,
  pdeId: myDecomposition.id,
  sessionId: "session-123",
});

API Reference

Graphs

  • InquiryRoutingGraph — Pure-function orchestrator (no LangGraph dependency needed)
  • createInquiryRoutingStateGraph() — LangGraph StateGraph factory (requires @langchain/langgraph)
  • createInitialState(decomposition, sessionId?) — State factory
  • generateNode(), routeNode(), validateNode(), dispatchNode() — Individual node functions

Nodes

  • RelationalValidator — Relational integrity validation
  • DispatchFormatter — Multi-channel query formatting

Re-exported from ava-langchain-inquiry-routing

  • InquiryGenerator, InquiryRouter, InquiryFormatter, RelationalEnricher
  • Inquiry, InquiryBatch, RoutingDecision, RoutedInquiryBatch

License

MIT