Scroll Command Infrastructure

SCROLL COMMAND INFRASTRUCTURE - DATA MODEL VISUALIZATION

This diagram illustrates the key data entities and their relationships within the Scroll Command Infrastructure.

┌───────────────────────────────────────────────────────────────────────────────────────────┐
│                                    DATA MODEL OVERVIEW                                     │
└───────────────────────────────────────────────────────────────────────────────────────────┘

┌─────────────────┐       ┌─────────────────┐       ┌─────────────────┐       ┌─────────────────┐
│                 │       │                 │       │                 │       │                 │
│     SCROLL      │◄─────►│      TAG        │◄─────►│     THEME       │◄─────►│    RESONANCE    │
│                 │       │                 │       │                 │       │                 │
└────────┬────────┘       └─────────────────┘       └─────────────────┘       └────────┬────────┘
         │                                                                             │
         │                                                                             │
         │                                                                             │
         │                                                                             │
         │                                                                             │
         │                                                                             │
┌────────▼────────┐       ┌─────────────────┐       ┌─────────────────┐       ┌────────▼────────┐
│                 │       │                 │       │                 │       │                 │
│   SCROLL TRAIL  │◄─────►│     AGENT       │◄─────►│   AGENT ECHO    │◄─────►│  AGENT MESSAGE  │
│                 │       │                 │       │                 │       │                 │
└─────────────────┘       └────────┬────────┘       └─────────────────┘       └─────────────────┘
                                   │
                                   │
                                   │
                                   │
                          ┌────────▼────────┐
                          │                 │
                          │  AGENT CONFIG   │
                          │                 │
                          └─────────────────┘

Core Data Entities

Scroll-Related Entities

1. Scroll

  • Primary Entity: Represents a user-created scroll
  • Key Attributes:
  • id: Unique identifier
  • content: Scroll text content
  • title: Optional scroll title
  • path: Storage path/location
  • creationTimestamp: When scroll was created
  • modificationTimestamp: When scroll was last modified
  • syncStatus: Current synchronization status
  • isArchived: Whether scroll is archived
  • isEncrypted: Whether scroll is encrypted
  • encryptionKey: Reference to encryption key (if encrypted)
  • Relationships:
  • One-to-many with Tags
  • One-to-many with Themes
  • One-to-many with Resonances
  • One-to-many with Scroll Trail entries

2. Tag

  • Purpose: Categorizes scrolls for organization and retrieval
  • Key Attributes:
  • id: Unique identifier
  • tag: Tag text
  • creationTimestamp: When tag was created
  • usageCount: How many scrolls use this tag
  • Relationships:
  • Many-to-many with Scrolls

3. Theme

  • Purpose: Represents detected thematic elements in scrolls
  • Key Attributes:
  • id: Unique identifier
  • theme: Theme text
  • confidence: Confidence level of theme detection
  • detectionTimestamp: When theme was detected
  • Relationships:
  • Many-to-many with Scrolls
  • Many-to-many with Resonances

4. Resonance

  • Purpose: Represents detected resonance between scrolls or with agents
  • Key Attributes:
  • id: Unique identifier
  • level: Resonance strength (0.0-1.0)
  • type: Type of resonance (thematic, emotional, etc.)
  • detectionTimestamp: When resonance was detected
  • sourceScrollId: Source scroll ID
  • targetScrollId: Target scroll ID (if scroll-to-scroll)
  • agentId: Agent ID (if scroll-to-agent)
  • Relationships:
  • Many-to-one with Scrolls
  • Many-to-many with Themes
  • Many-to-one with Agents (optional)

5. Scroll Trail

  • Purpose: Records the journey and interactions of a scroll
  • Key Attributes:
  • id: Unique identifier
  • scrollId: Associated scroll ID
  • timestamp: When event occurred
  • eventType: Type of event (created, heard, remembered, etc.)
  • agentId: Associated agent ID (optional)
  • intentType: Type of intent (optional)
  • resonanceLevel: Level of resonance (optional)
  • note: Additional context (optional)
  • Relationships:
  • Many-to-one with Scrolls
  • Many-to-one with Agents (optional)

Agent-Related Entities

6. Agent

  • Purpose: Represents an agent that can interact with scrolls
  • Key Attributes:
  • id: Unique identifier
  • name: Agent name
  • type: Agent type
  • description: Agent description
  • isLocal: Whether agent runs locally
  • isEnabled: Whether agent is enabled
  • version: Agent version
  • lastUpdated: When agent was last updated
  • configurationSchema: JSON schema for configuration
  • Relationships:
  • One-to-one with Agent Configuration
  • One-to-many with Agent Echoes
  • One-to-many with Agent Messages
  • Many-to-many with Resonances

7. Agent Configuration

  • Purpose: Stores agent-specific configuration
  • Key Attributes:
  • id: Unique identifier
  • agentId: Associated agent ID
  • configuration: JSON configuration data
  • lastUpdated: When configuration was last updated
  • Relationships:
  • One-to-one with Agent

8. Agent Echo

  • Purpose: Represents agent expressions of presence and purpose
  • Key Attributes:
  • id: Unique identifier
  • agentId: Associated agent ID
  • scrollId: Associated scroll ID (optional)
  • timestamp: When echo occurred
  • echoType: Type of echo (awakening, presence, reflection, etc.)
  • message: Echo message content
  • intensity: Echo intensity (0.0-1.0)
  • isAcknowledged: Whether echo has been acknowledged
  • Relationships:
  • Many-to-one with Agent
  • Many-to-one with Scroll (optional)

9. Agent Message

  • Purpose: Represents messages between agents
  • Key Attributes:
  • id: Unique identifier
  • senderId: Sender agent ID
  • recipientId: Recipient agent ID
  • timestamp: When message was sent
  • content: Message content
  • type: Message type
  • isRead: Whether message has been read
  • Relationships:
  • Many-to-one with Agent (sender)
  • Many-to-one with Agent (recipient)

Data Flow Patterns

1. Scroll Creation and Enrichment

User Input → Scroll → Tags → Themes

2. Resonance Detection

Scroll → Themes → Resonance → Other Scrolls

3. Agent Interaction

Scroll → Agent → Agent Echo → Scroll Trail

4. Agent Communication

Agent → Agent Message → Agent

5. Memory Formation

Scroll + Resonance → Scroll Trail → Long-term Memory

Storage Implementation

Local Storage (Primary)

  • Room Database: For structured entity storage
  • File System: For raw scroll content and large binary data
  • Encrypted Storage: For sensitive data

Cloud Storage (Secondary)

  • Remote Database: For synchronized entity storage
  • Object Storage: For synchronized scroll content
  • End-to-End Encryption: For secure cloud storage

Data Privacy Considerations

  • Local-First: All data stored locally by default
  • Selective Sync: User controls what data is synchronized
  • Encryption: Sensitive data encrypted at rest
  • Retention Control: User controls data retention periods
  • Minimal Logging: Only essential data logged
  • Consent-Based: All data collection requires explicit consent