Skip to content

nihalwashere/memory-agent-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Agent Demo

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 pipeline
  • Without 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.

Prerequisites

  • Node.js 18+
  • A MongoDB instance
  • A Pinecone index
  • OpenAI API access

Setup

  1. Install dependencies:
npm install
  1. Copy .env.example to .env and fill in your keys:
cp .env.example .env
  1. Create a Pinecone index that matches your embedding model dimensions. For text-embedding-3-small, use 1536 dimensions.

Run The Demo

Seed Sarah's demo history:

node seed.js

Start the server:

node server.js

Open the app:

http://localhost:3000

On-Stage Flow

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.

Backend-Only Curl Examples

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"}'

Memory Pipeline

  1. Capture: save messages to MongoDB and Pinecone
  2. Retrieve: find relevant memories and load the user profile
  3. Summarize: turn recent conversations into structured memory
  4. Evolve: decay old memories and detect contradictions

Demo Notes

  • The response includes memoryUsed so 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.

About

Building AI Agents That Remember

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors