reliable · intermediate · 40 min

Memory that outlives the conversation

Let your assistant store facts and find them in a later session, without one customer seeing another's.

HANDS-ON LAB · YOU RUN IT ON YOUR MACHINE · 4 STEPS
  1. Step 1 of 4

    Start Qdrant

    Run this to check

    docker run -d --name learn-qdrant -p 6333:6333 qdrant/qdrant && sleep 3 && curl -s http://localhost:6333/collections

    You pass when

    JSON with "status":"ok" and an empty list of collections.

  2. Step 2 of 4

    Add remember(fact) and recall(question) to your harness

    Run this to check

    uv run --with openai --with qdrant-client --with requests harness.py --customer ana "Remember that I prefer deliveries after 6pm"

    You pass when

    It confirms the fact was stored, and the collections list now has one entry.

    Files you write

    • harness.py
    • memory.py
  3. Step 3 of 4

    Start a new session and ask about it

    Run this to check

    uv run --with openai --with qdrant-client --with requests harness.py --customer ana "When should you deliver to me?"

    You pass when

    A fresh process answers after 6pm.

  4. Step 4 of 4

    Ask the same question as another customer

    Filter by customer in the database query, not in the prompt. A prompt can be talked out of a rule; a filter cannot.

    Run this to check

    uv run --with openai --with qdrant-client --with requests harness.py --customer ben "When should you deliver to me?"

    You pass when

    It does not know. Ana's fact never appears in Ben's session.

    Files you write

    • memory.py
No transcript here on purpose. This page does not show terminal output, because model answers differ from run to run. Each step says what a pass looks like; your own terminal is the proof.