Skip to content

knownbug06/persona_radar

Repository files navigation

PersonaRadar 🧠

Local-first personality analytics app.

PersonaRadar allows you to log timestamped self-reflections, use an LLM (OpenAI, Gemini, or Ollama) to convert raw text into structured personality metrics, and visualize your personality state and drift over time.

This application is local-first and privacy-focused. All data is stored in local JSON files on your machine.

Features

  • Raw Entry Logging: Log self-reflections with automatic ISO 8601 UTC timestamping.
  • AI Analysis: Analyze logs using OpenAI, Google Gemini, or Ollama (local).
  • 8 Personality Axes:
    • Emotional Regulation
    • Self Awareness
    • Discipline
    • Confidence
    • Social Perception
    • Boundaries
    • Adaptability
    • Purpose Alignment
  • Smart Scoring: The AI uses Optional Scoring, meaning it only scores axes clearly evidenced in the text (returning null otherwise) to prevent hallucinated "neutral" scores.
  • Human Override: Detailed review mode allowing you to adjust AI scores while preserving the original analysis context.
  • AI Coach: Ask the AI Coach for personalized advice based on your history. Insights are automatically saved for future reference.
  • Visualization:
    • Radar Charts: View your latest snapshot overlaying your all-time average (calculated only on valid scores).
    • Trend Lines: Track how your scores evolve over time.
    • Interactive History: Filterable history of all past analyses.
  • Security:
    • Firebase Authentication: Secure email/password login with domain whitelisting.
    • Data Isolation: Each user's data is strictly isolated in Firestore.
    • Secrets Management: API keys are securely managed via .streamlit/secrets.toml.

Tech Stack

  • Python 3.11+
  • Streamlit: UI Framework
  • Firebase: Authentication & Firestore Database
  • Plotly: Interactive Visualization
  • Pydantic: Strict Data Validation
  • OpenAI / Google GenAI / Ollama: LLM Integration

Setup

  1. Clone the repository:

    git clone <repository_url>
    cd persona_radar
  2. Create a virtual environment (recommended):

    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure Secrets: Create .streamlit/secrets.toml with your credentials:

    FIREBASE_WEB_API_KEY = "your-firebase-web-api-key"
    
    [FIREBASE_SERVICE_ACCOUNT]
    type = "service_account"
    project_id = "your-project-id"
    private_key_id = "..."
    private_key = "-----BEGIN PRIVATE KEY-----..."
    client_email = "..."
    client_id = "..."
    auth_uri = "https://accounts.google.com/o/oauth2/auth"
    token_uri = "https://oauth2.googleapis.com/token"
    auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs"
    client_x509_cert_url = "..."

    See FIREBASE_SETUP.md for detailed instructions on obtaining these.

  5. Configure Allowed Domains (Optional): Edit auth/auth_config.json to control which email domains can sign up.

Usage

Run the application:

streamlit run main.py

1. Authentication

Sign up or Log in. Your session will persist via cookies.

2. Configure AI Provider

In the sidebar, select your preferred AI Provider and configure settings (Model, API Key). These preferences are saved to your account.

3. Log Reflection

Go to the "Log Reflection" tab. Write about your day, feelings, or reactions to events.

4. Analyze

Go to "Analyze & Interpret".

  • Select a date range (Max 7 days).
  • Click "Run AI Analysis". Note: You cannot re-analyze if no new logs have been added since the last analysis.
  • Coach: Scroll down to ask the AI Coach for advice based on these trends.

5. View Trends

Go to "View Trends".

  • View your Persona Snapshot (Latest vs Average).
  • Explore Trend Lines.
  • Review History and Past Coach Insights.

6. Run with Docker (Optional)

You can containerize and run the application using Docker.

  1. Ensure secrets.toml exists in .streamlit/.
  2. Run with Docker Compose:
    docker-compose up --build
  3. Access the app at http://localhost:8501.

Project Structure

persona_radar/
├── main.py                # App entry point
├── auth/                  # Authentication logic & UI
├── core/                  # Models, Utils, Viz, Analysis Logic
├── db/                    # Firestore Repositories
├── ui/                    # Streamlit UI Components
├── Dockerfile             # Container definition
├── docker-compose.yml     # Container orchestration
├── .streamlit/            # Secrets & Config
└── requirements.txt       # Dependencies

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published