Para mantener **contexto** entre mensajes, acumula el historial
```typescript
import { ChatOpenAI } from "@langchain/openai";
import { HumanMessage, AIMessage } from "@langchain/core/messages";
const model = new ChatOpenAI({ model: "gpt-4.1-mini" });
const history = [
new HumanMessage("Hola, me llamo Juan"),
new AIMessage("Hola Juan, ¿en qué puedo ayudarte?"),
new HumanMessage("¿Cuál es mi nombre?")
];
const response = await model.invoke(history);
console.log(response.content);
// → "Tu nombre es Juan"
```