DreamScribe : Dream Interpreter + Journaling Bot
About the Project
DreamScribe is an innovative bot designed to unlock the mysteries of your dreams, offering a seamless blend of interpretation, mood analysis, and journaling.
Inspiration
Dreams are a universal human experience—mysterious, symbolic, and deeply personal. Inspired by the idea of blending psychology with technology, we set out to create the DreamScribe, a tool that not only deciphers the hidden meanings in dreams but also allows users to journal them for self-reflection. We wanted to build a bot that lets users log their dreams, provides symbolic interpretations, analyzes their mood, saves them in a searchable journal, and identifies recurring patterns. Our vision was to create a seamless experience where users could explore their subconscious through an intuitive chat interface, making self-discovery both accessible and engaging.
What We Learned
This hackathon was a whirlwind of learning for our team:
- Frontend Development: Our Frontend Developer gained expertise in building a responsive chat interface using React.js, ensuring users could easily input dreams and view their journal.
- Backend Development: The Backend Developer mastered Flask and SQLite, learning how to create a robust API to handle user inputs, store data, and communicate with the frontend.
- AI/NLP Integration: Our AI/NLP Specialist explored natural language processing with TextBlob for sentiment analysis and experimented with Hugging Face Transformers for dynamic dream interpretation, learning about the capabilities and limitations of pre-trained models.
- Team Collaboration: Working across frontend, backend, and AI/NLP roles taught us the importance of clear communication and task division in a time-constrained environment.
- Pragmatic Decision-Making: We learned to balance innovation with reliability, pivoting when necessary to deliver a functional project within the hackathon deadline.
How We Built It
Our project is a full-stack application combining a React.js frontend, a Flask backend, and NLP-powered features. Here’s how each team member contributed to bring it to life:
Frontend Development (Team Member 1: Frontend Developer)
- Chat Interface: Using React.js and the React Chat Widget library, we built a clean and intuitive chat interface where users can input their dreams via text (e.g., “I dreamed I was flying”). The interface ensures a smooth user experience with a conversational flow.
- Journal UI: We created a journal interface to display past dreams, their interpretations, and timestamps in a searchable format, styled with Material-UI for a polished look.
- Responsive Design: The frontend is fully responsive, ensuring users can access the bot on both desktop and mobile devices seamlessly.
Backend Development (Team Member 2: Backend Developer)
- Server Setup: We used Flask to set up a backend server running on
http://127.0.0.1:5000, handling user inputs and responses via a/chatAPI endpoint (POST method, JSON format:{"message": "user input", "user_id": "unique_id"}). - Database Integration: Implemented SQLite to store dreams in a
journal.dbdatabase with columns forid,dream_text,interpretation, andtimestamp. Users can save dreams and retrieve them later. - Session Management: Added in-memory session handling to track user interactions (e.g., storing the dream and interpretation before saving), ensuring a seamless flow between interpretation and journaling.
AI/NLP Integration (Team Member 3: AI/NLP Specialist)
- Dream Interpretation: Initially, we aimed to use Hugging Face Transformers (
distilgpt2) for dynamic dream interpretation, hoping to generate symbolic or psychological meanings on the fly. However, due to inconsistent results (see challenges below), we pivoted to a keyword-based system. We created a dictionary of 30 common dream symbols (e.g., “flying” means freedom, “lion” means strength) and asynonym_map(e.g., “soaring” maps to “flying”) to handle variations, ensuring robust interpretation. - Mood Tracking: Integrated TextBlob for sentiment analysis to classify the mood of each dream as “positive,” “negative,” or “neutral” based on the text (e.g., “I dreamed I was flying” is neutral, “I dreamed I was very successful” is positive).
- Pattern Recognition: Implemented a feature to identify recurring symbols across saved dreams (e.g., “I noticed a pattern: ‘flying’ appears 3 times in your dreams, often meaning freedom, ambition, or escaping something”), enhancing the journaling experience.
Integration
- The frontend communicates with the backend via the
/chatendpoint, sending user inputs and displaying the bot’s responses (e.g., interpretation, mood, and prompts like “Want to save this dream?”). - Commands like “I dreamed I was flying,” “save my dream,” and “show my dreams” drive the user flow, making the bot interactive and user-friendly.
Challenges We Faced
Building this project for hackathon presented several hurdles, made even more intense by the fact that we learned about the event just five days before the deadline annd came with its share of obstacles:
- Dynamic Interpretation with AI: Our AI/NLP Specialist experimented with Hugging Face Transformers (
distilgpt2) to interpret dreams dynamically, as outlined in our initial plan (Hours 5-6). However, the model often produced incoherent responses (e.g., continuing the dream as a story rather than interpreting it). Fine-tuning was not feasible within the hackathon timeframe, so we pivoted to a keyword-based system, expanding our symbol dictionary and adding synonym mapping to cover more scenarios. - Time Constraints: With the deadline looming (March 14, 2025, 5:00 PM GMT+5:30), we had to prioritize core features. We focused on interpretation, mood analysis, and journaling, leaving optional features like creative prompts for future iterations.
- Symbol Coverage: Early testing revealed our initial symbol dictionary was too limited (e.g., missing symbols like “lion” or “storm”). We expanded it to 30 symbols and added synonyms to improve flexibility, ensuring a better user experience.
- Frontend-Backend Integration: Coordinating between the frontend and backend teams was tricky under time pressure. We resolved this by defining clear API contracts early (e.g., JSON request/response format) and testing the integration thoroughly in Hours 11-12.
What’s Next
We’re thrilled with what we’ve achieved, but there’s room to grow:
- Integrate a fine-tuned language model (e.g., OpenAI GPT-4) for more accurate dream interpretations.
- Add voice input support for dream logging, enhancing accessibility.
- Implement user authentication to support multiple users with private journals.
- Introduce creative prompts (e.g., writing or art ideas based on dreams) to inspire users.
- Develop visualizations of dream patterns over time, making the journal more insightful.
The DreamScribe is a step toward understanding ourselves through our dreams—a fusion of technology, psychology, and creativity that we hope inspires others as much as it inspired us.
Built With
- face
- flask
- flask-(web-framework-for-api)
- hugging
- hugging-face-transformers-(distilgpt2
- material-ui
- material-ui-(styling-and-responsive-design)-**backend**:-python-3.11-(core-language)
- python-3.11
- react-chat-widget
- react-chat-widget-(conversational-flow)
- react.js
- sqlite
- sqlite-(database-for-storing-dreams)-**ai/nlp**:-textblob-(sentiment-analysis-for-mood-tracking)
- textblob
- transformers
Log in or sign up for Devpost to join the conversation.