Skip to main content
There are two common ways to use Tex with LangChain. Most chat apps should recall memory before the chain runs. Agents that choose their own steps can receive Tex as tools.

Inject (default)

1

Install dependencies

2

Construct Tex once

3

Recall → prompt → LLM → remember

Tools

1

Define tools with `@tool`

2

Pass tools into your agent

Add other LangChain tools to the same tools=[...] list. The Tex tools behave like normal tools.

Compared to BaseChatMemory

LangChain buffers keep history in process. Tex stores memory outside the process and returns the top matches for the current question. That keeps prompts smaller and survives deploys.
For the migration details, continue to Migrating from LangChain memory.