Research Documentation
This section contains technical research and architecture decisions that inform MyStoryFlow’s AI-powered features.
Documents
Voice-to-Text Architecture
Research on modern voice-to-text applications, including analysis of Wispr Flow, Superwhisper, and MacWhisper. Covers hybrid cloud architectures, open-source speech recognition models, and on-device implementation strategies.
Key Topics:
- Hybrid cloud architecture patterns
- Cost analysis for transcription services
- Open-source STT models comparison
- Browser-based LLM (WebLLM)
- Memory and personalization solutions
Unified Context Architecture
Comprehensive architecture for combining multiple content sources (voice recordings, AI conversations, written stories) into a unified context system for intelligent AI assistance.
Key Topics:
- Unified context layer design
- Content embeddings with pgvector
- Hybrid search (BM25 + Vector)
- Context retrieval patterns
- Database schema additions
Status: APPROVED - Ready for Implementation
Contextual Memory & RAG
Deep dive into contextual memory and Retrieval-Augmented Generation (RAG) implementation using pgvector and OpenAI embeddings.
Key Topics:
- pgvector vs dedicated vector databases
- Embedding model selection
- Memory architecture (STM/LTM)
- Hybrid search implementation
- Cost analysis and scaling
Status: APPROVED - Database Foundation Complete
Architecture Decision Records (ADRs)
ADR-001: Vector Search Infrastructure
Status: APPROVED (November 2024)
Decision: Use pgvector (PostgreSQL extension) with OpenAI text-embedding-3-small.
Rationale:
- Zero additional infrastructure cost (included in Supabase)
- Data stays in PostgreSQL (no sync issues)
- Sufficient performance for less than 1M vectors
- Simpler architecture (one less service)
- Easy migration path to dedicated DB if needed later
Implementation Status
| Component | Status | Notes |
|---|---|---|
| pgvector Extension | Complete | Enabled in Supabase |
| Embedding Columns | Complete | Added to stories, recordings |
| user_memory Table | Complete | With RLS policies |
| HNSW Indexes | Complete | For fast similarity search |
| search_unified_context() | Complete | SQL function created |
| EmbeddingService (TypeScript) | Pending | Next implementation step |
| EnhancedContextManager | Pending | Depends on EmbeddingService |
| Memory Extraction Pipeline | Pending | LLM-based extraction |