aios-core
Version:
Synkra AIOS: AI-Orchestrated System for Full Stack Development - Core Framework
1,340 lines (1,107 loc) β’ 39.2 kB
Markdown
# π 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:
```