Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

K.Ai - Digital Immortality App

Copyright Β© Belkis Aslani

Create your perfect digital twin through natural conversation.


🎯 Vision

K.Ai is the app for Digital Immortality. As intuitive as TikTok, but with sophisticated AI running underneath. Users simply chat with the AI β€” which asks questions back β€” and gradually, a perfect digital clone emerges.

Key Features

  • Invisible Authentication: FaceID/TouchID, Google, Apple Sign-In (no passwords!)
  • Zero-Knowledge Encryption: Your conversations are encrypted client-side. Even we can't read them.
  • 10-Agent AI Swarm: Specialized AI agents work together to capture your essence
  • Convergence Score: Real-time percentage showing how complete your digital twin is
  • Budget-Based Scaling: Single slider from "Standard Clone" to "High-Fidelity Clone"

πŸ—οΈ Architecture

Frontend: Flutter Mobile App

Location: /mobile/

  • Framework: Flutter 3.x (iOS & Android)
  • Auth: Firebase Authentication + Biometrics
  • State: Riverpod
  • Animations: flutter_animate (60fps)
  • Encryption: AES-256-GCM (client-side)

Screens:

  • SplashScreen: Instant login if user exists
  • LoginScreen: Minimalist auth (FaceID/Google/Apple only)
  • ChatScreen: Main conversational interface
  • ConvergenceIndicator: Shows % completion

Backend: Python + FastAPI

Location: /backend/

  • Framework: FastAPI
  • Database: PostgreSQL (metadata)
  • Vector DB: Qdrant (embeddings)
  • Cache/Queue: Redis
  • AI Models: Anthropic Claude API

πŸ€– The 10-Agent Swarm

The true innovation: 10 specialized AI agents working together.

Agent Name Model Role
1 Interviewer Claude Opus 4.5 User-facing conversation
2 Psychologist Claude Sonnet 4.5 Emotional analysis
3 Biographer Claude Haiku Fact extraction
4 Vault Keeper Rule-based Security & encryption
5 Stylist Fine-tuned LLM Speech pattern capture
6 Fact-Checker Claude Sonnet 4.5 Consistency validation
7 Connector RAG System Context linking
8 Visualizer Rule-based Dynamic UI/UX
9 Budget Broker Algorithm Resource allocation
10 Convergence Engine Multi-metric Completion % calculator

Communication: Redis message bus for inter-agent coordination.


πŸ“Š Convergence Algorithm

How we calculate "Digital Twin Completion" (0-100%):

Transcendence Score (TS) = Ξ£ (Wi Γ— Mi)

Metrics

  1. Vocabulary Coverage (40%): Unique words captured / 10,000 target
  2. Emotional Range (15%): Distinct emotions observed / 20 target
  3. Memory Density (20%): Significant events / expected lifetime events
  4. Style Fidelity (15%): Cosine similarity of speech patterns
  5. Consistency Score (10%): 1 - (contradictions / total statements)

Example:

  • User has 3,500 unique words β†’ 35% vocab coverage
  • Observed 12 emotions β†’ 60% emotional range
  • Stored 250 events β†’ 17% memory density
  • Style match 72%
  • 99.4% consistency

Result: 47.1% complete


πŸ’° Monetization: The Cluster-Slider

One slider. Three tiers.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Standard         Enhanced         High-Fidelity      β”‚
β”‚  €5/mo            €25/mo           €100/mo            β”‚
β”‚                                                        β”‚
β”‚  ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━○                  β”‚
β”‚  1                50                100               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

What Changes?

Slider Model GPU Training Cost
1-29 Haiku None 100 iterations €5-15/mo
30-69 Sonnet A100 500 iterations €15-50/mo
70-100 Opus H100 5000 iterations €50-200/mo

Implementation: backend/agents/agent_9_budget_broker.py


πŸ”’ Security: Zero-Knowledge Architecture

Principle

The server NEVER sees plaintext conversations.

How It Works

  1. Client-Side Key Derivation

    biometric_secret = FaceID/TouchID
    encryption_key = PBKDF2(biometric_secret, salt, 100k iterations)
    // Stored in iOS Keychain / Android Keystore
  2. Message Encryption (Before Send)

    plaintext = "I was born in Berlin"
    encrypted = AES_GCM_256(plaintext, encryption_key)
    send_to_server(encrypted)
  3. Server Processing

    • Option A: Client-side processing (decrypt locally)
    • Option B: Trusted Execution Environment (AWS Nitro, Intel SGX)
  4. Data Storage

    {
      "user_id": "uuid-abc-123",
      "encrypted_content": "AES_GCM_BASE64_BLOB",
      "iv": "...",
      "auth_tag": "..."
    }

