A small conference demo for "Building AI Agents That Remember." It compares the same Acme Dashboard support question in two modes:
With Memory: MongoDB + Pinecone + OpenAI memory pipelineWithout Memory: a stateless baseline that answers from the current message only
The browser UI sends the same prompt to both modes in parallel so the contrast is easy to narrate live.
- Node.js 18+
- A MongoDB instance
- A Pinecone index
- OpenAI API access
- Install dependencies:
npm install- Copy
.env.exampleto.envand fill in your keys:
cp .env.example .env- Create a Pinecone index that matches your embedding model dimensions.
For
text-embedding-3-small, use1536dimensions.
Seed Sarah's demo history:
node seed.jsStart the server:
node server.jsOpen the app:
http://localhost:3000
Try these prompts with sarah_demo:
Hey, any news on my CSV issue?By the way, we just upgraded to the Enterprise plan.Can you remind me what the export row limit was?
Then switch the user to new_user_123 and ask:
Hi, I need help with my account.
Memory-enabled:
curl -X POST http://localhost:3000/chat \
-H "Content-Type: application/json" \
-d '{"userId":"sarah_demo","message":"Hey, any news on my CSV issue?","mode":"memory"}'Stateless baseline:
curl -X POST http://localhost:3000/chat \
-H "Content-Type: application/json" \
-d '{"userId":"sarah_demo","message":"Hey, any news on my CSV issue?","mode":"stateless"}'- Capture: save messages to MongoDB and Pinecone
- Retrieve: find relevant memories and load the user profile
- Summarize: turn recent conversations into structured memory
- Evolve: decay old memories and detect contradictions
- The response includes
memoryUsedso you can show the retrieved context. - Important pipeline steps log to the terminal with labels like
[CAPTURE],[RETRIEVE], and[EVOLVE]. - This is intentionally a demo app, not a production system.