{"id":653,"library":"langchain-community","title":"LangChain Community Integrations","description":"LangChain Community provides a collection of third-party integrations for the LangChain ecosystem. These integrations implement base interfaces defined in LangChain Core, enabling connectivity to various LLM providers, document loaders, vector stores, and other tools within any LangChain application. It is actively maintained and currently at version 0.4.1.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/langchain-ai/langchain-community","tags":["langchain","llm","ai","integrations","community","rag","document loaders","vector stores"],"install":[{"cmd":"pip install langchain-community","lang":"bash","label":"Install `langchain-community`"}],"dependencies":[{"reason":"`langchain-community` builds upon the core abstractions defined in `langchain-core`.","package":"langchain-core","optional":false},{"reason":"Many specific LLM/ChatModel integrations (e.g., OpenAI) have moved to dedicated provider packages for better modularity.","package":"langchain-openai","optional":true},{"reason":"The main LangChain library for higher-level chains, agents, and retrieval algorithms.","package":"langchain","optional":true}],"imports":[{"note":"Many document loaders were moved from `langchain` to `langchain_community` in v0.2.","wrong":"from langchain.document_loaders import TextLoader","symbol":"TextLoader","correct":"from langchain_community.document_loaders import TextLoader"},{"note":"This provides a simple, dependency-free embedding for testing and quickstarts.","symbol":"FakeEmbeddings","correct":"from langchain_community.embeddings import FakeEmbeddings"},{"note":"A popular in-memory vector store, moved to `langchain_community`.","symbol":"FAISS","correct":"from langchain_community.vectorstores import FAISS"},{"note":"Provider-specific chat models like `ChatOpenAI` are now in dedicated packages (e.g., `langchain-openai`), not directly in `langchain-community`.","wrong":"from langchain_community.chat_models import ChatOpenAI","symbol":"ChatOpenAI","correct":"from langchain_openai import ChatOpenAI"}],"quickstart":{"code":"import os\nfrom langchain_community.document_loaders import TextLoader\nfrom langchain_community.embeddings import FakeEmbeddings\nfrom langchain_community.vectorstores import FAISS\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.output_parsers import StrOutputParser\nfrom langchain_openai import ChatOpenAI # Requires 'pip install langchain-openai'\n\n# Create a dummy text file for demonstration\nwith open(\"example.txt\", \"w\") as f:\n    f.write(\"LangChain is a framework for developing applications powered by large language models (LLMs).\")\n    f.write(\"\\nIt enables applications that are context-aware and can reason over data.\")\n\n# Set your OpenAI API key (replace with actual key or environment variable)\n# For a real application, use `os.environ.get(\"OPENAI_API_KEY\", \"\")`\nos.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\", \"sk-YOUR_OPENAI_KEY_HERE\")\n\n# 1. Load documents using a loader from langchain-community\nloader = TextLoader(\"example.txt\")\ndocuments = loader.load()\nprint(f\"Loaded {len(documents)} document(s).\")\n\n# 2. Create embeddings (using a fake one for simplicity in 'community' quickstart)\n# For real use, install a provider package like `langchain-openai` and use its embeddings.\nembeddings = FakeEmbeddings()\n\n# 3. Create a vector store from documents and embeddings\nvectorstore = FAISS.from_documents(documents, embeddings)\nprint(\"Vector store created.\")\n\n# 4. Perform a similarity search as a retriever\nretriever = vectorstore.as_retriever()\n\n# 5. Define a Chat Model (from a dedicated provider package, e.g., langchain-openai)\n# Ensure OPENAI_API_KEY is set in your environment.\nchat_model = ChatOpenAI(api_key=os.environ.get(\"OPENAI_API_KEY\"))\n\n# 6. Create a prompt template\nprompt = ChatPromptTemplate.from_messages([\n    (\"system\", \"You are an AI assistant. Answer the question based ONLY on the provided context.\"),\n    (\"human\", \"Context: {context}\\nQuestion: {question}\")\n])\n\n# 7. Build a RAG chain\nchain = (\n    {\"context\": retriever, \"question\": StrOutputParser()}\n    | prompt\n    | chat_model\n    | StrOutputParser()\n)\n\n# 8. Invoke the chain\nquestion = \"What is LangChain's primary purpose?\"\nresponse = chain.invoke(question)\nprint(f\"\\nQuestion: {question}\")\nprint(f\"Answer: {response}\")\n\n# Clean up the dummy file\nos.remove(\"example.txt\")","lang":"python","description":"This quickstart demonstrates how to load documents using `TextLoader` from `langchain-community`, create a simple vector store with `FAISS` and `FakeEmbeddings` (both from `langchain-community`), and then use an OpenAI Chat Model (from `langchain-openai`) with a basic RAG (Retrieval Augmented Generation) chain. It highlights using components from `langchain-community` alongside a common LLM provider package."},"warnings":[{"fix":"Always check the changelog or release notes before upgrading minor versions of `langchain-community`. Pin your `langchain-community` version to prevent unexpected breakage.","message":"Minor versions of `langchain-community` (e.x., 0.x.y to 0.y.z) may introduce breaking changes. Unlike `langchain` and `langchain-core`, it does not strictly adhere to semantic versioning due to the nature of community contributions and third-party integrations.","severity":"breaking","affected_versions":"0.1.0 and later"},{"fix":"Update your import statements: `from langchain.module import Class` becomes `from langchain_community.module import Class` or `from langchain_provider.module import Class`. Ensure the necessary integration package (e.g., `langchain-community`, `langchain-openai`) is installed.","message":"Many third-party integrations (e.g., specific Document Loaders, Vector Stores, LLMs) were moved from the main `langchain` package to `langchain-community` or dedicated provider packages (e.g., `langchain-openai`, `langchain-anthropic`) starting with LangChain v0.2. Attempting to import from old paths will result in `ImportError`.","severity":"breaking","affected_versions":"0.2.0 and later (for `langchain` main package), 0.0.1 and later (for `langchain-community` after the split)"},{"fix":"Refer to the specific integration's documentation to identify and install its required dependencies (e.g., `pip install langchain-community[webloaders]` or `pip install beautifulsoup4`). If using a dedicated provider package, install it (e.g., `pip install langchain-openai`).","message":"Using specific integrations within `langchain-community` often requires installing additional, sometimes optional, Python packages (e.g., `beautifulsoup4` for `WebBaseLoader`, `faiss-cpu` for `FAISS`, `openai` for `langchain-openai` classes). A `ModuleNotFoundError` for a seemingly related package means a sub-dependency is missing.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T17:20:40.166Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"pip install langchain-community","cause":"The `langchain-community` package is not installed in your Python environment or your virtual environment is not active.","error":"ModuleNotFoundError: No module named 'langchain_community'"},{"fix":"Change the import path to `from langchain_community.llms import OpenAI` (or `from langchain_community.chat_models import ChatOpenAI`, `from langchain_community.vectorstores import FAISS`, etc.) and ensure `langchain-community` (and relevant partner packages like `langchain-openai`) is installed.","cause":"Components like LLMs, Chat Models, and Vector Stores were moved from the main `langchain` package to `langchain-community` or specific partner packages (e.g., `langchain-openai`) in LangChain v0.2.0+ due to a modularization effort.","error":"ModuleNotFoundError: No module named 'langchain.llms'"},{"fix":"Remove the usage of `langchain.verbose` or consult the latest LangChain documentation for the equivalent new way to achieve the desired functionality (e.g., configuring logging directly or using `langchain_core` components).","cause":"This attribute or similar top-level configuration/utility functions have been removed or refactored in newer versions of LangChain (post-v0.2.0 modularization).","error":"AttributeError: module 'langchain' has no attribute 'verbose'"},{"fix":"Update your import statement, for example, change `from langchain.vectorstores import FAISS` to `from langchain_community.vectorstores import FAISS`.","cause":"You are using an old import path for a component (like vector stores, document loaders, or embeddings) that has been moved to the `langchain-community` package as part of the LangChain v0.2.0+ modularization.","error":"LangChainDeprecationWarning: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain_community.vectorstores instead:"},{"fix":"pip install langchain-chroma\nfrom langchain_chroma import Chroma","cause":"The Chroma vector store integration has been moved from `langchain_community.vectorstores` to its own dedicated `langchain-chroma` package.","error":"ImportError: cannot import name 'Chroma' from 'langchain_community.vectorstores'"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"0.4.1","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.45,"mem_mb":20.8,"disk_size":"206.3M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.36,"mem_mb":20.7,"disk_size":"205.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":17.2,"import_time_s":1.08,"mem_mb":20.8,"disk_size":"210M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1,"mem_mb":20.6,"disk_size":"210M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.68,"mem_mb":22.7,"disk_size":"225.5M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.81,"mem_mb":22.6,"disk_size":"224.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":14.8,"import_time_s":1.47,"mem_mb":22.7,"disk_size":"229M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.49,"mem_mb":22.6,"disk_size":"228M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.8,"mem_mb":22.6,"disk_size":"211.3M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.98,"mem_mb":22.5,"disk_size":"210.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":12.9,"import_time_s":1.8,"mem_mb":22.5,"disk_size":"214M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.9,"mem_mb":22.5,"disk_size":"214M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.77,"mem_mb":22.7,"disk_size":"210.5M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.78,"mem_mb":22.6,"disk_size":"209.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":13.1,"import_time_s":1.61,"mem_mb":22.7,"disk_size":"213M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.7,"mem_mb":22.6,"disk_size":"213M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.78,"mem_mb":24.4,"disk_size":"211.2M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.71,"mem_mb":24.5,"disk_size":"211.2M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":19.9,"import_time_s":1.61,"mem_mb":24.4,"disk_size":"218M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.52,"mem_mb":24.5,"disk_size":"218M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}