LangGraph Memory Example
A LangGraph JavaScript agent with AgentCore Memory for conversation persistence.
Features
- Conversation Memory: Persist and recall conversation history across invocations
- Session Management: Track conversations by session ID
- Memory Expiration: Configurable TTL (30 days in this example)
- LangGraph JS: ReAct agent with memory-enhanced context
How It Works
- On each invocation, the agent retrieves previous conversation history from AgentCore Memory
- History is injected as system context for the LLM
- After generating a response, the conversation turn is stored in memory
- Subsequent invocations in the same session recall previous context
Quick Start
Deploy
npm install
sls deploy
Test
RUNTIME_ARN=<your-runtime-arn> node test-invoke.js
Remove
sls remove
Related Examples
- ../python/langgraph-memory - Python version