@molroo-ai/sdk
    Preparing search index...

    Interface MemoryAdapter

    Memory Adapter interface for molroo SDK.

    Abstracts episode storage and recall so consumers can:

    • Store chat episodes to their own database (SQLite, Pinecone, Supabase)
    • Recall relevant memories for LLM context enrichment
    • Optionally store reflections generated from LLM

    Implementations are provided by the consumer — SDK only defines the interface.

    interface MemoryAdapter {
        getReflections?(sourceEntity?: string): Promise<Reflection[]>;
        recall(query: RecallQuery): Promise<Episode[]>;
        saveEpisode(episode: Episode): Promise<void>;
        saveReflection?(reflection: Reflection): Promise<void>;
    }
    Index

    Methods

    • Retrieve reflections for a source entity. Optional.

      Parameters

      • OptionalsourceEntity: string

      Returns Promise<Reflection[]>

    • Save a reflection generated by LLM. Optional — omit for episode-only storage.

      Parameters

      Returns Promise<void>