GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Dicoangelo/cpb-core: Cognitive Precision Bridge - AI orchestration with precision-aware routing through RLM, ACE, and DQ scoring

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
node_modules
node_modules
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.eslintrc.cjs
.eslintrc.cjs
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Unified orchestration layer for precision-aware AI processing

Version TypeScript License ELITE


Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                    COGNITIVE PRECISION BRIDGE (CPB)                         │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                         QUERY ANALYSIS                               │   │
│  │                                                                      │   │
│  │   Input ──→ [Complexity Signals] ──→ [Path Scoring] ──→ Decision    │   │
│  │                     │                       │                        │   │
│  │         ┌───────────┴───────────┐   ┌──────┴──────┐                 │   │
│  │         │ • Token count         │   │ Score paths │                 │   │
│  │         │ • Code indicators     │   │ Consider    │                 │   │
│  │         │ • Reasoning patterns  │   │ alternatives│                 │   │
│  │         │ • Consensus signals   │   │ Explain     │                 │   │
│  │         │ • Domain complexity   │   │ reasoning   │                 │   │
│  │         └───────────────────────┘   └─────────────┘                 │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                     │                                       │
│                                     ▼                                       │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                       EXECUTION PATHS                                │   │
│  │                                                                      │   │
│  │  ┌──────────┬──────────┬──────────┬──────────┬──────────┐          │   │
│  │  │  DIRECT  │   RLM    │   ACE    │  HYBRID  │ CASCADE  │          │   │
│  │  │  <0.2    │ 0.2-0.5  │ 0.5-0.7  │  >0.7+   │  >0.7    │          │   │
│  │  ├──────────┼──────────┼──────────┼──────────┼──────────┤          │   │
│  │  │ Simple   │ Context  │ Consensus│ Combined │ Full     │          │   │
│  │  │ queries  │ compress │ building │ RLM+ACE  │ pipeline │          │   │
│  │  ├──────────┼──────────┼──────────┼──────────┼──────────┤          │   │
│  │  │  ~1s     │   ~5s    │   ~5s    │  ~10s    │  ~15s    │          │   │
│  │  ├──────────┼──────────┼──────────┼──────────┼──────────┤          │   │
│  │  │  Sonnet  │  Sonnet  │  Opus    │  Opus    │  Opus    │          │   │
│  │  └──────────┴──────────┴──────────┴──────────┴──────────┘          │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                     │                                       │
│                                     ▼                                       │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                    ACE 5-AGENT ENSEMBLE                              │   │
│  │                                                                      │   │
│  │   ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │   │
│  │   │ 🔬       │ │ 🤔       │ │ 🔄       │ │ 🛠️       │ │ 🔭       │ │   │
│  │   │ Analyst  │ │ Skeptic  │ │Synthesizr│ │Pragmatist│ │ Visionary│ │   │
│  │   │          │ │          │ │          │ │          │ │          │ │   │
│  │   │ Evidence │ │ Risks    │ │ Patterns │ │ Feasible │ │ Strategy │ │   │
│  │   │ Logic    │ │ Failures │ │ Connect  │ │ Practical│ │ Long-term│ │   │
│  │   └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │   │
│  │        │            │            │            │            │       │   │
│  │        └────────────┴────────────┼────────────┴────────────┘       │   │
│  │                                  ▼                                  │   │
│  │                        [CONSENSUS ENGINE]                           │   │
│  │                    Agreement scoring + synthesis                    │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                     │                                       │
│                                     ▼                                       │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                         DQ SCORING                                   │   │
│  │                                                                      │   │
│  │   ┌───────────────┐ ┌───────────────┐ ┌───────────────┐             │   │
│  │   │   VALIDITY    │ │  SPECIFICITY  │ │  CORRECTNESS  │             │   │
│  │   │     40%       │ │      30%      │ │      30%      │             │   │
│  │   │               │ │               │ │               │             │   │
│  │   │ Addresses     │ │ Detailed      │ │ Factually     │             │   │
│  │   │ the query?    │ │ actionable?   │ │ grounded?     │             │   │
│  │   └───────┬───────┘ └───────┬───────┘ └───────┬───────┘             │   │
│  │           │                 │                 │                      │   │
│  │           └─────────────────┼─────────────────┘                      │   │
│  │                             ▼                                        │   │
│  │                    [OVERALL DQ SCORE]                                │   │
│  │                    0.75 threshold (ELITE)                            │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Features

  • 5 Execution Paths: Direct, RLM, ACE, Hybrid, Cascade
  • 5-Agent ACE Ensemble: Analyst, Skeptic, Synthesizer, Pragmatist, Visionary
  • Smart Routing: Auto-selects optimal path based on query complexity
  • Provider Agnostic: Works with any LLM (OpenAI, Anthropic, Gemini, etc.)
  • DQ Scoring: Validity + Specificity + Correctness quality measurement
  • Multimodal Support: Text and image inputs
  • Real-time Status: Progress callbacks for UI integration
  • ELITE TIER: Maximum quality configuration by default

