A sophisticated dream journal system leveraging Generative AI and Deep Learning to uncover subconscious patterns, emotional arcs, and symbolic meanings in your dreams.
Python Streamlit LangChain Gemini PyTorch Matplotlib
- Symbolic Interpretation: Automatically identifies and interprets key symbols using Jungian and modern psychological application.
- Emotional Decoding: nuanced detection of implicit and explicit emotional states (e.g., nostalgia, dread, lucidity).
- Psychological Insights: Provides supportive, non-judgmental reflection prompts based on dream content.
- Temporal Sequence Analysis: Uses an LSTM (Long Short-Term Memory) neural network to detect patterns across a timeline of dreams.
- Anomaly Detection: Identifies dreams that deviate significantly from your usual narrative style or emotional baseline.
- Recurring Theme Tracking: Automatically links new dreams to past entries with similar semantic meaning.
- Pastel Aesthetic: Designed with calming pink, purple, and blue hues to promote a relaxed state suitable for reflection.
- Interactive Dashboard: Visualizes emotion frequencies and activity metrics.
- Emotion Distibution: View your emotional landscape with beautiful pastel pie charts.
- Semantic Search: "Find dreams about flying" works even if you never used the word "flying" (thanks to vector embeddings).
Technology: all-MiniLM-L6-v2 (Sentence Transformers)
- Embeddings: Converts dream narratives into 384-dimensional dense vectors.
- Vector Store: FAISS (Facebook AI Similarity Search) for millisecond-latency retrieval.
- Application: Enables the "Recurring Themes" feature, allowing users to find semantically similar dreams (e.g., linking a dream about "drowning" with one about "being overwhelmed at work").
Technology: Gemini 1.5 Flash (via LangChain)
- User inputs are processed through specialized prompt templates:
DREAM_ANALYSIS_SYSTEM_PROMPT: Enforces the persona of an empathetic expert analyst.SYMBOL_EXTRACTION_TEMPLATE: Structured extraction of archetypes into JSON.EMOTION_EXTRACTION_TEMPLATE: Multi-label emotion tagging.
Technology: PyTorch LSTM
- Architecture: A custom LSTM network taking sequence embeddings as input.
- Function: Analyzes a sliding window (default size 5) of recent dreams.
- Outputs:
- Anomaly Score: Probability of the current sequence being an outlier.
- Pattern Classification: Detects arcs like
anxiety_spike,resolution_arc, orlucidity_increase.
The system uses RunnableParallel from LangChain to execute Emotion Extraction and Symbol Recognition concurrently, minimizing latency while maximizing analysis depth.
┌─────────────────────────────────────────────────────────────┐
│ User Dream Entry │
└─────────────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ LLM Analysis (Gemini Flash) │
│ • Symbolism • Emotions • Psychology │
└──────────┬──────────────────────────────────────┬───────────┘
│ │
▼ ▼
┌─────────────────────────────┐ ┌──────────────────────────────┐
│ Vector Store (FAISS) │ │ Pattern Detector (LSTM) │
│ • Embeddings (MiniLM) │ │ • Sliding Window Analysis │
│ • Semantic Search │ │ • Anomaly Detection │
└─────────────────────────────┘ └──────────────────────────────┘
│ │
└──────────────────┬───────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Oneiros Streamlit Dashboard │
│ • Analytics • Visualizations • Library │
└─────────────────────────────────────────────────────────────┘
- Python 3.10+
- Google AI API Key (Get one here)
# Clone the repository (if applicable) or download files
cd oneiros
# Install dependencies
pip install -r requirements.txtSet your API key and run the single-file application.
Windows PowerShell:
$env:GOOGLE_API_KEY = "your-api-key-here"; python -m streamlit run oneiros_app.pyLinux/Mac:
export GOOGLE_API_KEY="your-api-key-here"
streamlit run oneiros_app.pyThe app will open at http://localhost:8501
- The Flying Garden: "I was flying over a garden made of crystal. The flowers were singing, but I felt anxious that I would fall."
- The Lost Key: "I was searching my childhood home for a key I knew I had lost, but every door I opened led to a forest."
- Late for the Exam: "I ran through endless corridors trying to find my math class, but the numbers on the doors kept changing."
oneiros/
├── oneiros_app.py # Main application (Consolidated Backend + Frontend)
├── requirements.txt # Python dependencies
└── README.md # This documentation
Oneiros is a tool for self-reflection and entertainment. It provides AI-generated interpretations based on common psychological symbolism and linguistic patterns. It is not a substitute for professional mental health advice, diagnosis, or treatment. If you are experiencing distress, please consult a qualified professional.
MIT License.
Built eeriely using Streamlit, LangChain, and Google Gemini