actrone-memory
    Preparing search index...

    Class FastEmbedEmbedder

    In-process ONNX dense embedder via fastembed (fastembed-js, onnxruntime, no torch/GPU). The preferred "real" recall tier: local-first, zero-egress after a one-time model download (about 130 MB), no API key. Default model bge-small-en-v1.5 (384-dim), the same model the Python library uses. fastembed is an optional peer: install it (npm i fastembed) and MemoryManager.create() picks it up automatically; without it buildLocalEmbedder degrades to the dependency-free lexical LocalEmbedder.

    Implements

    Index
    dimensions: number

    The dimensionality of vectors this embedder produces.

    relevanceThreshold: number | undefined

    The cosine similarity at which this model's results turn from unrelated to relevant, used as the admission threshold when MemoryConfig.relevanceThreshold is not set. Declare it for a custom embedder once you have measured it; leave it out to use the library default.

    • Load the model, resolving its dimension by a probe embed. The first call downloads the model into cacheDir; every later call loads it from there, offline.

      Parameters

      • opts: { modelName?: string; cacheDir?: string } = {}
        • OptionalmodelName?: string

          A fastembed-js model id. Defaults to DEFAULT_FASTEMBED_MODEL. Only the default model carries a calibrated relevanceThreshold; set one in your config for others.

        • OptionalcacheDir?: string

          Where model files are kept. Defaults to FASTEMBED_CACHE_PATH, else ~/.cache/actrone-memory/fastembed, never the current directory.

      Returns Promise<FastEmbedEmbedder>

      When fastembed is not installed or the model cannot be loaded or downloaded.

    • Embed a single text into a dense vector.

      Parameters

      • text: string

      Returns Promise<number[]>