• Store: ~15ms average
  • Context build: ~25ms
  • Batch ops: 1000+/sec
  • πŸ“Š Capacity

    Request Flow

    How a typical API request flows through the system:

    Client Request
          β”‚
          β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Nginx     β”‚ ← SSL termination, rate limiting
    β”‚   Gateway   β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚    Auth     β”‚ ← API key validation, JWT decode
    β”‚   Service   β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  ProBridgeZ β”‚ ← Route to appropriate service
    β”‚   Router    β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β–Ό                 β–Ό                 β–Ό                 β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚    Query    β”‚   β”‚   Memory    β”‚   β”‚  Codebase   β”‚   β”‚   Agent     β”‚
    β”‚   Handler   β”‚   β”‚   Handler   β”‚   β”‚   Handler   β”‚   β”‚   Handler   β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚                 β”‚                 β”‚                 β”‚
           β”‚                 β–Ό                 β”‚                 β”‚
           β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚                 β”‚
           β”‚          β”‚Memory Spine β”‚          β”‚                 β”‚
           β”‚          β”‚  Context    β”‚          β”‚                 β”‚
           β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚                 β”‚
           β”‚                 β”‚                 β”‚                 β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚   LLM Provider  β”‚
                              β”‚ OpenAI/Anthropicβ”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚ Response + Cacheβ”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    Repository Services (13)

    Specialized services for extended functionality.

    ServicePortPurpose
    AUIE8850UI generation, 100 capabilities
    Agent-Economy8851Multi-agent framework, 5 agent types
    AgentZ8852Agent mesh, discovery, clustering
    ThirdEye8858World events monitoring
    ZDownload8860Download manager
    ASCII Art8862ASCII art generation

    Data Flow & Storage

    Memory Spine Data Flow

    User Input β†’ Embedding β†’ Vector Store β†’ Index Update
                                                  ↓
                                             Knowledge Graph Update
                                                  ↓
                                             Deduplication Check
                                                  ↓
                                             Persistence (SQLite)

    Storage Systems

    🧠 Vector Database

    Memory Spine's vector storage for semantic search. Uses sentence-transformers for embeddings.

    • Capacity: 50,000 vectors
    • Model: all-MiniLM-L6-v2
    • Similarity: Cosine

    πŸ“„ SQLite

    Metadata storage for memories, sessions, and configuration.

    • Location: /var/lib/memory-spine/
    • Backup: Daily automated
    • WAL mode enabled

    ⚑ Redis (Optional)

    High-speed cache for sessions and frequently accessed data.

    • Session cache: 24h TTL
    • Rate limit counters
    • Pub/sub for events

    Security Architecture

    πŸ” Authentication

    • API key authentication (Bearer tokens)
    • JWT for session management
    • OAuth2 integration (GitHub)
    • Key rotation support

    πŸ›‘οΈ Network Security

    • TLS 1.3 everywhere
    • UFW firewall rules
    • Fail2ban protection
    • DDoS mitigation

    πŸ“ Data Security

    • Encryption at rest
    • API key hashing (SHA256)
    • Memory isolation per user
    • GDPR compliance tools

    πŸ” Monitoring

    • Real-time health dashboard
    • Automated security scans
    • Audit logging
    • Anomaly detection

    Scaling Strategy

    Current Infrastructure

    Running on VPS3 (primary) with optional VPS1/VPS2 workers:

    Horizontal Scaling

                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚Load Balancerβ”‚
                        β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό                β–Ό                β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚   VPS3      β”‚  β”‚   Worker 1  β”‚  β”‚   Worker 2  β”‚
       β”‚   Primary   β”‚  β”‚   (VPS1)    β”‚  β”‚   (VPS2)    β”‚
       β”‚   32GB RAM  β”‚  β”‚   2GB RAM   β”‚  β”‚   8GB RAM   β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚         Shared Memory Spine             β”‚
       β”‚         (Central State)                 β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    Chaoz Orchestration

    Chaoz (tmux-hero) manages agent scaling and distribution:

    # Auto-scale based on load
    chaoz adaptive start
    
    # Manual scaling
    chaoz swarm 5           # Spawn 5 agents
    chaoz scaler up 3       # Add 3 workers
    chaoz cluster           # View cluster status