Memory-specific HNSW sidecar that wraps the canonical HnswIndexSidecar.

Maintains the original constructor-based API expected by Memory facade and Brain consumers, while delegating all index operations to the shared RAG implementation.

Accessors

Constructors

Methods

  • Add a vector to the index. If below threshold, does nothing. If threshold is crossed, caller should call rebuildFromData().

    Parameters

    • traceId: string

      The trace ID to associate with this vector.

    • embedding: number[]

      The embedding vector.

    • _totalCount: number

      Current total trace count (unused, kept for API compat).

    Returns Promise<void>

  • Rebuild the entire index from a set of id/embedding pairs. Called on first threshold crossing or when the index file is missing/corrupt. Filters out dimension-mismatched vectors before delegating.

    Parameters

    • data: {
          id: string;
          embedding: number[];
      }[]

      Array of { id, embedding } to index.

    Returns Promise<void>