Skip to content

LangChain

A caller-supplied LangChain chat model, selected with LLM_PROVIDER=langchain, used to extract facts from conversations.

Enable it

bash
LLM_PROVIDER=langchain
# No env vars: the LangChain chat model is passed in code, not configured by environment.
python
# The provider wraps a langchain_core BaseChatModel you construct and inject.
from langchain_openai import ChatOpenAI
from app.core.llms.factory import create_llm

llm = create_llm("langchain", model=ChatOpenAI(model="gpt-4o-mini"))

Configuration

VariableDefaultDescription
LLM_PROVIDERopenaiSet to langchain.

Notes

  • No environment configuration: the provider does no model construction or key handling itself.
  • It expects a langchain_core BaseChatModel instance; any other value raises a TypeError.
  • Requires langchain-core to be installed (pip install langchain-core).

The memory layer for AI agents.