DEV Community

Cover image for How I Built Astra — An Emotional Memory AI Assistant with OpenAI and SQLite
Shane Sprague
Shane Sprague

Posted on

How I Built Astra — An Emotional Memory AI Assistant with OpenAI and SQLite

I recently finished building Astra, my first emotional memory AI assistant — and I wanted to share the project.


What is Astra?

Astra is an emotionally-aware assistant built with OpenAI and SQLite. She remembers what you say — including how you're feeling — and responds with empathy, memory, and continuity.

Astra tracks:

  • Facts you mention (e.g. birthdays, preferences)
  • Emotional phrases (e.g. "I'm overwhelmed")
  • Emotional trends over time (e.g. persistent sadness)
  • Your last seen, current mood, and context

All memory is stored locally in SQLite. There’s no server. No hosting. No analytics. Just a real-time assistant that learns and remembers.


Tech Stack

  • Python (core logic, CLI loop)
  • OpenAI GPT-4o (for responses + memory phrasing)
  • SQLite (for memory storage and time decay)
  • Regex + NLP light (for input parsing and normalization)

Why I Built Her

I wanted an assistant that could actually remember me.

Not just reply with static info, but one that could grow with me, reflect, and recognize emotional shifts over time.

I also wanted to challenge myself to build a full AI logic layer in one file. Astra’s current version lives in a single Python file with structured memory, mood inference, and even simulated typing.


Try It / Fork It

You can run Astra locally or modify her as your own emotional companion.

GitHub:

➡️ https://github.com/dshane2008/Astra-AI


Would love feedback or ideas from other devs working in the AI or emotional tech space.

Thanks for reading!

Top comments (1)

Collapse
 
nevodavid profile image
Nevo David •

Kinda into the whole idea of AI remembering emotions for once, not just facts - def something I'd mess around with myself.