Lesson 2 / 31
LangChain, LlamaIndex and Their Packages
Know which package to install and what each one is for.
Small core, many integrations
LangChain is split into packages: langchain-core (base interfaces: runnables, prompts, messages, output parsers, tools, the | composition), langchain (higher-level chains and agent helpers), provider packages such as langchain-openai or langchain-anthropic, langchain-text-splitters, and integration packages for vector stores and tools. LangGraph (separate) builds stateful agent workflows, and LangSmith is the tracing and evaluation service. LlamaIndex centres on data: llama-index-core provides documents, nodes, indexes, retrievers and query engines, with separate integration packages for LLMs, embeddings and vector stores. Package names and layouts evolve, so pin versions and read the current docs.
Installing what you need (shell)
Install only the pieces you use; the provider package depends on which model you call. Package names as of writing; not run here.
python -m venv .venv && source .venv/bin/activate
pip install langchain-core langchain-text-splitters # LangChain building blocks
pip install langchain-openai # one provider, e.g. OpenAI models
pip install llama-index-core # LlamaIndex core
pip install "langgraph" # stateful agents (optional)Quick check: What does langchain-core contain?
- Base interfaces such as runnables, prompts, messages, parsers and tools
- Every provider integration
- A trained model
- The LangSmith service
Answer
Base interfaces such as runnables, prompts, messages, parsers and tools — Core holds the shared abstractions; integrations live in separate packages.