Who it is forA builder of a support or tutoring assistant that forgets every user the moment a session ends.
The problemStateless agents make users repeat themselves and cannot build on past conversations.
The outcomeAn agent with working memory for the current task and persistent memory it reads back in later sessions.
What you need first
- Python and pip
- An LLM provider for your agent's model calls
- Optional: a LangSmith account for tracing and the LangSmith Deployment platform
- For JavaScript or TypeScript, the separate LangGraph.js library
Steps
- Install with
pip install -U langgraph - Read the Comprehensive memory guide for short-term and long-term memory
- Keep in-progress reasoning in short-term memory and save durable facts to long-term memory
- Start a new session for the same user and confirm the agent recalls what it stored
- Trace a few runs in LangSmith to check what is written to and read from memory
Prompt for your agent
Using langchain-ai/langgraph, give my <assistant> short-term memory for the current conversation and long-term memory keyed by user, following the Comprehensive memory docs. Demonstrate it remembering a fact from a previous session.
Caveat. LangSmith is a separate LangChain product; the README does not state its pricing, so check before relying on it in production.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for langchain-ai/langgraph and "Give an agent memory that lasts across sessions"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer