๐Ÿง  Selph Dynamic Memory System

Real-time, LLM-agnostic personal knowledge orchestration
For: Rodrique Fru - Technical Deep Dive

๐ŸŽฏ Executive Summary

Selph is a dynamic memory system that solves the fundamental UX problem with AI memory: manual file management. Instead of constantly uploading/deleting static JSON files, we use JSON-LD pointers that reference live Firebase endpoints. AI agents always get current data, users never manage files, and memory evolves in real-time.

๐Ÿš€ Key Innovation: Separation of memory pointers (static, uploaded once) from memory data (dynamic, always current). Think DNS for AI memory.

โŒ The Problem We're Solving

Current State: Static Memory Hell

  • Manual JSON editing - Every memory update requires file editing
  • Upload/delete cycles - Constant file management in Claude/ChatGPT
  • Stale data - Memory becomes outdated immediately
  • No cross-agent sync - Claude and ChatGPT have different memory states
  • Broken workflows - File management interrupts natural conversation

Selph Solution: Living Memory

  • JSON-LD pointers - Static files that point to live endpoints
  • Zero file management - Upload pointer once, never again
  • Real-time updates - Memory evolves automatically
  • Universal sync - All AI agents see same live data
  • Semantic web ready - Standards-compliant architecture

๐Ÿ—๏ธ System Architecture

Three-Layer Architecture

๐Ÿงฑ JSON-LD Shell

Static pointer uploaded once to Claude/ChatGPT

Contains @id pointing to live endpoint

๐Ÿ›ก๏ธ Memory API

Express.js middleware with schema validation

Handles auth, rate limiting, updates

๐Ÿ”ฅ Firebase Store

Real-time database with live sync

Instant updates across all agents

Data Flow Example

1. CJ chats with Claude: "Rodrique prefers evening calls now"

2. Claude sends update:
   POST /api/memory/update
   {
     "userId": "cj-mitchell",
     "updates": {
       "type": "relationship_update", 
       "data": {
         "targetEntity": "rodrique-fru",
         "preference": "call_time",
         "value": "evening"
       }
     },
     "source": "claude",
     "confidence": 0.8
   }

3. Firebase updates instantly

4. Next time any AI agent reads CJ's memory:
   GET https://api.selph.ai/memory/cj-mitchell
   โ†’ Gets live data with evening call preference

๐Ÿ”ง Technical Implementation

JSON-LD Memory Pointer (Static - Upload Once)

{
  "@context": "https://schema.org/",
  "@type": "Person",
  "@id": "https://selph.ai/cj-mitchell",
  "name": "CJ Mitchell",
  "sameAs": "https://api.selph.ai/memory/cj-mitchell",
  "description": "Live memory endpoint - always current",
  "dateCreated": "2025-06-30T10:00:00Z"
}

Live Memory Data (Dynamic - Auto-Updates)

{
  "userId": "cj-mitchell",
  "relationships": {
    "rodrique-fru": {
      "type": "friend_cofounder",
      "intensity": 0.9,
      "context": "Tech collaborator, strategic thinking partner",
      "preferences": {
        "call_time": "evening",
        "communication_style": "technical_deep_dives"
      },
      "lastInteraction": "2025-06-30T15:30:00Z",
      "confidence": 0.9
    }
  },
  "preferences": {
    "work_style": "frameworks_over_tactics",
    "communication": "direct_efficient",
    "decision_making": "data_driven_with_intuition"
  },
  "memories": [
    {
      "id": "mem_20250630_001",
      "type": "conversation",
      "content": "Discussed Selph dynamic memory architecture",
      "participants": ["rodrique-fru"],
      "timestamp": "2025-06-30T15:30:00Z",
      "importance": 0.8,
      "tags": ["selph", "architecture", "collaboration"]
    }
  ],
  "metadata": {
    "version": 47,
    "lastUpdated": "2025-06-30T15:30:00Z",
    "lastUpdateSource": "claude",
    "schemaVersion": "2.1"
  }
}

๐Ÿš€ Tech Stack Comparison

