langchain.js
    Preparing search index...

    Class for storing and retrieving documents in memory asynchronously. Extends the Docstore class.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Parameters

      • Optionaldocs: Map<string, Document>

      Returns InMemoryDocstore

    Properties

    _docs: Map<string, Document>

    Methods

    • Adds new documents to the store.

      Parameters

      • texts: Record<string, BaseMessage>

        An object where the keys are document IDs and the values are the documents themselves.

      Returns Promise<void>

      Void

    • Parameters

      • _keys: string[]

      Returns Promise<void>

    • Parameters

      • keys: string[]

      Returns Promise<Document[]>

    • Parameters

      • keyValuePairs: [string, Document][]

      Returns Promise<void>

    • Searches for a document in the store based on its ID.

      Parameters

      • search: string

        The ID of the document to search for.

      Returns Promise<Document>

      The document with the given ID.

    • Parameters

      • Optional_prefix: string

      Returns AsyncGenerator<string>