@rocketlang/sahayak-core
v0.2.2
Published
Sahayak — Universal Assistant Core. One intent layer, every channel, every product: message in → structured, confidence-scored, Forja-routable instruction out. Rules before models. Humans govern writes. Built for Bharat (hi/en/Hinglish).
Maintainers
Readme
@ankr/sahayak-core
Sahayak (Hindi: the helper) — a universal assistant core: one intent layer for every channel (email, WhatsApp, Telegram, UI, voice) and every product.
import { match, resolveRoute } from '@ankr/sahayak-core';
const r = match('please approve the DA payment of USD 46,250 ref DA-FUJ-001', { domain: 'maritime' });
// → { intent: 'APPROVE_REQUEST', act: 'APPROVE', confidence: 0.97, band: 'act',
// entities: [amount, reference], lang: 'en', route: null }Why it's different
- Rules before models — 130+ curated patterns (en + hi/Hinglish) match first; an LLM fallback fires only below the suggest band, and its confidence is capped at 0.79 — a model guess can suggest, never auto-act.
- Capabilities are looked up, never claimed —
resolveRoute()resolves against a service's declared capability surface (ANKR Forja STATE); an unroutable intent returnsroute: null, never an invented endpoint. - Writes are proposals — destructive acts (APPROVE/CANCEL) need confidence ≥ 0.95, and execution always belongs to the consumer's human-gated engine.
- Clarify is a first-class outcome — below 0.60 you get
clarify_options(top-3), not a wrong guess. - The golden set is the contract — every release gates on eval accuracy ≥85%; every real-world miss enters the golden set before any pattern fix.
API
match(text, {domain?}) → MatchResult · resolveRoute(result, surface, overrides?, onUnroutable?)
· llmFallback(text, lang, domain?) · extractEntities(text) · detectLanguage(text)
License
AGPL-3.0-only · ANKR Labs (Powerpbox IT Solutions Pvt Ltd)
