LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicretrieverstime_weighted_retrieverTimeWeightedVectorStoreRetriever
    Class●Since v1.0

    TimeWeightedVectorStoreRetriever

    Copy
    TimeWeightedVectorStoreRetriever()

    Bases

    BaseRetriever

    Attributes

    Methods

    Inherited fromBaseRetriever(langchain_core)

    Attributes

    AtagsAmetadata

    Methods

    MinvokeMainvoke

    Inherited from

    View source on GitHub
    RunnableSerializable
    (langchain_core)

    Attributes

    Aname

    Methods

    Mto_jsonMconfigurable_fieldsMconfigurable_alternatives

    Inherited fromSerializable(langchain_core)

    Attributes

    Alc_secretsAlc_attributes

    Methods

    Mis_lc_serializableMget_lc_namespaceMlc_idMto_jsonMto_json_not_implemented

    Inherited fromRunnable(langchain_core)

    Attributes

    AnameAInputTypeAOutputTypeAinput_schemaAoutput_schemaAconfig_specs

    Methods

    Mget_nameMget_input_schemaMget_input_jsonschemaMget_output_schemaMget_output_jsonschemaM
    attribute
    vectorstore: VectorStore

    The VectorStore to store documents and determine salience.

    attribute
    search_kwargs: dict

    Keyword arguments to pass to the VectorStore similarity search.

    attribute
    memory_stream: list[Document]

    The memory_stream of documents to search through.

    attribute
    decay_rate: float

    The exponential decay factor used as (1.0-decay_rate)**(hrs_passed).

    attribute
    k: int

    The maximum number of documents to retrieve in a given call.

    attribute
    other_score_keys: list[str]

    Other keys in the metadata to factor into the score, e.g. 'importance'.

    attribute
    default_salience: float | None

    The salience to assign memories not retrieved from the vector store.

    None assigns no salience to documents not fetched from the vector store.

    attribute
    model_config
    method
    get_salient_docs

    Return documents that are salient to the query.

    method
    aget_salient_docs

    Return documents that are salient to the query.

    method
    add_documents

    Add documents to vectorstore.

    method
    aadd_documents

    Add documents to vectorstore.

    Time Weighted Vector Store Retriever.

    Retriever that combines embedding similarity with recency in retrieving values.

    config_schema
    Mget_config_jsonschema
    Mget_graph
    Mget_prompts
    Mpipe
    Mpick
    Massign
    Minvoke
    Mainvoke
    Mbatch
    Mbatch_as_completed
    Mabatch
    Mabatch_as_completed
    Mstream
    Mastream
    Mastream_log
    Mastream_events
    Mtransform
    Matransform
    Mbind
    Mwith_config
    Mwith_listeners
    Mwith_alisteners
    Mwith_types
    Mwith_retry
    Mmap
    Mwith_fallbacks
    Mas_tool