AI / LangGraph LangChain Interview questions
How does LangChain handle versioning?
LangChain follows a modular package structure that allows different parts of the ecosystem to evolve at different speeds without breaking stable core interfaces. As of 2024, the main packages are:
- langchain-core — Stable base abstractions: Runnable, BaseMessage, BasePromptTemplate, BaseOutputParser. Changes here are rare and follow strict semver. Most application code depends only on this.
- langchain — Orchestration logic: Chains, Agents, ConversationMemory, AgentExecutor. Versions are released frequently but follow deprecation warnings.
- langchain-community — Third-party integrations (vector stores, document loaders, tool wrappers). Changes fast; pin carefully in production.
- Provider packages (langchain-openai, langchain-anthropic, langchain-google-genai, etc.) — Maintained separately so OpenAI SDK updates don't break Anthropic users.
- langchain-experimental — Unstable, experimental features not ready for production.
When a feature is deprecated (e.g. LLMChain in favour of LCEL), LangChain emits LangChainDeprecationWarning for at least one major version before removal. Pin versions in requirements.txt or use a lockfile (pip-tools, poetry.lock) to avoid unintentional upgrades in production.
More Related questions...