Repository: langchain
Issue: VectorStoreRetriever can't correctly handle keyword parameters from invoke()
Labels: Ɑ: vector store,🤖:bug,🔌: chroma,investigate,Ɑ: retriever,todo

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

```py
from typing import TYPE_CHECKING
from uuid import uuid4

from dotenv import load_dotenv
from langchain_chroma import Chroma
from langchain_core.documents import Document
from langchain_openai import OpenAIEmbeddings

if TYPE_CHECKING:
    from langchain_core.vectorstores.base import VectorStoreRetriever

load_dotenv()


def init_db(vs: Chroma) -> None:
    document_1 = Document(
        page_content="I had chocalate chip pancakes and scrambled eggs for breakfast this morning.",
        metadata={"source": "tweet"},
        id=1,
    )

    document_2 = Document(
        page_content="The weather forecast for tomorrow is cloudy and overcast, with a high of 62 degrees.",
        metadata={"source": "news"},
        id=2,
    )

    documents = [document_1, document_2]
    uuids = [str(uuid4()) for _ in range(len(documents))]

    vs.add_documents(documents=documents, ids=uuids)


def main(*, first_run_init_db: bool = False) -> None:
    vector_store = Chroma(
        collection_name="example_collection",
        embedding_function=OpenAIEmbeddings(model="text-embedding-3-small"),
        persist_directory="./chroma_langchain_db",
    )
    if first_run_init_db:
        init_db(vector_store)

    retriever: VectorStoreRetriever = vector_store.as_retriever(
        search_type="mmr", search_kwargs={"k": 1, "fetch_k": 2}
    )
    print(
        retriever.invoke("Stealing from the bank is a crime", filter={"source": "news"})
    )
    # output:
    # [Document(metadata={'source': 'tweet'}, page_content='I had chocalate chip pancakes and scrambled eggs for breakfast this morning.')]
    # The filter didn't perform as expected.


if __name__ == "__main__":
    main(first_run_init_db=True)
```

### Error Message and Stack Trace (if applicable)

stdout:
```shell
[Document(metadata={'source': 'tweet'}, page_content='I had chocalate chip pancakes and scrambled eggs for breakfast this morning.')
```

### Description

This code example uses the [Chroma documentation](https://python.langchain.com/v0.2/docs/integrations/vectorstores/chroma/#query-by-turning-into-retriever) and retains only two documents from the example.

Surprisingly, `filter={"source": "news"}` did not work as expected, and I received results outside of that filter.

I readed the source code and found that the docstring in the invoke indeed allows such behavior.(parameters can be passed to the retriever from the invoke) ⬇️
![image](https://github.com/user-attachments/assets/5856061e-30ae-4c36-a3d3-f3fd17620ef1)

The function indeed passes `**kwargs` to `_get_relevant_documents`.
However, the `_get_relevant_documents` function doesn't accept kwargs parameters. ⬇️
![image](https://github.com/user-attachments/assets/1f786153-6ff0-44f0-acd8-6302f9ea50c7)

The actual implementation of `_get_relevant_documents` in the `VectorStoreRetriever` doesn't accept `**kwargs`, which ultimately leads to the unexpected results.

### System Info

langchain==0.2.14
langchain-core==0.2.33

platform==windows
python-version==3.12.5