repowiselangchain-ai/langchain

Architecture of langchain-ai/langchain

langchain-ai/langchain is 2,994 source files holding 21,089 symbols across 2 modules, written mainly in Python, Makefile, Shell. The largest module is libs, with 2,698 files, and 23 files are entry points into the dependency graph.

How langchain fits together

The repository is organized as separate Python packages under libs, which holds most of its files. libs/core/langchain_core/__init__.py is the entry point of the langchain_core package, which provides the shared base layer for the other packages. libs/core/langchain_core/runnables/base.py is a hotspot file in that core package and defines the runnable base classes that components are built on. Provider integrations live under libs/partners, where libs/partners/openai/langchain_openai/chat_models/base.py holds the chat model code for OpenAI. libs/langchain_v1/langchain/__init__.py is the entry point of the langchain package that the quickstart imports from. A model object takes a prompt through invoke and returns the result.

Largest modules

  • libs: 2,698 files and 332,740 lines of code
  • .github: 9 files and 1,465 lines of code

Languages

By file count: Python 2,659 files, Makefile 24 files, Shell 22 files, JavaScript 2 files.

Documentation

Repowise documents langchain in 1,228 pages generated from the source.

More on langchain: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos