Inspiration
We were inspired by the powerful impact of journaling and memory recall on mental health. Studies show that reflecting on positive experiences and processing emotions through writing can significantly reduce stress and improve well-being. We wanted to harness this therapeutic potential using AI, making it easier for people to explore their emotions, identify patterns, and reflect on meaningful moments.
What it does
Our application integrates NLP, OpenAI models, and InterSystems IRIS to offer an innovative memory tracking solution for therapy. Here’s a breakdown of how our system functions:
Workflow Overview
User Submits Journal Entries:
- Users submit entries via a web interface.
- Each entry includes a description and relevant tags (e.g., “happy,” “stressful”).
Data Processing and Storage:
- Entries are stored in an InterSystems IRIS database with fields for user ID, entry date, description, tags, and generated embeddings.
Embedding Generation:
- NLP models analyze entries to generate embeddings that represent the content and emotional state for efficient search and retrieval.
Agent Creation and Interaction:
- An agent is created using LangChain and OpenAI GPT to process user queries. The agent is equipped to search the IRIS database for relevant memories based on user prompts and context.
- The agent is designed with a therapeutic persona, responding with empathy and guiding users through their emotions while providing relevant insights from past entries.
User Query and Retrieval:
- Users interact with the agent using natural language prompts (e.g., “Tell me about times I felt accomplished”).
- The agent queries the IRIS database, retrieves matching entries, and presents them to the user in a reflective, supportive manner.
How we built it
In building TheraSense, we used InterSystems IRIS’s vector search capabilities to enhance the efficiency and relevance of memory retrieval for users. This tool allowed us to process and store journal entries in a way that enabled rapid, accurate searches based on emotional context and similarity in meaning, not just keyword matches.
Using NLP models, we generated vector embeddings for each journal entry, representing the emotional tone, key themes, and content. These embeddings transformed each entry into a high-dimensional vector, capturing its meaning on a deeper level. By storing these embeddings in InterSystems IRIS, we leveraged its vector search functionality to efficiently query and retrieve entries that closely matched a user’s current emotional state or query prompt.
When a user prompted the system to “show times I felt happy” or “find moments when I felt accomplished,” the agent used vector search to identify entries that aligned emotionally or semantically with the request. This approach allowed TheraSense to retrieve relevant memories based on the deeper meaning within entries, rather than just surface-level keywords.
Vector search significantly enhanced the tool’s therapeutic value, enabling users to reflect on past experiences in a meaningful way, which was pivotal in making TheraSense a supportive and emotionally intuitive companion.
Challenges we ran into
We faced several challenges while building TheraSense:
Integrating Multiple Technologies: Combining Streamlit, InterSystems IRIS, and OpenAI’s language models presented compatibility issues and required extensive testing to ensure seamless data flow and interaction.
Efficient Vector Storage and Retrieval: Working with high-dimensional embeddings in InterSystems IRIS was complex. Optimizing vector search for quick, accurate memory retrieval without overwhelming the system required significant fine-tuning.
Crafting Empathetic AI Responses: Developing an agent that could respond with empathy, while also being informative, was challenging. It required fine-tuning the language model to make responses feel supportive rather than generic.
User Experience Design: We wanted the interface to be both simple and deeply functional. Balancing a clean UI with powerful features, without overloading users, required multiple iterations and user feedback.
Accomplishments that we're proud of
We’re proud of creating a tool that combines AI with empathy, enabling meaningful, personalized memory recall to support mental well-being. Our use of InterSystems IRIS vector search for emotional relevance, alongside NLP for nuanced insights, allowed us to make TheraSense a powerful, intuitive companion for users on their mental health journey.
What we learned
During the development of TheraSense, we gained valuable hands-on experience with Streamlit and InterSystems database systems.
Using Streamlit for the first time taught us how to rapidly prototype and deploy an interactive, user-friendly web application. We learned to design a clean, intuitive interface that guides users through journaling and memory retrieval processes seamlessly. Streamlit’s simplicity allowed us to focus more on functionality rather than extensive frontend coding, making it ideal for our project.
Working with InterSystems IRIS introduced us to managing and querying high-dimensional data. Integrating its database capabilities, including vector search, gave us a deeper understanding of efficient data storage and retrieval methods, especially for handling complex embeddings. Learning how to interact with InterSystems IRIS also helped us better manage our data pipeline, ensuring fast, accurate responses for user queries. This experience not only enhanced our technical skills but also deepened our appreciation for data architecture’s role in AI applications.
What's next for TheraSense
Integration with Mobile Devices: Expanding the platform to mobile apps will allow users to submit entries, query memories, and interact with the agent on the go. Integrating features such as voice recording and photo uploads can enrich the database with multimodal data, enhancing the recognition of emotional context through voice tone and visual cues.
Voice and Visual Recognition:
Voice Recordings: Users can record audio entries that are transcribed and analyzed for sentiment and emotional content. This allows for more spontaneous and detailed reflections. Photo Uploads: Users can attach photos that serve as visual memory anchors, creating stronger connections to specific events and emotional states. Applications for Alzheimer's and Depression:
Alzheimer's: Memory tracking tools can help reinforce cognitive functions by prompting users to recall past events. This may aid in slowing the progression of memory decline by engaging the brain in active recall. Depression: Tracking positive experiences and providing reminders of uplifting memories can combat negative thought patterns, offering therapeutic benefits through guided reflections.
Log in or sign up for Devpost to join the conversation.