Component Current (Static) Selph (Dynamic) Benefit
Memory Storage Static JSON files Firebase Firestore Real-time sync, querying, offline support
Updates Manual file editing API-driven with validation Automated, schema-validated, auditable
AI Integration Upload/delete cycle JSON-LD pointer fetch Zero file management, always current
Cross-Agent Sync Manual coordination Automatic real-time Consistent memory across all AIs
Version Control None Full audit trail Track all changes, rollback capability
Access Control File-level only Field-level permissions Granular privacy controls

โšก Key Innovations

๐Ÿ”— JSON-LD Architecture

Semantic web standards enable rich knowledge graphs. AI agents understand relationships, not just data blobs. Future-proof and interoperable.

๐Ÿ›ก๏ธ LLM-Agnostic Middleware

Works with Claude, ChatGPT, Gemini, local models. Schema validation prevents corruption. Rate limiting and auth built-in.

๐Ÿ”„ Real-time Synchronization

Firebase WebSockets push updates instantly. All connected AI agents see changes immediately. Offline support included.

๐Ÿ“Š Schema Evolution

Memory schemas can evolve (v1 โ†’ v2 โ†’ v3) without breaking. Backward compatibility maintained. Custom extensions supported.

๐Ÿง  Intelligent Updates

AI analyzes conversations and extracts memory updates automatically. Confidence scoring. Conflict resolution for contradictory data.

๐Ÿ” Privacy by Design

Granular access controls. Field-level permissions. Data stays in your Firebase. Full audit trail of all changes.

๐Ÿ› ๏ธ Implementation Roadmap

Firebase Setup & Schema Design

Configure Firestore with Selph schema v2.1. Set up security rules for user data isolation. Create indexes for efficient querying.

Memory API Development

Build Express.js middleware with schema validation, rate limiting, and authentication. Implement memory update endpoints and real-time sync.

AI Agent Integration

Create browser extension for chat monitoring. Implement automatic memory extraction from conversations. Build confidence scoring system.

JSON-LD Pointer Generation

Build tooling to convert existing Selph memories to JSON-LD format. Create migration scripts for current static files.

Real-time Sync & Monitoring

Implement WebSocket connections for live updates. Add monitoring dashboard for memory state. Create backup and recovery systems.

๐Ÿ’ก Prototype vs Production Strategy

๐Ÿงช Prototype (<20 people)

Tech: Simple Express server + local JSON files

Timeline: 2-3 weeks

Cost: $0 - runs on laptop

Purpose: Validate concept, test user behavior

๐Ÿข Production (Unlimited)

Tech: Firebase + Express API + Redis cache

Timeline: 6-8 weeks

Cost: $50-200/month

Purpose: Scalable, reliable, feature-complete

๐Ÿ’ก Recommendation: Start with prototype to validate the JSON-LD approach and user workflows, then migrate to Firebase when scaling beyond 20 users. The memory format stays identical - only the storage layer changes.

๐Ÿ“Š Success Metrics

User Experience Metrics

Technical Metrics

๐ŸŽฎ Interactive Demo

Simulate the Selph memory system to understand the flow:

Click buttons above to see Selph dynamic memory system in action...

๐ŸŽฏ Next Steps for Rodrique

๐Ÿš€ Immediate Actions:
  1. Review architecture - Validate technical approach and identify potential issues
  2. Firebase setup - Configure Firestore project with Selph schema
  3. API design - Define endpoints and middleware architecture
  4. Prototype timeline - Scope 2-3 week MVP with core functionality
๐Ÿค” Key Questions to Resolve:
  • Firebase security rules for multi-user data isolation?
  • Rate limiting strategy for AI agent requests?
  • Schema versioning approach for backward compatibility?
  • Conflict resolution algorithms for contradictory updates?
  • Browser extension architecture for chat monitoring?

๐ŸŽฏ The Vision

Transform personal AI memory from static file management to a living, breathing knowledge graph that evolves in real-time, syncs across all AI agents, and never requires manual intervention.

From memory snapshots to memory streams.