Problem-solving typically involves a series of steps. When using LLMs, some applications have relatively complex requirements and a sequence of calls for performing an operation. Here’s when runnables come into play.

This functionality was previously fulfilled by the LLMChain class; however, that class was deprecated in version 0.1.17. We now use runnable instead.

What is a runnable?

In LangChain, runnables are powerful abstractions representing any callable unit of work. They encapsulate and manage various tasks, including LLM calls, database queries, and calls to external APIs.

This allows us to chain together diverse operations consistently and manageably, making it easy to construct complex workflows within LangChain applications.

Get hands-on with 1400+ tech skills courses.