langchain-community
langchain-community is the grab-bag package of third-party LangChain integrations: hundreds of document loaders, vector stores, retrievers, tools, and older chat model wrappers contributed by the community. It exists because the LangChain monorepo split in 2024 moved everything not core into this one package. As of mid-2026 it is officially sunset: the GitHub repo is archived with a 'no longer maintained' banner pointing to issue #674, while the package still pulls about 10 million downloads a week from existing codebases.
Treat it as a legacy compatibility layer, not a dependency you choose in 2026: the repo is archived and the ecosystem moved to per-provider langchain-* packages. Keep it only for long-tail integrations that never got their own package, and migrate everything else.
Use it if
- You maintain an existing LangChain app that already imports from langchain_community and migrating every loader and vector store is not worth it yet
- You need a long-tail integration (an obscure document loader or vector store) that never got its own langchain-* partner package
- You are on the 0.4.x line with langchain-core 1.x and just need imports to keep resolving while you migrate piece by piece
- You want BM25Retriever or a niche utility like SQLDatabase that has no direct partner-package equivalent
- You are starting a new project: the repo was archived in June 2026 and the package is sunset, so bug fixes and new integrations are done
- Your integration has a dedicated partner package (langchain-openai, langchain-anthropic, langchain-ollama, langchain-huggingface, langchain-chroma): those get updates, this does not
- You care about install weight: it drags in sqlalchemy, aiohttp, requests, numpy, pydantic-settings, and langchain-classic whether you use them or not
- You expect the wrappers to match current provider APIs: many chat model and embedding classes here were deprecated years before the sunset and lag the real SDKs
Setup reality
pip install langchain-community works, but that is where the honesty starts. The package is integration shells: almost every class needs its own extra dependency (faiss-cpu for FAISS, pypdf for PyPDFLoader, rank_bm25 for BM25Retriever, beautifulsoup4 for WebBaseLoader) and you find out at runtime via ImportError, not at install time. The 0.4.x line requires langchain-core>=1.4 and pulls langchain-classic, so pinning an older stack gets messy. And because the repo is archived, any bug you hit is yours to patch or work around.
Patterns
Install with a pin, given the sunsetinstall-pinned
pip install "langchain-community>=0.4,<0.5" langchain-core
# each integration needs its own extra package, e.g.:
pip install faiss-cpu pypdf rank_bm25The package is sunset, so pin the minor version. Integration classes import their backing library lazily; missing extras surface as ImportError at first use, not at install.
Load web pages and PDFs into Documentsload-documents
from langchain_community.document_loaders import WebBaseLoader, PyPDFLoader
web_docs = WebBaseLoader("https://example.com/post").load()
pdf_docs = PyPDFLoader("report.pdf").load() # one Document per page
print(pdf_docs[0].metadata) # {'source': 'report.pdf', 'page': 0, ...}WebBaseLoader needs beautifulsoup4, PyPDFLoader needs pypdf. Loaders return langchain_core Document objects, so they still plug into current 1.x chains.
Build an in-memory FAISS vector storevector-store-faiss
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
vs = FAISS.from_texts(["cats purr", "dogs bark"], OpenAIEmbeddings())
retriever = vs.as_retriever(search_kwargs={"k": 2})
print(retriever.invoke("what do cats do?"))Requires faiss-cpu. FAISS here is local and in-process; for a served vector DB the maintained partner packages (langchain-chroma, langchain-qdrant) are the better path.
Persist and reload a FAISS indexsave-load-faiss
vs.save_local("faiss_index")
from langchain_community.vectorstores import FAISS
vs2 = FAISS.load_local(
"faiss_index", OpenAIEmbeddings(),
allow_dangerous_deserialization=True,
)load_local refuses to run without allow_dangerous_deserialization=True because the index metadata is pickle; only load indexes you created yourself.
Keyword retrieval with BM25Retrieverbm25-retriever
from langchain_community.retrievers import BM25Retriever
retriever = BM25Retriever.from_texts(
["error handling in python", "async io patterns", "bm25 ranking"]
)
retriever.k = 2
print(retriever.invoke("python errors"))Needs rank_bm25. This is one of the classes with no partner-package home, which is exactly the kind of thing that keeps langchain-community in dependency trees.
Inspect a SQL database for LLM chainssql-database-utility
from langchain_community.utilities import SQLDatabase
db = SQLDatabase.from_uri("sqlite:///app.db")
print(db.get_usable_table_names())
print(db.run("SELECT count(*) FROM users"))Backed by sqlalchemy (already a hard dependency). db.run executes raw SQL, so never feed it model output without your own allowlisting.
Community chat model wrappers (deprecated path)chat-model-deprecated
# still works, but emits a deprecation warning:
from langchain_community.chat_models import ChatOllama
llm = ChatOllama(model="llama3")
# maintained replacement:
# pip install langchain-ollama
from langchain_ollama import ChatOllama as ChatOllamaNew
llm = ChatOllamaNew(model="llama3")Most chat model classes here were deprecated in favor of partner packages long before the sunset; the community versions miss newer provider features like current tool-calling formats.
Migrate HuggingFaceEmbeddings off communityembeddings-migration
# old (deprecated, warns):
from langchain_community.embeddings import HuggingFaceEmbeddings
# new (maintained):
# pip install langchain-huggingface
from langchain_huggingface import HuggingFaceEmbeddings
emb = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")The import path is usually the only change; constructor arguments carried over. This one-line swap pattern is how most of the migration off langchain-community goes.
DuckDuckGo search as an agent toolsearch-tool
from langchain_community.tools import DuckDuckGoSearchRun
search = DuckDuckGoSearchRun()
print(search.invoke("starlette 1.0 release date"))Requires the ddgs package (the renamed duckduckgo-search). Scraper-based tools like this break whenever the upstream site changes, and with the repo archived nobody ships the fix.
Cache LLM calls with SQLiteCachellm-cache
from langchain_core.globals import set_llm_cache
from langchain_community.cache import SQLiteCache
set_llm_cache(SQLiteCache(database_path=".langchain.db"))
# identical prompts now return the cached responseCaches key on the exact prompt and model parameters, so any change in the prompt template busts the cache. Works with current langchain-core chat models.
Find what you still import from the sunset packageaudit-imports
grep -rn "from langchain_community" --include="*.py" . | sort | uniq -c
# migrate anything with a partner package equivalent;
# keep only the long-tail classes with no new homeA worthwhile audit now that the repo is archived: most teams find only two or three classes actually need to stay on langchain-community.
Alternatives
| Package | Registry | Pick it when |
|---|---|---|
| langchain-openai | PyPI | You need OpenAI chat models or embeddings: the partner package tracks the provider API and is actively maintained. |
| langchain-huggingface | PyPI | You use HuggingFaceEmbeddings or HF pipelines: the community versions were deprecated in favor of this package. |
| llama-index | PyPI | Your app is mostly RAG over documents and you want maintained loaders and indexes without the LangChain stack. |
| haystack-ai | PyPI | You want a pipeline-oriented RAG framework with maintained integrations and less churn history. |