@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
20 lines (19 loc) • 1.09 kB
TypeScript
/**
* Process-level cache for knowledge index snapshots.
*
* Knowledge sources are constructor-level static content. Multiple NeuroLink
* instances in the same server process can therefore share the same immutable
* lexical index instead of rebuilding it for every conversation/session.
*/
import type { KnowledgeFieldWeights, KnowledgeIndexSnapshot, KnowledgeSource, KnowledgeValidationResult } from "../types/index.js";
export declare const KNOWLEDGE_INDEX_CACHE_LIMIT = 32;
/**
* Cache key intentionally uses source/version metadata, not conversation scope.
* The source content hash prevents stale reuse even when a host forgets to bump
* a source version after changing entries.
*/
export declare const buildKnowledgeIndexCacheKey: (sources: KnowledgeSource[], fallbackVersion: string, weights: KnowledgeFieldWeights) => string;
export declare const getOrBuildKnowledgeIndexSnapshot: (sources: KnowledgeSource[], fallbackVersion: string, weights: KnowledgeFieldWeights) => Promise<{
snapshot: KnowledgeIndexSnapshot | null;
validation: KnowledgeValidationResult;
}>;