---
hide_table_of_contents: true
---

import CodeBlock from "@theme/CodeBlock";

# How to use multiple memory classes in the same chain

It is also possible to use multiple memory classes in the same chain. To combine multiple memory classes, we can initialize the `CombinedMemory` class, and then use that.

import TextExample from "@examples/memory/combined.ts";

<CodeBlock language="typescript">{TextExample}</CodeBlock>
