DEV Community

trigunadeepika20-ctrl
trigunadeepika20-ctrl

Posted on

Teaching an AI to Call Out My Excuses Using Hindsight Memory

Teaching an AI to Call Out My Excuses Using Hindsight Memory
Tags
ai, python, hindsight, productivity
Cover Image
Screenshot of AXIOM chat conversation using Win+Shift+S
Article Body
I told our AI I was too tired to study on Tuesday. On Friday it brought it up unprompted, with the exact date — and I hadn't touched the chat history.

What We Built

AXIOM is a personal discipline agent that holds engineering students accountable over time. Not just within a session — across days, weeks, and months. It asks about your projects, coursework, gym, sleep, and startup work every single day. It scores you out of 1000. It builds a personalized plan for tomorrow. And it never forgets what you told it.

The memory layer is powered by Hindsight. The inference runs on Groq with Llama 3.1. The UI is Streamlit. I focused on the user experience side — what it actually feels like to use an agent with real persistent memory.

The Daily Check-In

Every time you open AXIOM, it greets you by name and fires a structured check-in:

NeuroKey — Progress today? Any blockers?
VLSI / DSP — Coursework completed?
Gym — Did you go? Followed your diet?
Tinkercore / IoT Club — Any tasks done?
Sleep — Hours last night?

You answer honestly. AXIOM responds based on your specific history retrieved from Hindsight. If you've been avoiding your capstone project for three days, it knows. If you've used the same excuse twice, it calls it out.

The Scoring System

Every response from Groq contains a hidden scoring tag that the code intercepts before display:

def get_pts(text):
    m = re.search(r'\[SCORE:([+-]\d+)\]', text)
    return int(m.group(1)) if m else None
Enter fullscreen mode Exit fullscreen mode

Report real progress → score goes up, heatmap turns blue. Make an excuse → score drops, heatmap turns red. Saying "I did stuff today" scores lower than "I completed the DSP assignment and fixed the EEG noise issue in NeuroKey."

The Discipline Plan

After a full day report, AXIOM generates a personalized hour-by-hour schedule for tomorrow:

def generate_plan(summary):
    prompt = f"""Create a discipline schedule for TOMORROW based on: "{summary}"
    Output ONLY a JSON array. Each item: {{"hour":6,"task":"Wake up","type":"health"}}"""
Enter fullscreen mode Exit fullscreen mode

The plan appears in the sidebar with times and task types. At each scheduled hour, when the app is open, AXIOM fires a reminder automatically.

What Hindsight Actually Feels Like

The moment that changed my understanding of agent memory was when I tested a multi-day session. I told AXIOM on Tuesday that I was too tired to work on my NeuroKey BCI project. On Friday, without me mentioning it, AXIOM said:

"You logged on March 19th that you were too tired to work on NeuroKey. It's now March 22nd — that's four days without any BCI progress. Is this still a blocker or are you avoiding it?"

That response came from recall() retrieving a structured fact with a timestamp from three days earlier — from Hindsight's memory system doing exactly what it's designed to do.

Before vs After

Before: Generic responses every session. "Make sure to study regularly!" The agent had no idea I'd skipped my capstone project five days in a row.

After: Specific, dated, contextual accountability. The agent builds a real model of your behavior patterns over time.

Lessons Learned

  • The difference between a chatbot and an accountability agent is memory quality. Session state gives you a chatbot. Hindsight gives you a mentor.
  • Explicitly instruct the model to cite memories with dates. Without that instruction it ignores retrieved context completely.
  • Tone calibration matters. Match the agent's tone to the content — warm for greetings, firm for repeated failures.
  • The discipline plan generation is the most impressive demo moment for judges.
  • Scheduled reminders tied to the generated plan make the whole system feel alive, not just reactive.

Full code: https://github.com/itzsam10/axiom-discipline-ai

Live demo: https://axiom-discipline-ai-wstowhyf2yr6ehevrcb9nw.streamlit.app/

Top comments (0)