Blog Post

Microsoft Developer Community Blog
2 MIN READ

Quest 5 - I want to add conversation memory to my app

bethanyjep's avatar
bethanyjep
Icon for Microsoft rankMicrosoft
Jun 19, 2025

In this quest, you’ll explore how to build GenAI apps using a modern JavaScript AI framework, LangChain.js. LangChain.js helps you orchestrate prompts, manage memory, and build multi-step AI workflows all while staying in your favorite language.

Using LangChain.js you will make your GenAI chat app feel truly personal by teaching it to remember. In this quest, you’ll upgrade your AI prototype with conversation memory, allowing it to recall previous interactions making the conversation flow more naturally and human-like.

👉 Want to catch up on the full program or grab more quests? https://aka.ms/JSAIBuildathon

💬 Got questions or want to hang with other builders? Join us on Discord — head to the #js-ai-build-a-thon channel.

🔧 What You’ll Build

A smarter, context-aware chat backend that:

  • Remembers user conversations across multiple exchanges (e.g., knowing "Terry" after you introduced yourself as Terry) 
  • Maintains session-specific memory so each chat thread feels consistent and coherent 
  • Uses LangChain.js abstractions to streamline state management.

🚀 What You’ll Need

  1. ✅ A GitHub account
  2. Visual Studio Code
  3. Node.js
  4. ✅ A working chat app from previous quests (UI + Azure-based chat endpoint)

🛠️ Concepts You’ll Explore

 

Integrating LangChain.js

Learn how LangChain.js simplifies building AI-powered web applications by providing a standard interface to connect your backend with Azure’s language models. You’ll see how using this framework decouples your code and unlocks advanced features.

 

Adding Conversation Memory

Understand why memory matters in chatbots. Explore how conversation memory lets your app remember previous user messages within each session enabling more context-aware and coherent conversations.

 

Session-based Message History

Implement session-specific chat histories using LangChain’s memory modules (ChatMessageHistory and BufferMemory). Each user or session gets its own history, so previous questions and answers inform future responses without manual log management.

Seamless State Management

Experience how LangChain handles chat logs and memory behind the scenes, freeing you from manually stitching together chat history or juggling context with every prompt.

📖 Bonus Resources to Go Deeper

Updated Jul 09, 2025
Version 2.0
No CommentsBe the first to comment