[GH-ISSUE #2177] [langchain]: use of @chain in 1.X docs #275

Open
opened 2026-02-17 17:19:32 -05:00 by yindo · 0 comments
Owner

Originally created by @niradar on GitHub (Jan 11, 2026).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/2177

Type of issue

issue / bug

Language

Python

Description

The example here: https://docs.langchain.com/oss/python/langchain/knowledge-base uses @chain

As far as I know you shouldn't use it in 1.X

full example:

from typing import List

from langchain_core.documents import Document
from langchain_core.runnables import chain


@chain
def retriever(query: str) -> List[Document]:
    return vector_store.similarity_search(query, k=1)


retriever.batch(
    [
        "How many distribution centers does Nike have in the US?",
        "When was Nike incorporated?",
    ],
)
Originally created by @niradar on GitHub (Jan 11, 2026). Original GitHub issue: https://github.com/langchain-ai/docs/issues/2177 ### Type of issue issue / bug ### Language Python ### Description The example here: https://docs.langchain.com/oss/python/langchain/knowledge-base uses @chain As far as I know you shouldn't use it in 1.X full example: ``` from typing import List from langchain_core.documents import Document from langchain_core.runnables import chain @chain def retriever(query: str) -> List[Document]: return vector_store.similarity_search(query, k=1) retriever.batch( [ "How many distribution centers does Nike have in the US?", "When was Nike incorporated?", ], ) ```
yindo added the langchainexternal labels 2026-02-17 17:19:32 -05:00
yindo changed title from [langchain]: use of @chain in 1.X docs to [GH-ISSUE #2177] [langchain]: use of @chain in 1.X docs 2026-06-05 17:26:00 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#275