UNPKG

claude-flow

Version:

Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration

46 lines 2.1 kB
/** * GAIA Hardness Predictor — Feature Extraction (ADR-136 Track Q) * * Extracts a 17-dimensional feature vector from a GaiaQuestion for use * in the linear hardness classifier. Deliberately avoids external * dependencies (no spacy, no heavy NLP) — all extraction is regex-based * with O(1) per question. * * Feature vector layout (17 dims): * [0] question length in characters (normalised / 500) * [1] question length in words (normalised / 100) * [2] sentence count (normalised / 5) * [3] question word: "what" (0/1) * [4] question word: "how" (0/1) * [5] question word: "who/when/where" (0/1) * [6] question word: "calculate/compute/how many/what percentage" (0/1) * [7] has numeric token (0/1) * [8] has year token (4-digit) (0/1) * [9] has comparison keyword (0/1) * [10] estimated named-entity count (normalised / 5) * [11] digit-token count (normalised / 5) * [12] multi-hop signal (0/1) — bridge/relative clause pattern * [13] requires math (0/1) — "how many/much/percentage/calculate/compute" * [14] temporal chain (0/1) — "before/after X happened / since / until" * [15] tool implication count (normalised / 4) — PDF/image/video/URL markers * [16] file attachment present (0/1) * * All continuous values are min-max normalised to [0, 1] using fixed * divisors chosen so typical GAIA questions fall in [0.1, 0.9]. * * Refs: ADR-136, #2156 */ import type { GaiaQuestion } from '../gaia-loader.js'; export interface FeatureVector { /** Raw 17-element array in [0, 1]. */ values: number[]; /** Human-readable labels matching values index. */ labels: string[]; } export declare const FEATURE_LABELS: readonly string[]; /** * Extract the 17-dimensional feature vector from a GaiaQuestion. * All features are in [0, 1]. Never throws. */ export declare function extractFeatures(q: GaiaQuestion): FeatureVector; //# sourceMappingURL=features.d.ts.map