LangChain explained: getting started, framework, LLMs, company, history, speed, retrievers

Get started with LangChain, framework vs library, LangChain vs LLMs, who makes it, its history and business, LangGraph, speed and empty retrievers.

Walking a room through the products he has shipped
Walking a room through the products he has shipped

Key takeaways

  • LangChain is an open-source framework of libraries that connects LLMs to prompts, data, tools and memory.
  • An LLM generates text, while LangChain orchestrates the application around it.
  • Harrison Chase released LangChain in October 2022, and LangChain, Inc. followed in 2023.
  • The company earns mainly from LangSmith and also maintains LangGraph for stateful agents.
  • Empty SelfQueryRetriever results usually come from generated metadata filters that match nothing.

LangChain is a popular open-source framework for building applications with language models, from simple chains to retrieval systems and agents, backed by a company of the same name. I build RAG pipelines in Python with FastAPI, such as RAG.NextUpgrad with hybrid retrieval and reranking, so this page covers getting started, whether LangChain is a library or framework, how it differs from an LLM, who makes it, its company, history and business model, LangGraph, faster responses and empty self-query results.

How do you get started with LangChain?

Install the langchain package plus an integration for your model provider, such as langchain-openai or langchain-anthropic, set your API key as an environment variable, initialise a chat model, and invoke it with messages.

Also asked as: langchain guide to get started · when langchain started

From there, add prompt templates to structure inputs, structured output for reliable formats, and tools for agents. For retrieval, load documents with a loader, split them, embed them into a vector store, and wrap the store as a retriever. LangChain 1.0 introduced a simplified agent interface built on LangGraph, so newer tutorials look different from older chain-based ones; follow the current documentation. Enable LangSmith tracing early to see every step, prompt and token count. Build one small working example before adding more abstractions.

Is LangChain a library or a framework?

LangChain is best described as a framework made up of several libraries: langchain-core with base abstractions, the main langchain package with agents and chains, and many integration packages for model providers, vector stores and tools.

Also asked as: is langchain a library or framework

A library is code you call; a framework provides structure that your code plugs into. LangChain does both: you can call a single chat model wrapper like a library, or build applications around its abstractions for prompts, retrievers, tools and agents. It exists in Python and JavaScript versions. Its integrations are its biggest strength, letting you swap model providers or vector stores with small code changes. The trade-off is abstraction, which some developers find adds complexity compared with calling provider SDKs directly.

What is the difference between an LLM and LangChain?

An LLM is the model that generates text, such as GPT, Claude, Gemini or Llama. LangChain is software that sits around LLMs, connecting them to prompts, data, tools, memory and other models to build complete applications.

Also asked as: difference between llm and langchain

The LLM provides the intelligence; LangChain provides the plumbing. For example, a question-answering app needs to load documents, split and embed them, retrieve relevant passages, format a prompt, call the model and parse the answer, and LangChain offers components for each step. You can build the same app without LangChain using provider SDKs and your own code, which many teams prefer for simple systems. LangChain becomes more valuable when you need many integrations, agents with tools, or consistent tracing across complex pipelines.

Who makes LangChain?

LangChain was created by Harrison Chase as an open-source project in 2022 and is developed by LangChain, Inc., the company he co-founded, along with a large community of open-source contributors.

Chase released the first version in October 2022, and it gained popularity quickly after ChatGPT's launch the following month, as developers looked for ways to build applications on language models. The company formed in early 2023 to support the project and build commercial products, raising venture funding from investors. Thousands of contributors have added integrations for model providers, vector databases and tools, making it one of the largest open-source AI projects on GitHub. The core team maintains LangChain, LangGraph and the LangSmith platform.

Is LangChain a company?

Yes. Besides the open-source framework, LangChain, Inc. is a company that maintains the open-source projects and sells commercial products, mainly the LangSmith platform for tracing, evaluating, monitoring and deploying LLM applications and agents.

The open-source libraries remain free under the MIT license, so you can use LangChain without paying the company. The company's business depends on teams that need observability, evaluation datasets, prompt management, collaboration features and managed deployment for production agents. This open-core model is common in developer tools: a free framework builds adoption, and paid services help companies run applications reliably. LangSmith also works with applications built without LangChain, through its SDK and OpenTelemetry support, which broadens its market beyond framework users.

When did LangChain start?

LangChain started as an open-source Python project released by Harrison Chase in October 2022, shortly before ChatGPT launched. The company, LangChain, Inc., was founded in early 2023 as interest in building LLM applications surged.

