title: Protocol Buffers with Concept Vocabulary Encoding

content: The session genotype will be encoded using Protocol Buffers (Protobuf) for storage and transmission, instead of JSON or text. To maximize compression, a 'Concept Vocabulary' will map common strings (like 'mission', 'blocker', agent IDs) to integer IDs. This allows storing concepts with ~10 bits (from a 1024-concept vocab) rather than bytes, targeting a genotype size of <2KB from a ~200KB context window.


title: JSON Patch Inheritance Model

content: Sessions will inherit state using JSON Patch (RFC 6902). Instead of storing the full genome for every session, we store only the 'mutations' (deltas) relative to the parent session. This delta-chaining mimics biological inheritance and keeps storage requirements extremely low (~500 bytes per session).


title: Session Genotype 8-Gene Structure

content: The minimal genome consists of 8 specific 'genes': META (lineage, timestamps), MISSION (objectives), AGENTS (active agents), BLOCKERS (issues), DECISIONS (immutable log of choices), ENTITIES (core nouns), RELATIONSHIPS (graph connections), and STYLE (personality/preferences). This structure ensures the 'DNA' contains the complete identity of the session.


title: Protein Folding Algorithm (Phenotype Expression)

content: To reconstruct the context window (Phenotype) from the Genotype: 1. Reconstruct full genotype by applying deltas from the chain. 2. Transcription: Filter alleles based on current context/mission using epigenetic tags. 3. Translation: Expand compact IDs back to natural language. 4. Folding: Assemble fragments into a coherent narrative sorted by relevance.


title: Genetic Recombination Workflow

content: To merge two projects (e.g., Widget and Memory): 1. User triggers merge. 2. Select specific chromosomes to inherit (e.g., Product Knowledge from A, Infrastructure from B). 3. Create a Hybrid Genotype combining selected chromosomes. 4. AI synthesizes new 'genes' (relationships) bridging the projects (e.g., Widget stores transcripts in Memory).


title: Telomere Aging & Repair Cycle

content: To prevent state degradation: 1. Track 'telomere_integrity' score in META gene (starts at 100). 2. Decay score by 1 per session or 5-10 on manual corrections. 3. When score < 70, trigger 'Consolidation & Rebirth': reconstruct fresh base genome from event log and reset score to 100. 4. If score < 30, force full user review (Apoptosis).


title: State Compression Efficiency Targets

content: The system targets a >100x compression ratio. The full session context (Phenotype) is ~200KB. The compressed Genotype (with Protobuf + Vocab) targets <2KB. Inheritance deltas are ~500 bytes. This ensures fast loading (<3s) and minimal storage costs.


title: Epigenetic Context Tagging

content: Unlike simple summarization, every piece of data (allele) has an 'epigenome' tag (e.g., mission:ship_widget, persona:sales). The folding algorithm dynamically expresses only the relevant DNA based on the current mission. This allows the same session to behave as a 'Sales Partner' or 'Engineer' depending on context, providing superior adaptability.


title: Error Correction & Repair Mechanism

content: Multi-layered integrity system: 1. Redundancy: Write genotype to 3 of 5 systems (PostgreSQL, Redis, FS, S3, KG). 2. Checksums: SHA-256 hash for every stored genotype. 3. Repair: If corruption is detected, discard corrupted DNA and reconstruct from the immutable event log (the 'template strand').


title: Decision Gene Specification

content: The 'DECISIONS' gene acts as an immutable ledger. Example: D23 records 'Set pricing tiers' with values [297, 497, 997] and status 'locked'. These are used to maintain consistency across respawns.


title: Dynamic Persona Switching via Epigenetics

content: The 'STYLE' gene combined with epigenetic tags allows the AI to dynamically switch communication styles (verbosity, formality) and focus areas based on the active mission, simulating a deeper understanding of user intent without changing the core model.


title: Genotype to Context Window Integration

content: The system connects the compact Genotype (stored in Elestio/PostgreSQL) to the LLM's Context Window (Phenotype) via the 'Protein Folding' algorithm. It acts as the translation layer, converting the binary/small JSON DNA into a full natural language summary required by the AI model.