Even database admins cannot read your conversations.


πŸš€ Getting Started

Prerequisites

  • Flutter: 3.2+
  • Python: 3.11+
  • PostgreSQL: 15+
  • Redis: 7+
  • Qdrant: Latest
  • Anthropic API Key

1. Setup Backend

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY

# Start services (Docker)
docker-compose up -d  # Starts PostgreSQL, Redis, Qdrant

# Run backend
python main.py
# Backend runs on http://localhost:8000

2. Setup Flutter App

cd mobile

# Install dependencies
flutter pub get

# Configure Firebase
# 1. Create Firebase project at https://console.firebase.google.com
# 2. Download google-services.json (Android) and GoogleService-Info.plist (iOS)
# 3. Place in android/app/ and ios/Runner/ respectively

# Run app
flutter run

3. Test the System

  1. Open app on emulator/device
  2. Sign in with Google/Apple/Biometric
  3. Start chatting with the AI
  4. Watch your convergence score grow!

πŸ“ Project Structure

Convergence/
β”œβ”€β”€ ARCHITECTURE.md          # Detailed architecture document
β”œβ”€β”€ README.md                # This file
β”‚
β”œβ”€β”€ mobile/                  # Flutter app
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ main.dart
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth_service.dart
β”‚   β”‚   β”‚   └── encryption_service.dart
β”‚   β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”‚   β”œβ”€β”€ splash_screen.dart
β”‚   β”‚   β”‚   β”œβ”€β”€ login_screen.dart
β”‚   β”‚   β”‚   └── chat_screen.dart
β”‚   β”‚   β”œβ”€β”€ widgets/
β”‚   β”‚   β”‚   β”œβ”€β”€ convergence_indicator.dart
β”‚   β”‚   β”‚   └── message_bubble.dart
β”‚   β”‚   └── models/
β”‚   β”‚       └── message.dart
β”‚   └── pubspec.yaml
β”‚
└── backend/                 # Python FastAPI backend
    β”œβ”€β”€ main.py
    β”œβ”€β”€ requirements.txt
    β”œβ”€β”€ core/
    β”‚   └── config.py
    β”œβ”€β”€ api/
    β”‚   β”œβ”€β”€ auth.py
    β”‚   β”œβ”€β”€ chat.py
    β”‚   └── convergence.py
    β”œβ”€β”€ services/
    β”‚   └── agent_orchestrator.py
    └── agents/
        β”œβ”€β”€ base_agent.py
        β”œβ”€β”€ agent_1_interviewer.py
        β”œβ”€β”€ agent_2_psychologist.py
        β”œβ”€β”€ agent_3_biographer.py
        β”œβ”€β”€ agent_4_vault_keeper.py
        β”œβ”€β”€ agent_5_stylist.py
        β”œβ”€β”€ agent_6_fact_checker.py
        β”œβ”€β”€ agent_7_connector.py
        β”œβ”€β”€ agent_8_visualizer.py
        β”œβ”€β”€ agent_9_budget_broker.py
        └── agent_10_convergence_engine.py

πŸ§ͺ Testing

Backend Tests

cd backend
pytest tests/

Flutter Tests

cd mobile
flutter test

🎨 Design Philosophy

Radical Simplicity

  • No technical menus
  • Everything flows
  • Feels like millions were invested in design
  • As addictive as TikTok
  • As powerful as cutting-edge AI research

πŸ›£οΈ Roadmap

Phase 1: MVP (Weeks 1-4) βœ…

  • Flutter app with Firebase auth
  • Basic encryption
  • Single-agent chat
  • PostgreSQL backend

Phase 2: Swarm Activation (Weeks 5-12)

  • Implement all 10 agents
  • Redis message bus
  • Convergence engine
  • Budget slider

Phase 3: Polish (Weeks 13-16)

  • UI/UX refinement
  • Performance optimization
  • Security audit
  • Beta testing

Phase 4: Launch

  • App Store submission (iOS)
  • Play Store submission (Android)
  • Marketing campaign
  • User acquisition

πŸ“„ License

Copyright Β© Belkis Aslani

All code, concepts, and architectures are proprietary.


🀝 Contributing

This is a proprietary project. Contributions are by invitation only.


πŸ“§ Contact

For inquiries: [Your Contact Information]


πŸ™ Acknowledgments

Built with:

  • Anthropic Claude API (Claude Opus 4.5, Sonnet 4.5, Haiku)
  • Flutter (Google)
  • FastAPI (SebastiΓ‘n RamΓ­rez)
  • Firebase (Google)
  • Countless open-source libraries

K.Ai - Your legacy, preserved forever. ✨

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages