UNPKG

aios-core

Version:

Synkra AIOS: AI-Orchestrated System for Full Stack Development - Core Framework

1,340 lines (1,107 loc) β€’ 39.2 kB
# πŸ“˜ AIOS v2.2 - Livro de Ouro (Future Vision) **Version:** 2.2.0-with-memory-layer **Date:** June 2026 (as-if-implemented) **Status:** Production Release **Base Documentation:** `AIOS-LIVRO-DE-OURO-V2.1-SUMMARY.md` + this document --- ## 🎯 PURPOSE OF THIS DOCUMENT This is a **delta document** highlighting **ONLY what changed in v2.2** compared to v4.0.4. For complete content: - βœ… **`AIOS-LIVRO-DE-OURO.md`** (v2.0 base) - βœ… **`AIOS-LIVRO-DE-OURO-V2.1-SUMMARY.md`** (v4.0.4 changes) - βœ… **This document** (v2.2 changes ONLY) **Combined reading:** v2.0 base + v4.0.4 delta + v2.2 delta = Complete v2.2 understanding --- ## πŸš€ WHAT'S NEW IN v2.2 - EXECUTIVE SUMMARY ### Memory Layer (The Game Changer) **v4.0.4:** Stateless agents (each execution isolated) **v2.2:** Agents remember, learn, and improve ```yaml Memory Types: 1. Short-Term Memory (Session): - Current conversation context - Active task state - Recent decisions - Lifespan: 1 session 2. Long-Term Memory (Historical): - Past project patterns - Successful solutions - Failed approaches to avoid - Lifespan: Forever (with decay) 3. Shared Memory (Team): - Team coding standards - Project architecture decisions - Common gotchas - Lifespan: Project lifetime 4. Personal Memory (Agent): - Agent-specific preferences - Learning from feedback - Performance optimization - Lifespan: Agent lifetime ``` --- ### Agent Lightning (RL Optimization) **v4.0.4:** Static workflows **v2.2:** Self-optimizing workflows ```yaml What Agent Lightning Does: 1. Workflow Analysis: - Tracks execution patterns - Identifies bottlenecks - Measures performance 2. Automatic Optimization: - Reorders steps for efficiency - Parallelize when possible - Cache expensive operations - Skip unnecessary steps 3. Cost Reduction: - Chooses optimal executor per task - Reduces LLM calls when possible - Batch operations intelligently 4. Learning from Outcomes: - Successful patterns reinforced - Failed patterns avoided - Continuous improvement Result: - 30% faster execution - 40% cost reduction - 10% improvement per week ``` --- ### Advanced Features Matrix | Feature | v4.0.4 | v2.2 | Impact | |---------|------|------|--------| | **Memory Layer** | ❌ Stateless | βœ… 4 memory types | Agents learn | | **Agent Lightning** | ❌ Static | βœ… RL optimization | 30% faster, 40% cheaper | | **Team Collaboration** | ⚠️ Basic | βœ… Full suite | Shared context | | **Analytics Dashboard** | ⚠️ Basic | βœ… Advanced | Deep insights | | **Clones Marketplace** | ❌ None | βœ… 10+ clones | Expert access | | **Quality Gates** | βœ… 3 layers | βœ… 3 layers + learning | Gates improve | | **Enterprise Features** | ⚠️ Basic | βœ… Complete | Scale + SLAs | --- ## 🧠 DEEP DIVE: Memory Layer ### The Problem (v4.0.4) ```yaml Scenario: Developer asks Dex (Dev Agent) to implement feature Session 1 (Monday): Developer: "Implement user authentication" Dex: "I'll create auth endpoints..." [Implements authentication] Session 2 (Tuesday): Developer: "Implement user authentication for admin panel" Dex: "I'll create auth endpoints..." [Starts from scratch again! No memory of Monday's work] Problem: - No memory of previous sessions - Repeats same questions - Duplicates work - Doesn't learn from feedback ``` ### The Solution (v2.2) ```yaml Scenario: Same, but with Memory Layer Session 1 (Monday): Developer: "Implement user authentication" Dex: "I'll create auth endpoints..." [Implements authentication] [STORES TO MEMORY: "User auth pattern: JWT + refresh tokens"] Session 2 (Tuesday): Developer: "Implement user authentication for admin panel" Dex: [RETRIEVES FROM MEMORY: "User auth pattern: JWT + refresh tokens"] Dex: "I see we used JWT pattern for user auth. Should I follow the same pattern for admin panel, or different requirements?" Developer: "Same pattern, just add admin role check" Dex: [REUSES previous implementation, adds role check] Result: - Remembers previous work - Asks intelligent questions - Reuses patterns - 10x faster (reuse vs. rebuild) ``` ### Memory Architecture **Storage:** ```yaml Vector Database (Embeddings): - Semantic search over past interactions - Find similar problems/solutions - Tool: Pinecone / Weaviate / Qdrant Structured Database (Facts): - Project architecture decisions - Team coding standards - Explicit knowledge - Tool: PostgreSQL + JSON Cache Layer (Hot Data): - Current session context - Frequently accessed memories - Tool: Redis Graph Database (Relationships): - How concepts relate - Dependency tracking - Tool: Neo4j (optional) ``` **Retrieval (RecallM-inspired):** ```yaml When agent needs memory: 1. Query Formation: Current context + task β†’ embedding 2. Semantic Search: Find top K relevant memories (vector DB) 3. Temporal Filtering: Recent memories weighted higher Decay function: relevance = base_score * e^(-Ξ» * age) 4. Contradiction Resolution: If conflicting memories, prefer: - More recent (for changing requirements) - Higher confidence (for stable patterns) - Human-validated (for critical decisions) 5. Context Assembly: Retrieved memories + current task β†’ agent prompt ``` ### Memory Types in Detail **1. Short-Term Memory (Session):** ```yaml What it stores: - Current conversation - Active task state - Temporary decisions Lifespan: 1 session (cleared after) Example: Developer: "Create a REST API" Dex: "Which endpoints do you need?" Developer: "Users, posts, comments" Dex: [SHORT-TERM: endpoints = [users, posts, comments]] Developer: "Add authentication to users endpoint" Dex: [SHORT-TERM: auth_required = [users]] [Uses short-term context to implement correctly] ``` **2. Long-Term Memory (Historical):** ```yaml What it stores: - Past project patterns - Successful solutions - Failed approaches - Performance data Lifespan: Forever (with decay) Example: [STORED 3 months ago]: "PostgreSQL connection pooling with 20 connections caused timeout errors. Reduced to 10, solved." [TODAY - New project]: Developer: "Setup PostgreSQL" Dex: [RETRIEVES: PostgreSQL pooling issue] Dex: "I'll configure connection pool. Based on past experience, I recommend 10 connections to avoid timeout issues. Should I proceed?" ``` **3. Shared Memory (Team):** ```yaml What it stores: - Team coding standards - Project architecture - Common gotchas - Onboarding knowledge Lifespan: Project lifetime Example: [TEAM MEMORY]: "This project uses React Query for server state, Zustand for client state. Never mix them." [New team member]: Developer: "How should I manage state?" Dex: [RETRIEVES: Team state management policy] Dex: "Our team uses React Query for server state and Zustand for client state. I'll set that up." ``` **4. Personal Memory (Agent):** ```yaml What it stores: - Agent performance patterns - Learning from feedback - Optimization preferences Lifespan: Agent lifetime Example: [After 100 executions]: Dex notices: "When I suggest async/await, developer accepts 95%. When I suggest Promises, only 60%. Adjust preferences." [Next execution]: Dex: [Defaults to async/await based on past feedback] [Developer happy, no correction needed] ``` --- ## ⚑ DEEP DIVE: Agent Lightning ### The Problem (v4.0.4) ```yaml Static Workflow (v4.0.4): 1. Developer creates story 2. Dex implements (5 min) 3. Quinn tests (3 min) 4. Code review (2 min) 5. Merge (1 min) Total: 11 minutes EVERY TIME Problem: - No learning - No optimization - Same time regardless of task complexity - Wastes resources on simple tasks ``` ### The Solution (v2.2) ```yaml Optimized Workflow (v2.2 with Agent Lightning): Simple Task (e.g., "Add console.log"): 1. Lightning recognizes: "Simple, low-risk" 2. Dex implements (30s) 3. Skip Quinn (not needed, tests pass auto) 4. Skip human review (pre-approved pattern) 5. Auto-merge Total: 1 minute (91% faster!) Complex Task (e.g., "Refactor auth system"): 1. Lightning recognizes: "Complex, high-risk" 2. Dex implements (8 min) 3. Quinn extensive tests (5 min) 4. Aria (Architect) reviews (3 min) 5. Human strategic review (10 min) 6. Merge with caution Total: 26 minutes (appropriate for complexity) Result: - Right level of review for each task - Fast when safe, thorough when needed - 30% average time reduction - 40% cost reduction (skip unnecessary LLM calls) ``` ### Agent Lightning Architecture **Reinforcement Learning Loop:** ```yaml 1. Observation (State): - Task complexity score - Risk assessment - Historical success rate for similar tasks - Current team velocity - Time of day (developer responsiveness) 2. Action (Policy): Choose workflow variation: - Skip steps (low-risk) - Add steps (high-risk) - Parallelize (independent) - Serialize (dependent) - Change executors (cost/speed trade-off) 3. Reward (Feedback): Positive reward: - Task completed successfully - Developer satisfied - Under time/cost budget Negative reward: - Task failed validation - Developer rejected - Over budget 4. Learning (Policy Update): - Successful patterns reinforced - Failed patterns penalized - Continuous improvement ``` **Optimization Strategies:** ```yaml 1. Step Skipping: IF task_complexity < 0.3 AND historical_success > 0.95: SKIP extensive testing REASON: Simple + proven pattern = safe to skip 2. Parallelization: IF steps_independent: RUN in parallel REASON: 3 steps @ 2min each = 2min total (not 6min) 3. Executor Selection: IF task_deterministic: USE Worker (fast, cheap) ELIF task_creative: USE Agent (smart, expensive) ELIF task_expert_domain: USE Clone (best quality) 4. Batch Operations: IF multiple similar tasks: BATCH LLM calls REASON: 10 calls @ 1s each β†’ 1 batch call @ 2s total 5. Caching: IF task seen before: RETRIEVE cached result VALIDATE still applicable REUSE if valid ``` ### Impact Metrics **Before Agent Lightning (v4.0.4):** ```yaml Average workflow time: 11 minutes Average cost per story: $0.50 (LLM calls) Wasted effort: 30% (unnecessary steps) Learning rate: 0% (static) ``` **After Agent Lightning (v2.2):** ```yaml Average workflow time: 7.7 minutes (-30%) Average cost per story: $0.30 (-40%) Wasted effort: 5% (optimized) Learning rate: 10% improvement per week ``` --- ## 🀝 DEEP DIVE: Team Features ### Shared Context **v4.0.4:** Each developer's agents isolated **v2.2:** Team-wide shared memory ```yaml Scenario: 3 developers on same project Alice (Frontend): Works with Dex (Dev Agent) Implements UI components [Stores to TEAM MEMORY]: "Button component uses Tailwind utility classes" Bob (Backend): Works with Dex (Dev Agent) [RETRIEVES from TEAM MEMORY]: Alice's coding standards Dex: "I see the team uses Tailwind. I'll match that style for error messages." Carol (QA): Works with Quinn (QA Agent) [RETRIEVES from TEAM MEMORY]: Both Alice and Bob's patterns Quinn: "I'll test UI consistency (Tailwind) and backend error format." Result: Automatic alignment, no manual coordination needed ``` ### Collaborative Workflows ```yaml Feature: Real-time workflow visibility Alice starts story: - Bob sees: "Alice working on User Profile" - Carol sees: "Tests needed after Alice completes" - System prepares: QA environment for Carol Alice completes: - System notifies Carol automatically - Quinn (QA) already has context from shared memory - Tests run immediately (no wait) Result: Zero handoff delay ``` ### Team Analytics ```yaml Dashboard Metrics: Team Velocity: - Stories completed per week - Trending up/down - Bottleneck identification Agent Performance: - Which agents most effective - Success rates per agent - Cost efficiency Pattern Analysis: - Most common tasks - Reusable patterns identified - Automation opportunities Quality Trends: - Issues per story over time - Quality improving/degrading - Root cause analysis ``` --- ## πŸͺ DEEP DIVE: Clones Marketplace ### Available Clones (v2.2 Launch) **1. Pedro ValΓ©rio (Systems Architect)** ```yaml Specialty: Process systematization, automation strategy Use Cases: - Designing workflow automation - Optimizing team processes - ClickUp integration strategy - Efficiency analysis Price: $299/month Quality: 92% fidelity to original Methodology: DNA Mentalβ„’ ``` **2. Brad Frost (Atomic Design)** ```yaml Specialty: Design systems, component architecture Use Cases: - Component library design - Pattern library structure - UI consistency validation - Design system documentation Price: $249/month Quality: 91% fidelity to original Methodology: DNA Mentalβ„’ ``` **3. Marty Cagan (Product Discovery)** ```yaml Specialty: Product strategy, discovery frameworks Use Cases: - PRD creation - Opportunity assessment - Product validation - Four Risks analysis Price: $299/month Quality: 89% fidelity to original Methodology: DNA Mentalβ„’ ``` **4. Paul Graham (First Principles)** ```yaml Specialty: Strategic thinking, startup advice Use Cases: - Strategic decision making - First principles analysis - Startup validation - Essay-quality writing Price: $399/month Quality: 87% fidelity to original Methodology: DNA Mentalβ„’ ``` **Coming Soon (Q3 2026):** - Kent Beck (TDD & Software Craftsmanship) - Mitchell Hashimoto (Infrastructure & DevOps) - Guillermo Rauch (Frontend Architecture) - Naval Ravikant (Leverage & Decision Making) - Reid Hoffman (Network Effects & Scaling) - Jeff Bezos (Customer Obsession & Scale) ### How Clones Work **Training Process:** ```yaml 1. Source Material Collection: - Essays, books, talks (100+ hours) - Decision-making patterns - Methodology documentation - Real project artifacts 2. Cognitive Architecture Mapping: - Mental models identification - Recognition patterns - Decision frameworks - Personality traits 3. DNA Mentalβ„’ Encoding: - Convert patterns to algorithms - Encode heuristics - Validate with original person - Iterative refinement 4. Fidelity Testing: - Blind tests (clone vs. original) - Success rate: 85-95% - Continuous improvement Time to create: 6-12 months ``` **Usage:** ```yaml # Activate clone for review $ aios clone activate brad-frost # Use clone in workflow task: validateDesignSystem() responsavel: Brad Frost Clone responsavel_type: Clone # Clone provides expert-level validation [Brad Frost Clone]: "I see 23 button variations across your codebase. Following Atomic Design principles, you should have at most 3-4 button atoms with props for variations. Specific issues: 1. .btn-primary-large duplicates .btn-lg-primary 2. Inconsistent naming: some use 'btn-', some 'button-' 3. Missing hover states on 7 buttons Recommended refactor: [detailed plan] β€” Brad Frost Clone, preserving atomic integrity" ``` --- ## πŸ“Š COMPARATIVE METRICS: v4.0.4 vs. v2.2 ### Development Speed | Metric | v4.0.4 | v2.2 | Improvement | |--------|------|------|-------------| | Simple task time | 11 min | 1 min | **91% faster** | | Complex task time | 11 min | 26 min | Appropriately slower | | Average task time | 11 min | 7.7 min | **30% faster** | | Learning rate | 0% | 10%/week | **Continuous improvement** | ### Cost Efficiency | Metric | v4.0.4 | v2.2 | Improvement | |--------|------|------|-------------| | Avg cost per story | $0.50 | $0.30 | **40% cheaper** | | Wasted LLM calls | 30% | 5% | **83% reduction** | | Cache hit rate | 0% | 45% | **Massive savings** | ### Quality & Learning | Metric | v4.0.4 | v2.2 | Improvement | |--------|------|------|-------------| | Issue catch rate | 80% (3 layers) | 85% (learning) | **+5 percentage points** | | False positive rate | 15% | 8% | **47% reduction** | | Agent accuracy | 85% | 94% (after 1 month) | **+9 percentage points** | | Duplicate work | 50% | 10% | **80% reduction** | ### Team Collaboration | Metric | v4.0.4 | v2.2 | Improvement | |--------|------|------|-------------| | Handoff delay | 30 min avg | 0 min | **100% elimination** | | Coordination overhead | 2h/day | 15min/day | **87% reduction** | | Context switching | 8x/day | 2x/day | **75% reduction** | | Team alignment | 70% | 95% | **+25 percentage points** | --- ## πŸš€ ROADMAP BEYOND v2.2 ### v2.3 (Q3 2026) - Enterprise & Scale ```yaml Features: - Multi-tenant architecture - SSO & advanced auth - Audit logs & compliance - Custom SLAs - Dedicated support - Private deployment options ``` ### v2.4 (Q4 2026) - Advanced AI ```yaml Features: - Multimodal agents (vision + text) - Voice interaction - Real-time collaboration - Agent-to-agent communication - Autonomous task creation ``` ### v3.0 (2027) - The Vision ```yaml Features: - Agents that train other agents - Self-organizing teams - Predictive task generation - Zero-configuration setup - Universal language support ``` --- ## 🎯 SUMMARY: Evolution Path ### v2.0 β†’ v4.0.4 (The Foundation) **Focus:** Installation + Discovery + Architecture - βœ… 5-minute installation - βœ… Service Discovery (97+ Workers) - βœ… Task-First Architecture - βœ… Quality Gates 3 Layers - βœ… Workers open-source **Impact:** 96% faster installation, infinite discovery value --- ### v4.0.4 β†’ v2.2 (The Intelligence) **Focus:** Memory + Learning + Collaboration - βœ… Memory Layer (4 types) - βœ… Agent Lightning (RL optimization) - βœ… Team collaboration features - βœ… Analytics dashboard - βœ… Clones marketplace **Impact:** 30% faster, 40% cheaper, continuous learning --- ### v2.2 β†’ v3.0 (The Autonomy) **Focus:** Self-organization + Prediction + Universality - ⏳ Agents train agents - ⏳ Self-organizing teams - ⏳ Predictive task generation - ⏳ Universal language support **Impact:** Human-level team coordination --- ## πŸ“– WHERE TO GO FROM HERE ### If You're on v4.0.4 1. βœ… Read this summary (done!) 2. β†’ Review [Memory Layer Architecture](#memory-layer) 3. β†’ Review [Agent Lightning Details](#agent-lightning) 4. β†’ Upgrade: `npx @SynkraAI/aios upgrade v2.2` 5. β†’ Configure: `aios memory setup` 6. β†’ Enable: `aios lightning enable` ### If You Want Memory Layer Deep Dive 1. β†’ Read [Memory Types](#memory-types) 2. β†’ Read [Retrieval Strategy](#retrieval) 3. β†’ Read [RecallM Paper](https://arxiv.org/abs/2307.02738) 4. β†’ Read [Supermemory Docs](https://github.com/supermemoryai/supermemory) 5. β†’ Experiment: `aios memory query "show me past auth implementations"` ### If You Want to Try Clones 1. β†’ Browse [Clones Marketplace](#clones-marketplace) 2. β†’ Read [Clone Comparison](#clone-comparison) 3. β†’ Trial: `aios clone trial brad-frost --days 7` 4. β†’ Subscribe: `aios clone subscribe brad-frost` --- **Full v2.2 Documentation:** Combine v2.0 base + v4.0.4 delta + v2.2 delta **Next Version:** v2.3 (Q3 2026) - Enterprise & Scale **Last Updated:** June 2026 (as-if-implemented) --- ## πŸ“ SOURCE TREE v2.2 (With Memory Layer + Agent Lightning) ### Complete Project Structure ``` aios-core/ # Root project β”œβ”€β”€ .aios-core/ # Modular Architecture β”‚ β”‚ β”‚ β”œβ”€β”€ core/ # Core Framework Module β”‚ β”‚ β”œβ”€β”€ config/ β”‚ β”‚ β”‚ β”œβ”€β”€ core-config.yaml β”‚ β”‚ β”‚ β”œβ”€β”€ install-manifest.yaml β”‚ β”‚ β”‚ β”œβ”€β”€ agent-config-loader.js β”‚ β”‚ β”‚ └── validation-rules.yaml β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ orchestration/ β”‚ β”‚ β”‚ β”œβ”€β”€ workflow-engine.js β”‚ β”‚ β”‚ β”œβ”€β”€ task-router.js β”‚ β”‚ β”‚ β”œβ”€β”€ executor-selector.js β”‚ β”‚ β”‚ β”œβ”€β”€ parallel-executor.js β”‚ β”‚ β”‚ └── agent-lightning.js # ⭐ NEW: RL optimization engine β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ validation/ β”‚ β”‚ β”‚ β”œβ”€β”€ quality-gate-manager.js β”‚ β”‚ β”‚ β”œβ”€β”€ pre-commit-hooks.js β”‚ β”‚ β”‚ β”œβ”€β”€ pr-automation.js β”‚ β”‚ β”‚ β”œβ”€β”€ human-review.js β”‚ β”‚ β”‚ └── learning-feedback-loop.js # ⭐ NEW: Gates learn from results β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ service-discovery/ β”‚ β”‚ β”‚ β”œβ”€β”€ service-registry.json β”‚ β”‚ β”‚ β”œβ”€β”€ discovery-cli.js β”‚ β”‚ β”‚ β”œβ”€β”€ compatibility-checker.js β”‚ β”‚ β”‚ └── contribution-validator.js β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ manifest/ β”‚ β”‚ β”‚ β”œβ”€β”€ agents-manifest.csv β”‚ β”‚ β”‚ β”œβ”€β”€ workers-manifest.csv β”‚ β”‚ β”‚ β”œβ”€β”€ tasks-manifest.csv β”‚ β”‚ β”‚ └── manifest-validator.js β”‚ β”‚ β”‚ β”‚ β”‚ └── memory/ # ⭐ NEW: Memory Layer β”‚ β”‚ β”œβ”€β”€ memory-manager.js # Memory orchestration β”‚ β”‚ β”œβ”€β”€ storage/ # Storage backends β”‚ β”‚ β”‚ β”œβ”€β”€ vector-db.js # Vector database (Pinecone/Weaviate) β”‚ β”‚ β”‚ β”œβ”€β”€ structured-db.js # PostgreSQL + JSON β”‚ β”‚ β”‚ β”œβ”€β”€ cache-layer.js # Redis cache β”‚ β”‚ β”‚ └── graph-db.js # Neo4j (optional) β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ retrieval/ # Memory retrieval β”‚ β”‚ β”‚ β”œβ”€β”€ semantic-search.js # Embedding search β”‚ β”‚ β”‚ β”œβ”€β”€ temporal-filter.js # Time-based filtering β”‚ β”‚ β”‚ β”œβ”€β”€ contradiction-resolver.js # Conflict resolution β”‚ β”‚ β”‚ └── context-assembler.js # Build context from memories β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ types/ # Memory types β”‚ β”‚ β”‚ β”œβ”€β”€ short-term.js # Session memory β”‚ β”‚ β”‚ β”œβ”€β”€ long-term.js # Historical memory β”‚ β”‚ β”‚ β”œβ”€β”€ shared.js # Team memory β”‚ β”‚ β”‚ └── personal.js # Agent memory β”‚ β”‚ β”‚ β”‚ β”‚ └── config/ β”‚ β”‚ β”œβ”€β”€ memory-config.yaml # Memory configuration β”‚ β”‚ └── decay-functions.js # Temporal decay β”‚ β”‚ β”‚ β”œβ”€β”€ development/ # Development Module β”‚ β”‚ β”œβ”€β”€ agents/ # 11 specialized agents β”‚ β”‚ β”‚ β”œβ”€β”€ dex.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ luna.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ aria.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ quinn.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ zara.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ kai.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ sage.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ felix.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ nova.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”œβ”€β”€ uma.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ └── dara.md # ⭐ ENHANCED: With memory β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ workers/ # 97+ Workers (Open-Source) β”‚ β”‚ β”‚ β”œβ”€β”€ config-setup/ # (12 workers) β”‚ β”‚ β”‚ β”œβ”€β”€ data-transform/ # (23 workers) β”‚ β”‚ β”‚ β”œβ”€β”€ file-ops/ # (18 workers) β”‚ β”‚ β”‚ β”œβ”€β”€ integration/ # (15 workers) β”‚ β”‚ β”‚ β”œβ”€β”€ quality/ # (11 workers) β”‚ β”‚ β”‚ β”œβ”€β”€ build-deploy/ # (10 workers) β”‚ β”‚ β”‚ └── utilities/ # (8 workers) β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ tasks/ # 60+ task definitions β”‚ β”‚ β”‚ β”œβ”€β”€ create-next-story.md β”‚ β”‚ β”‚ β”œβ”€β”€ develop-story.md β”‚ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”‚ β”‚ └── workflows/ # 16+ workflows β”‚ β”‚ β”œβ”€β”€ greenfield-fullstack.yaml β”‚ β”‚ β”œβ”€β”€ brownfield-integration.yaml β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”œβ”€β”€ product/ # Product Module β”‚ β”‚ β”œβ”€β”€ templates/ # Complete Template Engine β”‚ β”‚ β”‚ β”œβ”€β”€ story-tmpl.yaml β”‚ β”‚ β”‚ β”œβ”€β”€ prd-tmpl.yaml β”‚ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ workflows/ β”‚ β”‚ β”‚ β”œβ”€β”€ discovery-sprint.yaml β”‚ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ checklists/ β”‚ β”‚ β”‚ β”œβ”€β”€ po-master-checklist.md β”‚ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”‚ β”‚ └── decisions/ β”‚ β”‚ β”œβ”€β”€ pmdr/ β”‚ β”‚ β”œβ”€β”€ adr/ β”‚ β”‚ └── dbdr/ β”‚ β”‚ β”‚ β”œβ”€β”€ infrastructure/ # Infrastructure Module β”‚ β”‚ β”œβ”€β”€ cli/ # CLI system β”‚ β”‚ β”‚ β”œβ”€β”€ aios.js β”‚ β”‚ β”‚ β”œβ”€β”€ commands/ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ init.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ migrate.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ workers.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ agents.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ stories.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ memory.js # ⭐ NEW: Memory management β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ lightning.js # ⭐ NEW: Agent Lightning control β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ analytics.js # ⭐ NEW: Analytics dashboard β”‚ β”‚ β”‚ β”‚ └── clones.js # ⭐ NEW: Clone management β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ └── installer/ β”‚ β”‚ β”‚ β”œβ”€β”€ wizard.js β”‚ β”‚ β”‚ β”œβ”€β”€ environment-detector.js β”‚ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ mcp/ # MCP System β”‚ β”‚ β”‚ β”œβ”€β”€ global-config/ β”‚ β”‚ β”‚ β”œβ”€β”€ project-config/ β”‚ β”‚ β”‚ └── mcp-manager.js β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ integrations/ β”‚ β”‚ β”‚ β”œβ”€β”€ coderabbit/ # CodeRabbit integration β”‚ β”‚ β”‚ β”œβ”€β”€ github-cli/ β”‚ β”‚ β”‚ β”œβ”€β”€ supabase-cli/ β”‚ β”‚ β”‚ β”œβ”€β”€ railway-cli/ β”‚ β”‚ β”‚ β”œβ”€β”€ clickup/ β”‚ β”‚ β”‚ └── clones-marketplace/ # ⭐ NEW: Clones integration β”‚ β”‚ β”‚ β”œβ”€β”€ clone-loader.js β”‚ β”‚ β”‚ β”œβ”€β”€ dna-mental-engine.js β”‚ β”‚ β”‚ └── available-clones/ β”‚ β”‚ β”‚ β”œβ”€β”€ pedro-valerio.json β”‚ β”‚ β”‚ β”œβ”€β”€ brad-frost.json β”‚ β”‚ β”‚ β”œβ”€β”€ marty-cagan.json β”‚ β”‚ β”‚ └── paul-graham.json β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ analytics/ # ⭐ NEW: Analytics system β”‚ β”‚ β”‚ β”œβ”€β”€ dashboard-server.js # Analytics dashboard β”‚ β”‚ β”‚ β”œβ”€β”€ metrics-collector.js # Metrics collection β”‚ β”‚ β”‚ β”œβ”€β”€ reports/ # Report generators β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ velocity-report.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ quality-report.js β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ cost-report.js β”‚ β”‚ β”‚ β”‚ └── pattern-report.js β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ └── visualizations/ # Charts & graphs β”‚ β”‚ β”‚ β”œβ”€β”€ velocity-chart.js β”‚ β”‚ β”‚ β”œβ”€β”€ quality-trend.js β”‚ β”‚ β”‚ └── cost-analysis.js β”‚ β”‚ β”‚ β”‚ β”‚ └── scripts/ β”‚ β”‚ β”œβ”€β”€ component-generator.js β”‚ β”‚ β”œβ”€β”€ elicitation-engine.js β”‚ β”‚ β”œβ”€β”€ greeting-builder.js β”‚ β”‚ β”œβ”€β”€ template-engine.js β”‚ β”‚ └── ... β”‚ β”‚ β”‚ └── docs/ # Framework documentation β”‚ β”œβ”€β”€ AIOS-FRAMEWORK-MASTER.md β”‚ β”œβ”€β”€ AIOS-LIVRO-DE-OURO.md β”‚ β”œβ”€β”€ AIOS-LIVRO-DE-OURO-V2.1.md β”‚ β”œβ”€β”€ AIOS-LIVRO-DE-OURO-V2.2.md # ⭐ NEW β”‚ β”œβ”€β”€ EXECUTOR-DECISION-TREE.md β”‚ β”œβ”€β”€ TASK-FORMAT-SPECIFICATION-V1.md β”‚ └── ... β”‚ β”œβ”€β”€ docs/ # Project-specific docs β”‚ β”œβ”€β”€ prd/ β”‚ β”œβ”€β”€ architecture/ β”‚ β”œβ”€β”€ framework/ β”‚ β”‚ β”œβ”€β”€ coding-standards.md β”‚ β”‚ β”œβ”€β”€ source-tree.md β”‚ β”‚ β”œβ”€β”€ tech-stack.md β”‚ β”‚ └── db-schema.md β”‚ β”‚ β”‚ β”œβ”€β”€ research/ β”‚ β”œβ”€β”€ epics/ β”‚ β”œβ”€β”€ stories/ β”‚ β”‚ β”œβ”€β”€ v4.0.4/ # v4.0.4 stories (completed) β”‚ β”‚ β”œβ”€β”€ v2.2/ # ⭐ v2.2 stories (in progress) β”‚ β”‚ β”‚ β”œβ”€β”€ sprint-1/ # Memory Layer β”‚ β”‚ β”‚ β”œβ”€β”€ sprint-2/ # Agent Lightning β”‚ β”‚ β”‚ β”œβ”€β”€ sprint-3/ # Team Features β”‚ β”‚ β”‚ β”œβ”€β”€ sprint-4/ # Analytics β”‚ β”‚ β”‚ └── sprint-5/ # Clones Marketplace β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ independent/ β”‚ β”‚ └── archive/ β”‚ β”‚ β”‚ β”œβ”€β”€ decisions/ β”‚ β”‚ β”œβ”€β”€ pmdr/ β”‚ β”‚ β”œβ”€β”€ adr/ β”‚ β”‚ └── dbdr/ β”‚ β”‚ β”‚ β”œβ”€β”€ qa/ β”‚ β”œβ”€β”€ audits/ β”‚ └── guides/ β”‚ β”œβ”€β”€ Squads/ # Expansion packs (open-source) β”‚ β”œβ”€β”€ expansion-creator/ β”‚ └── data-engineering/ β”‚ β”œβ”€β”€ .memory/ # ⭐ NEW: Memory storage (local) β”‚ β”œβ”€β”€ vector-store/ # Vector embeddings β”‚ β”‚ β”œβ”€β”€ index.bin # Vector index β”‚ β”‚ └── embeddings/ # Embedding cache β”‚ β”‚ β”‚ β”œβ”€β”€ structured/ # Structured data β”‚ β”‚ β”œβ”€β”€ memory.db # SQLite database β”‚ β”‚ └── backups/ # Memory backups β”‚ β”‚ β”‚ β”œβ”€β”€ cache/ # Redis-compatible cache β”‚ β”‚ └── session-cache.json β”‚ β”‚ β”‚ └── config/ β”‚ └── memory-local-config.yaml β”‚ β”œβ”€β”€ .lightning/ # ⭐ NEW: Agent Lightning data β”‚ β”œβ”€β”€ models/ # RL models β”‚ β”‚ β”œβ”€β”€ workflow-optimizer.pkl # Trained RL model β”‚ β”‚ └── checkpoint/ # Training checkpoints β”‚ β”‚ β”‚ β”œβ”€β”€ metrics/ # Performance metrics β”‚ β”‚ β”œβ”€β”€ execution-history.json # Past executions β”‚ β”‚ β”œβ”€β”€ success-rates.json # Success tracking β”‚ β”‚ └── cost-analysis.json # Cost tracking β”‚ β”‚ β”‚ └── policies/ # Learned policies β”‚ β”œβ”€β”€ step-skipping.json # When to skip steps β”‚ β”œβ”€β”€ parallelization.json # When to parallelize β”‚ └── executor-selection.json # Executor choice rules β”‚ β”œβ”€β”€ bin/ β”‚ └── aios.js # Main CLI entry β”‚ β”œβ”€β”€ .ai/ # AI session artifacts β”‚ β”œβ”€β”€ decision-logs/ β”‚ β”œβ”€β”€ context/ β”‚ └── memory-snapshots/ # ⭐ NEW: Memory snapshots β”‚ β”œβ”€β”€ .claude/ β”‚ β”œβ”€β”€ settings.json β”‚ β”œβ”€β”€ CLAUDE.md β”‚ └── commands/ β”‚ β”œβ”€β”€ tests/ β”‚ β”œβ”€β”€ unit/ β”‚ β”œβ”€β”€ integration/ β”‚ β”œβ”€β”€ e2e/ β”‚ └── memory/ # ⭐ NEW: Memory tests β”‚ β”œβ”€β”€ retrieval.test.js β”‚ β”œβ”€β”€ storage.test.js β”‚ └── decay.test.js β”‚ β”œβ”€β”€ .github/ β”‚ β”œβ”€β”€ workflows/ β”‚ β”‚ β”œβ”€β”€ quality-gates-pr.yml β”‚ β”‚ β”œβ”€β”€ coderabbit-review.yml β”‚ β”‚ β”œβ”€β”€ tests.yml β”‚ β”‚ └── memory-backup.yml # ⭐ NEW: Memory backup automation β”‚ β”‚ β”‚ └── coderabbit.yaml β”‚ β”œβ”€β”€ package.json β”œβ”€β”€ tsconfig.json β”œβ”€β”€ .eslintrc.json β”œβ”€β”€ .prettierrc β”œβ”€β”€ .husky/ β”‚ β”œβ”€β”€ pre-commit β”‚ └── pre-push β”‚ β”œβ”€β”€ docker-compose.yml # ⭐ NEW: Local dev environment β”‚ # Includes: β”‚ # - Vector DB (Weaviate) β”‚ # - PostgreSQL (structured memory) β”‚ # - Redis (cache) β”‚ # - Analytics dashboard β”‚ └── README.md ``` --- ### Key Changes from v4.0.4 β†’ v2.2 **1. Memory Layer:** ``` NEW: .aios-core/core/memory/ - memory-manager.js (orchestration) - storage/ (vector, structured, cache, graph) - retrieval/ (semantic search, temporal filtering) - types/ (short-term, long-term, shared, personal) NEW: .memory/ (local storage) - vector-store/ (embeddings) - structured/ (SQLite) - cache/ (session data) Impact: Agents remember past interactions, learn from feedback ``` **2. Agent Lightning:** ``` NEW: .aios-core/core/orchestration/agent-lightning.js - RL-based workflow optimization - Dynamic step selection - Executor optimization - Cost reduction NEW: .lightning/ (RL data) - models/ (trained RL models) - metrics/ (execution history) - policies/ (learned rules) NEW: .aios-core/infrastructure/cli/commands/lightning.js - aios lightning enable - aios lightning status - aios lightning reset Impact: 30% faster execution, 40% cost reduction ``` **3. Team Collaboration:** ``` ENHANCED: .aios-core/core/memory/types/shared.js - Team-wide memory sharing - Real-time context sync - Collaborative workflows NEW: Memory visibility across team members - Alice's patterns visible to Bob - Automatic alignment - Zero coordination overhead Impact: Zero handoff delay, 95% team alignment ``` **4. Advanced Analytics:** ``` NEW: .aios-core/infrastructure/analytics/ - dashboard-server.js (web dashboard) - metrics-collector.js (data collection) - reports/ (velocity, quality, cost, patterns) - visualizations/ (charts & graphs) NEW: .aios-core/infrastructure/cli/commands/analytics.js - aios analytics start (launch dashboard) - aios analytics report (generate reports) Impact: Deep insights, data-driven decisions ``` **5. Clones Marketplace:** ``` NEW: .aios-core/infrastructure/integrations/clones-marketplace/ - clone-loader.js (load expert clones) - dna-mental-engine.js (cognitive emulation) - available-clones/ (10+ expert clones) NEW: .aios-core/infrastructure/cli/commands/clones.js - aios clone list (browse clones) - aios clone trial <name> --days 7 - aios clone subscribe <name> - aios clone activate <name> Available Clones: - Pedro ValΓ©rio (Systems Architecture) - Brad Frost (Atomic Design) - Marty Cagan (Product Discovery) - Paul Graham (First Principles) - [+6 more in roadmap] Impact: Expert-level validation on demand ``` **6. Learning Quality Gates:** ``` ENHANCED: .aios-core/core/validation/learning-feedback-loop.js - Quality gates learn from results - False positive reduction - Accuracy improvement over time Impact: 85% catch rate (vs. 80% in v4.0.4), 8% false positives (vs. 15%) ``` **7. Local Development Environment:** ``` NEW: docker-compose.yml Services: - Weaviate (vector DB) - PostgreSQL (structured memory) - Redis (cache) - Analytics dashboard Impact: One-command local setup with all dependencies ``` **8. Memory Backup Automation:** ``` NEW: .github/workflows/memory-backup.yml - Automatic memory backups - Restore on team member onboarding - Version control for team knowledge Impact: Never lose institutional knowledge ``` --- ### Storage Requirements Comparison | Component | v4.0.4 | v2.2 | Additional Storage | |-----------|------|------|-------------------| | Base Framework | ~50MB | ~50MB | 0MB | | Workers | ~5MB | ~5MB | 0MB | | Memory Layer | N/A | ~200MB (initial) | **+200MB** | | Vector Store | N/A | ~500MB (after 1 month) | **+500MB** | | RL Models | N/A | ~50MB | **+50MB** | | Analytics Data | ~1MB | ~100MB (after 1 month) | **+99MB** | | **Total** | **~56MB** | **~905MB** | **+849MB** | **Note:** Storage grows over time as memory accumulates. Automatic cleanup after 6 months (configurable). --- ### Performance Comparison | Metric | v4.0.4 | v2.2 | Improvement | |--------|------|------|-------------| | Simple task time | 1 min | 30s | **50% faster** | | Complex task time | 26 min | 22 min | **15% faster** | | Average task time | 7.7 min | 5.4 min | **30% faster** | | Cost per story | $0.30 | $0.18 | **40% cheaper** | | Issue catch rate | 80% | 85% | **+5pp** | | False positive rate | 15% | 8% | **47% reduction** | | Agent accuracy | 85% (static) | 94% (after 1 month) | **+9pp** | | Duplicate work | 10% | 2% | **80% reduction** | | Context switching | 2x/day | 0.5x/day | **75% reduction** | --- ### CLI Commands Added in v2.2 ```bash # Memory management $ aios memory query "show me past auth implementations" $ aios memory stats $ aios memory clear --type short-term $ aios memory backup $ aios memory restore # Agent Lightning $ aios lightning enable $ aios lightning disable $ aios lightning status $ aios lightning reset $ aios lightning optimize --workflow greenfield-fullstack # Analytics $ aios analytics start # Launch dashboard (http://localhost:3000) $ aios analytics report velocity # Generate velocity report $ aios analytics report quality # Generate quality report $ aios analytics report cost # Generate cost report $ aios analytics export --format csv # Clones $ aios clone list # Browse available clones $ aios clone info brad-frost # Clone details $ aios clone trial brad-frost --days 7 $ aios clone subscribe brad-frost $ aios clone activate brad-frost $ aios clone deactivate brad-frost ``` --- ### Docker Compose Services (v2.2) ```yaml services: weaviate: image: semitechnologies/weaviate:latest ports: - "8080:8080" volumes: - weaviate_data:/var/lib/weaviate environment: - QUERY_DEFAULTS_LIMIT=25 - AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true - PERSISTENCE_DATA_PATH=/var/lib/weaviate postgres: image: postgres:15 ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data environment: - POSTGRES_DB=aios_memory - POSTGRES_USER=aios - POSTGRES_PASSWORD=aios_dev redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data command: redis-server --appendonly yes analytics: build: .aios-core/infrastructure/analytics/ ports: - "3000:3000" depends_on: - postgres environment: - DATABASE_URL=postgresql://aios:aios_dev@postgres:5432/aios_memory volumes: weaviate_data: postgres_data: redis_data: ``` ---