Installation

npm install @metaventionsai/cpb-core
# or
yarn add @metaventionsai/cpb-core
# or
pnpm add @metaventionsai/cpb-core

Quick Start

import { createCPB, type CPBProvider } from '@metaventionsai/cpb-core';

// 1. Define your LLM provider
const claudeProvider: CPBProvider = {
    name: 'claude',
    isConfigured: () => !!process.env.ANTHROPIC_API_KEY,
    generate: async (prompt, options) => {
        const response = await anthropic.messages.create({
            model: options?.model || 'claude-sonnet-4-20250514',
            messages: [{ role: 'user', content: prompt }],
            max_tokens: options?.maxTokens || 4096
        });
        return response.content[0].text;
    }
};

// 2. Create CPB instance (ELITE TIER by default)
const cpb = createCPB({
    fast: claudeProvider,      // Sonnet for simple queries
    balanced: claudeProvider,  // Opus for RLM/ACE paths
    deep: claudeProvider       // Opus for cascade path
});

// 3. Execute with auto-routing
const result = await cpb.execute({
    query: 'Compare microservices vs monolith architecture',
    context: systemDesignDoc
});

console.log(result.output);
console.log(`Path: ${result.path}`);           // 'ace'
console.log(`DQ Score: ${result.dqScore.overall}%`);  // 78
console.log(`Confidence: ${result.confidence}`);      // 85

ELITE TIER Configuration

Default configuration optimized for maximum quality:

Setting ELITE Value Standard Value Description
Default Path cascade direct Full pipeline by default
Context Threshold 100,000 50,000 Chars for RLM activation
Complexity Threshold 0.35 0.5 Lower = more consensus
DQ Threshold 0.75 0.6 Minimum acceptable quality
Fast Path Time 8s 5s More time for quality
Standard Path Time 45s 30s Extended reasoning
Hybrid Path Time 90s 60s Full pipeline allowance
RLM Iterations 25 10 Deeper decomposition
ACE Rounds 18 8 More consensus rounds
ACE Agent Count 5 3 Full ensemble

Use Standard Tier (Cost-Conscious)

import { createCPB, STANDARD_CPB_CONFIG } from '@metaventionsai/cpb-core';

const cpb = createCPB(providers, STANDARD_CPB_CONFIG);

5-Agent ACE Ensemble

The Adaptive Consensus Engine uses 5 specialized agents:

Agent Emoji Role Prompt Focus
Analyst 🔬 Evidence evaluator Data, evidence, logical consistency
Skeptic 🤔 Challenge assumptions Failure modes, risks, edge cases
Synthesizer 🔄 Pattern finder Connections, frameworks, integration
Pragmatist 🛠️ Feasibility checker Actionability, resources, constraints
Visionary 🔭 Strategic thinker Long-term, second-order effects

Consensus Scoring

Agreement is calculated via keyword overlap between agent responses:

// High agreement (>0.7): Strong consensus
// Moderate (0.4-0.7): Some divergence
// Low (<0.4): Significant disagreement - may need human review