The JavaScript version followed in early 2023, and the project grew rapidly through 2023 as developers built chatbots, retrieval systems and early agents. LangSmith launched later in 2023 for tracing and evaluation, and LangGraph arrived in early 2024 for stateful, controllable agents. The framework went through major restructuring, splitting into core and integration packages, and reached its 1.0 releases for LangChain and LangGraph in 2025. Its history mirrors the broader shift from simple prompt chains toward agents and production tooling.

How does LangChain make money?

LangChain makes money from commercial products built around its free open-source framework, chiefly LangSmith, which offers tracing, evaluation, monitoring, prompt management and managed deployment for agents, sold through usage-based and enterprise plans.

Enterprise customers pay for features such as self-hosting, security controls, support and higher usage limits. The free framework drives adoption, and a share of developers become paying customers when they move to production and need observability. The company has also raised venture capital to fund growth. This model resembles other open-core developer tool companies, where the open-source project is the distribution channel and hosted services generate revenue. Check LangChain's current pricing page for plan details, since offerings change frequently.

Are LangChain and LangGraph from the same company?

Yes. LangGraph is built and maintained by LangChain, Inc. It is a lower-level framework for building stateful, controllable agents as graphs of steps, and it can be used with or without LangChain components.

LangGraph models an application as nodes, which are functions or model calls, connected by edges, with shared state passed between them. This supports loops, branching, human-in-the-loop approvals, persistence and recovery, which agents need in production. Since LangChain 1.0, LangChain's agent abstractions run on LangGraph under the hood. Use LangChain for quick, high-level building blocks and integrations, and LangGraph when you need explicit control over agent flow. Both integrate with LangSmith for tracing and deployment.

How do you make LLM responses faster in LangChain?

Stream responses so users see tokens immediately, choose a faster or smaller model, shorten prompts and retrieved context, cache repeated calls, run independent steps in parallel, and limit agent iterations and maximum output tokens.

Also asked as: how to make llm response faster ( langchain

Use the stream or astream methods and async execution in web servers. Enable LangChain's LLM cache for identical requests, and use provider prompt caching for long, stable system prompts. Retrieve fewer, better chunks with reranking instead of stuffing many into the prompt. Run retrieval and other independent calls concurrently with parallel runnables. Trace runs in LangSmith to find the slowest step, which is often an extra model call in a chain or a slow retriever. Sometimes removing a chain step entirely is the biggest speedup.

Why does a LangChain SelfQueryRetriever return empty results when the prompt works?

Usually because the LLM generates a metadata filter that matches nothing: wrong attribute names, mismatched value formats, case differences or unsupported comparators. The prompt looks correct, but the structured query sent to the vector store is too restrictive.

Also asked as: why does my selfqueryretriever (langchain) return an empty response despite the prompt working

Inspect the generated structured query by running the query constructor alone or tracing in LangSmith, then test that filter directly against your vector store. Make sure the attribute info you pass describes metadata fields with exact names, types and example values, such as lowercase genre labels or year as an integer. Check that your vector store's translator supports the operators generated. Allow the retriever to fall back to plain semantic search when the filter returns nothing, and consider an approach where filters are suggested but not enforced.

Sources

  1. LangChain documentationdocs.langchain.com
  2. LangChain repositorygithub.com
  3. LangGraph repositorygithub.com
  4. LangSmithlangchain.com
  5. Wikipedia, LangChainen.wikipedia.org
  6. LangChain, How to do self-querying retrievalpython.langchain.com
Pranjul Rathour
Pranjul Rathour
GenAI Engineer · India

GenAI engineer and AI product builder with 2+ years shipping production-grade AI systems: RAG pipelines, fine-tuned LLMs, hybrid retrieval and multi-modal apps across vision, speech and OCR, architected end to end from ingestion to deployment. Leads engineering for SCULT INDIA's 14-member team, founded the 500+ member TechVerse Enclave community and has mentored 200+ students. Three hackathon first prizes: Changethon 2025 (IIT Roorkee), Product Genesis at Vividhotsava 2025 (CSJMU) and BYTEBATTLE (MeetKats).

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way. Email pranjulrathour41@gmail.com.

Keep reading

More on RAG & retrieval

All RAG & retrieval guides →
Campus talks · hackathon judging · mentoring

Want this as a live session at your college?

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way.

Pranjul Rathour, GenAI engineer in India