| --- |
| title: Velra Intelligent Dating |
| emoji: π |
| colorFrom: pink |
| colorTo: purple |
| sdk: docker |
| app_port: 7860 |
| --- |
| |
| # π Velra β AI Relationship Co-Pilot |
|
|
| Velra is an elite AI-powered psychological profiler for modern dating. It analyzes text conversations and chat screenshots, predicts emotional compatibility, detects contradictions, and provides actionable relationship advice without using generic therapy terminology. |
|
|
| --- |
|
|
| ## π Features |
|
|
| - π¬ **Chat + Screenshot Analysis:** Upload raw text or screenshots (powered by OCR) |
| - π§ **Elite Emotional Intelligence:** Extracts true intent, power dynamics, and emotional asymmetry. |
| - β οΈ **Risk & Contradiction Detection:** Calls out discrepancies between what people say and what they do. |
| - π― **Perspective-Aware Strategy:** Adjusts advice based on exactly what *you* want (casual, commitment, detachment). |
| - π **Actionable Replies:** Generates exactly calibrated text messages to send. |
| - π€ **Multi-Agent System:** Powered by specialized AI agents for Analysis, Psychology, and Strategy. |
|
|
| --- |
|
|
| ## π Project Structure |
|
|
| ```text |
| velra/ |
| β |
| βββ frontend/ |
| β βββ app.py # Main Streamlit UI entry point |
| β βββ shared.py # Shared UI components and logic |
| β βββ pages/ |
| β βββ results.py # Result visualization page |
| β |
| βββ backend/ |
| β βββ app.py # FastAPI server handling agent orchestration |
| β βββ core/ # App configuration and logging |
| β βββ llm/ # LLM factory and provider setup |
| β βββ services/ # External services (OCR engine) |
| β βββ utils.py # JSON parsing and utilities |
| β βββ agents/ # Core AI Multi-Agent Architecture |
| β βββ perspective.py # Fast perspective and role identification |
| β βββ analyst.py # Behavioral analysis and screenshot grounding |
| β βββ psychology.py # Attachment, intent alignment, and dynamics |
| β βββ strategy.py # High-value, objective-based action plans |
| β |
| βββ requirements.txt # Python dependencies |
| βββ .env # Environment variables (Keys & Providers) |
| βββ README.md # Project documentation |
| ``` |
|
|
| --- |
|
|
| ## π§ Architecture Flow |
|
|
| `Frontend (Streamlit) β Backend (FastAPI) β OCR Engine (Tesseract) β Agents (Perspective β Analyst + Psychology β Strategy) β LLM Inference (AMD/OpenAI)` |
|
|
| --- |
|
|
| ## βοΈ Setup & Local Development |
|
|
| ### 1. Create Environment |
|
|
| ```bash |
| python -m venv velra_env |
| # Windows: |
| velra_env\Scripts\activate |
| # Mac/Linux: |
| source velra_env/bin/activate |
| ``` |
|
|
| ### 2. Install Dependencies |
|
|
| ```bash |
| pip install -r requirements.txt |
| ``` |
|
|
| ### 3. Setup Environment Variables |
|
|
| Create a `.env` file in the root directory: |
|
|
| ```env |
| LLM_PROVIDER=openai |
| MODEL_NAME=gpt-4o-mini |
| OPENAI_API_KEY=your_api_key_here |
| ``` |
|
|
| ### 4. Run the Backend (FastAPI) |
|
|
| ```bash |
| uvicorn backend.app:app --reload |
| ``` |
|
|
| ### 5. Run the Frontend (Streamlit) |
|
|
| Open a new terminal window, activate the environment, and run: |
|
|
| ```bash |
| streamlit run frontend/app.py |
| ``` |
|
|
| --- |
|
|
| *Note: If deploying to Hugging Face Spaces, the platform will automatically read the `app_file` parameter in the header and launch the Streamlit frontend. The backend FastAPI logic is currently separated; for a pure single-container HF Space, ensure both services run or migrate the backend logic into the Streamlit lifecycle if needed.* |