Fully offline AI-powered dream interpretation app based on Ibn Sirin's teachings with local LLM, voice input, and no server dependencies
- Project Overview
- Architecture
- Features
- Quick Start
- Development Setup
- Project Structure
- Services
- Screens
- Local Models
- Troubleshooting
- Future Plans
DreamCatcher is a fully offline React Native app that interprets dreams using:
- Ibn Sirin's Dictionary of Dreams: 2,157 unique dream symbols (bundled)
- Local AI: Runs offline with Llama-based models (Qwen2.5, SmolLlama, LFM2.5)
- RAG (Retrieval-Augmented Generation): Keyword-based symbol matching with LLM interpretation
- Voice Input: Whisper STT for hands-free dream recording
- Persistent Storage: AsyncStorage for chat history
Primary Use Case: Islamic dream interpretation with traditional symbol meanings enhanced by AI analysis
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Native App (Fully Offline) β
β β
β βββββββββββββββ βββββββββββββββ β
β β Screens β β Services β β
β β - Dream β β - localLLM β β
β β - History β β - whisper β β
β β - Symbols β β - rag β β
β βββββββββββββββ β - symbols β β
β β - chat β β
β βββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Local Storage (AsyncStorage) β β
β β - Chat history β β
β β - Model preferences β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Bundled Data & Downloaded Models β β
β β - Ibn Sirin's Dictionary (JSON) β β
β β - Whisper model (ggml-base.bin) β β
β β - Local LLM models (downloaded at runtime)β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Symbol-based lookup: Keyword matching through 2,157 dream symbols
- AI-powered analysis: Local LLM provides contextual interpretation
- RAG Integration: Combines symbol meanings with LLM reasoning
- Chat Interface: Persistent dream history with timestamps
- Speech-to-Text: Whisper model for hands-free dream recording
- Auto-transcription: Immediate conversion to text
- No servers needed: Everything runs locally on-device
- No internet required: Works completely offline
- Model management: Download optional AI models for better interpretations
- Full symbol catalog: Browse all 2,157 Ibn Sirin symbols
- Search functionality: Quick symbol lookup with related terms
- Detailed interpretations: Complete symbol meanings
- Persistent storage: All dreams saved locally
- Swipeable management: Delete individual chats or clear all
- Full conversations: Review complete dream interpretation threads
- Node.js: >= 20
- Ruby & Bundler: For CocoaPods (iOS)
- Xcode: For iOS development (macOS only)
- Android Studio: For Android development (optional)
# Clone repository
git clone https://github.com/kaiyes/dreamcatcher.git
cd dreamCatcher
# Install dependencies
npm install
# iOS: Install CocoaPods
cd ios && bundle exec pod install && cd ..# Terminal 1: Start the app (iOS)
npm run ios
# OR Android
npm run androidThat's it! No servers or additional setup needed.
dreamCatcher/
βββ src/
β βββ screens/
β β βββ dreamInterpret.screen.js # Main chat UI
β β βββ chatHistory.screen.js # View saved chats
β β βββ chatDetail.screen.js # Full conversation
β β βββ symbolList.screen.js # Browse symbols
β β βββ symbolDetail.screen.js # Symbol details
β β βββ localLLMTest.screen.js # Model management
β βββ services/
β β βββ localLLM.service.js # Local AI models
β β βββ whisper.service.js # Voice input
β β βββ rag.service.js # Symbol retrieval
β β βββ symbols.service.js # Symbol search
β β βββ chat.service.js # Chat persistence
β βββ util/
β β βββ symbols_full.json # Ibn Sirin's Dictionary
β β βββ symbolEmbeddings.json # Search index
β β βββ prompt.js # LLM prompts
β βββ assets/ # Images & icons
β βββ Navigation.js # Route configuration
βββ ios/
β βββ Podfile # Native dependencies
βββ android/
β βββ build.gradle # Android config
βββ metro.config.js # Bundler config
βββ package.json # Dependencies
metro.config.js: Configured to bundle model files
.bin(Whisper model).json(Embedding index, symbol database).onnx(Model formats)
.gitignore: Excludes downloaded models (they're stored locally on-device)
Purpose: Download and run AI models locally
Available Models:
| Model | Size | Speed | Quality |
|---|---|---|---|
| SmolLlama 101M (Q3_K_M) | 44MB | Fast | Good |
| Qwen2.5 1.5B (Q4_0) | 934MB | Medium | Excellent |
| LFM2.5 1.2B (Q4_0) | 790MB | Medium | Excellent |
Functions:
downloadModel(modelKey, onProgress)- Download from Hugging FaceinitLocalLLM(modelKey)- Load model for inferencecompleteLocalLLM(prompt)- Generate dream interpretation
Model Context: 2048 tokens, GPU acceleration available
Purpose: Speech-to-text for dream recording
Model: ggml-base.bin (bundled in app)
Functions:
initWhisperModel()- Load modelstartRecording()- Begin audio capturestopAndTranscribe()- Stop and transcribecancelRecording()- Cancel without transcription
Audio Config:
{
sampleRate: 16000,
channels: 1,
bitsPerSample: 16,
format: 'wav'
}Purpose: Retrieve relevant dream symbols for interpretation
Search Strategy: Keyword matching with relevance scoring
- Multi-level matching (exact, prefix, substring)
- Stop word filtering
- Ranked results by relevance
Functions:
findMatchingSymbols(dreamText)- Find symbols in dream description- Returns sorted list with names, meanings, related terms
Fallback: Displays raw Ibn Sirin definitions if LLM not available
Purpose: Direct symbol lookup and search
Functions:
searchSymbols(query)- Find symbols by name/keywordsgetSymbolById(id)- Get specific symbolgetAllSymbols()- Get full dictionaryextractKeywords(dreamText)- Parse dream for keywords
Purpose: Persistent chat history
Functions:
getChats()- Get all saved chatsgetChat(id)- Get specific chatsaveChat(chat)- Save new chatdeleteChat(id)- Delete individual chatdeleteAllChats()- Clear all historyaddMessageToChat(id, message)- Add message to existing chat
Storage: AsyncStorage (local device storage)
Purpose: Main interface for dream interpretation
Features:
- Text input with send button
- Voice recording button (Whisper)
- Real-time streaming LLM responses
- Symbol list display
- Model selector modal
- "New Chat" and "Chat History" buttons
- Examples on empty state
Flow:
- User describes dream (text or voice)
- RAG finds matching symbols
- LLM (if loaded) combines with symbol meanings
- Results displayed with formatting
- Saved to chat history
Purpose: Browse all saved dreams
Features:
- List of all chats with timestamps
- Last message preview
- Message count badge
- Swipe to delete individual chats
- "Delete All" button
- Tap to view full conversation
Purpose: View full dream interpretation
Features:
- Dream description header
- Message thread with timestamps
- User messages (right-aligned, blue)
- AI responses (left-aligned, white)
- Formatted text with bold support
- Delete chat button
Purpose: Browse all dream symbols
Features:
- Searchable encyclopedia
- Autocomplete filtering
- Shows related terms as tags
- Tap to view details
- Sorted alphabetically
- Result counter
Purpose: View complete symbol interpretation
Features:
- Full Ibn Sirin interpretation
- "See Also" related symbols
- Clickable navigation to related symbols
Purpose: Model management and configuration
Features:
- Download available models
- Progress tracking with visual bar
- Initialize/activate models
- Shows active model badge
- Model info (name, size, status)
- Resumable downloads
- Error handling and status messages
| Model | Location | Purpose |
|---|---|---|
| Whisper (ggml-base.bin) | Bundled | Speech-to-text |
| Qwen2.5 / SmolLlama / LFM2.5 | Downloaded | Dream interpretation |
| Symbol Embeddings | Bundled | Search index |
| Ibn Sirin Dictionary | Bundled | Symbol database |
- Privacy: No data leaves device
- Speed: No network latency
- Offline: Works without internet
- Control: Choose which models to download
When you first open the app:
- Voice input works immediately (Whisper bundled)
- Symbol search works immediately (dictionary bundled)
- AI interpretation requires downloading a model (~44MB - 934MB)
- Tap "Manage Models" on dream screen to download
Problem: Whisper initialization fails
- Solutions:
- Grant microphone permission (check iOS Settings)
- Ensure
ggml-base.binwas bundled correctly - Check Metro config for
.binextension
Problem: Model download interrupted or stuck
- Solutions:
- Check internet connection
- Downloads are resumable - retry will continue
- Try smaller model (SmolLlama 44MB) first
- Check device has enough storage space
Problem: iOS build fails
- Solutions:
# Clean and rebuild cd ios rm -rf Pods Podfile.lock bundle exec pod install cd .. npm run ios
Problem: Metro bundler errors
- Solutions:
# Clear cache and restart npx react-native start --reset-cache
Problem: LLM generation causes crash
- Solutions:
- Try smaller model (44MB SmolLlama)
- Ensure sufficient device RAM
- Restart app before inference
- Dream interpretation with local LLM
- Symbol database integration
- Voice input (Whisper)
- Chat history persistence
- Offline functionality
- RAG-based symbol retrieval
- Streaming LLM responses (faster display)
- Symbol relationship visualization
- Dream journal analytics
- Advanced search filters
- Multiple language support (Urdu, Arabic)
- Fine-tuned dream interpretation models
- Cloud backup (optional)
- User authentication
- Performance optimization
- App Store submission
- Play Store submission
- Analytics and crash reporting
Source: Islamic dream interpretation classical text
Symbol Count: 2,157 unique symbols
Structure:
{
"tree": {
"name": "Tree",
"interpretation": "A tree in a dream represents a man...",
"related": ["Garden", "Fruit", "Shade"],
"see_also": ["Plant", "Forest"]
}
}Indexing: O(1) keyword lookup for fast symbol matching
[Add your license here]
[Add contribution guidelines here]
For issues or questions:
- Open an issue on GitHub
- Contact: [Your contact info]
- Ibn Sirin's Dictionary of Dreams (8th century Islamic scholar)
- Whisper.ai (OpenAI Speech-to-Text)
- Ollama & Llama models
- React Native community
Last Updated: January 28, 2026 Version: 0.0.1 (Development) Status: Fully Offline & Local - No Server Dependencies