Last week I realized our AI was sharing one user's excuses with a completely different person — fixing it with Hindsight banks took exactly three lines of code.
What We Built
AXIOM is a discipline accountability agent for engineering students. It tracks goals, scores discipline out of 1000, builds personalized daily plans, and remembers everything you tell it across sessions using Hindsight persistent memory.
My specific contribution was solving the multi-user problem — making sure each user's memory is completely private and isolated from everyone else's.
The Problem: One Brain, Many Users
Our initial implementation used a single Hindsight memory bank for everyone:
BANK_ID = "discipline-bot"
This meant every user's memories went into the same pool. When User A logged in, recall() might return memories from User B's sessions. The agent was accidentally sharing one person's goals, failures, and excuses with a completely different person.
For a discipline agent where the whole point is personal accountability — this was a fatal flaw.
The Fix: Per-User Banks
Hindsight's memory architecture uses memory banks — completely isolated containers where memories in one bank are never visible to another. The fix was simple:
BANK_ID = f"axiom-{st.session_state.username}"
When Samith logs in, his bank is axiom-samith. When John logs in, his bank is axiom-john. These banks are 100% isolated — no cross-contamination possible.
The best part: you don't need to pre-create these banks. Hindsight automatically creates a new bank the first time you call retain() on it. Zero configuration for new users:
# Login screen
name = st.text_input("Enter your name to begin:")
if st.button("Start Session"):
if name.strip():
st.session_state.username = name.strip().lower().replace(" ", "-")
st.session_state.user_set = True
st.rerun()
# Bank ID is automatically unique per user
BANK_ID = f"axiom-{st.session_state.username}"
No bank setup. No initialization. The first message a new user sends creates their entire private memory environment automatically.
Demonstrating Isolation to Judges
This became one of the most powerful parts of our demo:
- Open app → type "Samith" → have a full conversation, log some failures
- Click "Switch User" in sidebar → type "John"
- Completely blank memory — AXIOM has no idea who Samith is
Judges can see exactly how per-user memory isolation works in real time. It's live and demonstrable in 60 seconds.
Before vs After
Before: Single shared bank. User B could see User A's excuses. Privacy completely broken.
After: Every user has a private bank. axiom-samith and axiom-john are completely separate. The agent's responses are always grounded in that specific user's history only.
Lessons Learned
- Hardcoded bank IDs are a bug waiting to happen. Always use namespaced user-specific bank IDs from day one.
- Hindsight documentation confirms bank isolation is complete — memories in one bank are never visible to another.
- Hindsight bank auto-creation eliminates all onboarding friction — no initialization code needed.
- Memory isolation is a feature, not just a technical detail. Users need to trust their data is private.
- The Switch User demo is the single most convincing way to show judges how per-user persistent memory actually works.
Full code: https://github.com/itzsam10/axiom-discipline-ai
Live demo: https://axiom-discipline-ai-wstowhyf2yr6ehevrcb9nw.streamlit.app/
Top comments (0)