How v2rockets/loyal-elephie works
Frontend Layer (Blue Components)
• Next.js Web Application
• Chat Interface
• Authentication System
• API Routes
• Connection to users.json for authentication
Backend Layer (Green Components)
• Python Flask Server (app.py)
• Memory Management System
• ChromaDB Integration
• BM25 Search Engine
• Language Processing
• NLTK Integration
• Multiple Language Support
• LLM Integration
• Model Interface
• XML Processing
External Services (Purple Components)
• LLM API (OpenAI-compatible)
• Embedding Service
• Optional Markdown Editor (SilverBulletMd)
Storage Components (Yellow Components)
• ChromaDB Vector Store
• Markdown Files Storage
• Chat History
• User Settings
• [User Browser] → [Frontend Layer] → [Backend Layer] → [External Services/Storage]
Bi-directional Data Flows
• User interactions ↔ Frontend
• Frontend ↔ Backend API calls
• Backend ↔ External Services
• Backend ↔ Storage Systems
Special Features
• Hybrid Search System (BM25 + ChromaDB)
• Memory Control Flow
• Multi-language Support
• Authentication Flow
Key Relationships to Highlight:
Frontend-Backend Communication
• WebSocket connections for real-time updates
Memory Management Flow
• Chroma_doc_manager.py to ChromaDB
• BM25 ranking system integration
• Memory persistence flow
Language Processing Pipeline
• NLTK integration with multiple language support
• To language_presets.json
External Integrations
• LLM API connection
• Markdown editor integration
• Embedding service connection
Styling Guidelines:
Labels
• Component names
• API endpoints
• Data flow descriptions
• Technology stack annotations
High-Level View
• Main system components
• Primary data flows
• External service connections
Detailed Subviews
• Memory management system
• Authentication flow
• Language processing pipeline
• Search system architecture