@mastra/core
Version:
35 lines • 1.9 kB
TypeScript
import type { KnowledgeRun } from './run.js';
export declare const PINNED_KNOWLEDGE_STATE_ID = "knowledge";
export declare const PINNED_SNAPSHOT_TAG = "pinned-knowledge";
export declare const PINNED_DELTA_TAG = "pinned-knowledge-update";
export declare const DEFAULT_MAX_PINS = 20;
export declare const DEFAULT_PINNED_MAX_TOKENS = 500;
export declare const PIN_TRUNCATION_MARKER = "[truncated \u2014 knowledge_read for the rest]";
/** Entry id of the line listing stored pins that didn't fit the budget. */
export declare const PIN_OVERFLOW_ID = "overflow";
/** Most stored pins the overflow line names; the rest are counted. */
export declare const OVERFLOW_NAMES = 10;
export interface PinEntry {
id: string;
/** What the model reads; the only field in the prompt and the cache key. */
text: string;
/** The page's name, for display. Left off the overflow entry. */
name?: string;
/** The address of the page's home scope, e.g. `policy:acme`, for display. Left off the overflow entry. */
scope?: string;
}
export interface PinBudget {
maxPins: number;
maxTokens: number;
}
/** Prefix of a pinned listing's entry id; the rest is the listed page's id. */
export declare const PIN_LIST_ID_PREFIX = "list:";
/**
* The pinned pages a run receives, rendered: config pins first (always delivered; an equal share each
* when they alone exceed the token budget), then stored pins by `pinnedContextPriority` and recency while the
* pin and token budgets last, then one line naming up to ten stored pins that didn't fit and counting
* the rest. The line counts against the token budget. Only pages the run can read and that have a body
* are delivered. A run costs a fixed handful of store calls however many pins exist.
*/
export declare function knowledgeDeliveredPins(run: KnowledgeRun, budget: PinBudget): Promise<PinEntry[]>;
//# sourceMappingURL=pinned.d.ts.map