Execution Paths

Path Complexity Use Case Speed Quality Model
Direct <0.2 Simple queries, navigation ~1s Good Sonnet
RLM 0.2-0.5 Long context, document analysis ~5s Better Sonnet
ACE 0.5-0.7 Decisions, trade-offs, consensus ~5s High Opus
Hybrid >0.7 Complex + long context ~10s Higher Opus
Cascade >0.7 Critical decisions, research ~15s Highest Opus

Path Selection Logic

// Automatic routing based on:
interface PathSignals {
    contextLength: number;       // Characters in context
    queryComplexity: number;     // 0-1 complexity score
    requiresConsensus: boolean;  // Multi-perspective needed?
    requiresReasoning: boolean;  // Deep analysis needed?
    timeBudgetMs: number;        // Time constraint
    qualityTarget: number;       // DQ threshold
}

DQ Score Breakdown

interface DQScore {
    overall: number;      // 0-100 weighted average
    validity: number;     // 40% - Does it address the query?
    specificity: number;  // 30% - Is it detailed/actionable?
    correctness: number;  // 30% - Is it factually grounded?
}

Quality Tiers

Tier Score Status
Excellent ≥0.85 🌟
Good ≥0.75 ✅
Acceptable ≥0.60 ⚠️
Below Threshold <0.60 ❌

Status Callbacks

const result = await cpb.execute(request, (status) => {
    console.log(`Phase: ${status.phase}`);
    console.log(`Progress: ${status.progress}%`);
    console.log(`Path: ${status.path}`);
    console.log(`Engine: ${status.currentEngine}`);
    console.log(`Message: ${status.message}`);
});

Phases

  1. analyzing - Determining optimal path
  2. compressing - RLM context compression
  3. exploring - Parallel exploration
  4. converging - ACE consensus building
  5. verifying - DQ verification
  6. reconstructing - Final synthesis
  7. complete - Done

Multi-Provider Setup

import { createCPB } from '@metaventionsai/cpb-core';

const cpb = createCPB({
    fast: geminiFlashProvider,   // Fast queries → Gemini Flash
    balanced: claudeSonnet,      // Analysis → Claude Sonnet
    deep: claudeOpus             // Deep reasoning → Claude Opus
});

Router Utilities

import {
    extractPathSignals,
    selectPath,
    canUseDirectPath,
    needsRLMPath,
    wouldBenefitFromConsensus
} from '@metaventionsai/cpb-core';

// Analyze without executing
const signals = extractPathSignals(query, context);
const decision = selectPath(signals);

console.log(`Recommended: ${decision.path}`);
console.log(`Confidence: ${decision.confidence}`);
console.log(`Reasoning: ${decision.reasoning}`);
console.log(`Alternatives:`, decision.alternatives);

// Quick checks
if (canUseDirectPath(query)) {
    // Skip CPB, use direct LLM call
}

if (needsRLMPath(query, longContext)) {
    // Context compression required
}

if (wouldBenefitFromConsensus(query)) {
    // Multi-agent consensus recommended
}

Force Specific Path

const result = await cpb.execute({
    query: 'Design a new API',
    forcePath: 'ace'  // Force consensus path
});

Research Foundation

CPB is built on research from:

Paper Topic Application
arXiv:2512.24601 Recursive Language Model Context externalization, compression
arXiv:2511.15755 (since withdrawn by its author) DQ Scoring Quality measurement framework (V+S+C formula adapted)
arXiv:2508.17536 Voting vs Debate Consensus strategies

Related Packages

  • @metaventionsai/voice-nexus - Voice AI architecture
  • ResearchGravity - Python CPB implementation

License

MIT © Dicoangelo

About

Cognitive Precision Bridge - AI orchestration with precision-aware routing through RLM, ACE, and DQ scoring

metaventionsai.com

Topics

aceaiai-agentscognitivedq-scoringllmmetaventions-aimulti-agentorchestrationprecision-routingrlmroutingself-improvingtypescript

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.