Skip to content

@agenticforge/utils

npm

Utility helpers for AgenticFORGE — LRU cache and prompt utilities.

Installation

bash
npm install @agenticforge/utils

Exports

NameDescription
LRUCacheHigh-performance LRU cache
PromptPrompt template with variable interpolation

LRUCache

ts
import {LRUCache} from "@agenticforge/utils";

const cache = new LRUCache<string, number[]>({maxSize: 512});

cache.set("embedding:hello", [0.1, 0.2, 0.3]);
const vec = cache.get("embedding:hello");

console.log(cache.size);  // 1
console.log(cache.has("embedding:hello")); // true

Released under the CC BY-NC-SA 4.0 License.