Spaces:
Paused
Paused
File size: 3,357 Bytes
5a81b95 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | # π PHASE 2 PLAN β ADVANCED INTELLIGENCE
**Duration:** 4-5 weeks (Dec 2025)
**Owner:** Autonomous MCP Team
**Status:** π‘ In Progress
---
## π― Objectives
1. **Unified GraphRAG** β multi-hop reasoning across CMA + SRAG + PAL + ProjectMemory.
2. **Role-Based Agent Teams** β specialized agents coordinating via AutonomousTaskEngine.
3. **StateGraphRouter** β LangGraph-inspired orchestration of decision states.
4. **PatternEvolutionEngine** β evolutionary strategy engine with creative exploration.
---
## ποΈ Work Breakdown
### Week 5-6 β GraphRAG + Agent Teams
| Task | Description | Owner |
| --- | --- | --- |
| Schema Design | Define graph schema (entities, relations, embeddings) | Memory Team |
| Graph Indexer | Build ingestion pipeline β `GraphIndexer` service | Memory Team |
| Reasoning Engine | Implement `UnifiedGraphRAG.ts` (multi-hop search, beam width config) | Intelligence Team |
| Agent Roles | Define `Strategist`, `Researcher`, `Guardian`, `Synthesizer` roles | Task Engine Team |
| Task Routing | Extend `AutonomousTaskEngine` to assign roles per task intent | Task Engine Team |
### Week 7-8 β State Router + Pattern Evolution
| Task | Description | Owner |
| --- | --- | --- |
| StateGraphRouter | Represent decision flow as nodes/edges with guard conditions | Orchestration |
| Memory Hooks | Each node can read/write UnifiedMemory snapshots | Memory Team |
| PatternEvolutionEngine | Genetic-like mutation of strategies, fitness via KPIs | Intelligence Team |
| Feedback Loop | Integrate PAL emotional signals into evolution fitness | PAL Team |
---
## π§ Technical Plan
- **Graph Storage:** Reuse SQLite (FTS + adjacency tables) for dev, abstract interface for Neo4j/Postgres later.
- **Embeddings:** Use existing SRAG embeddings; add relationship embeddings via averaged vectors.
- **Multi-Hop Search:** BFS + heuristic scoring, plus optional `maxDepth`, `beamWidth` config.
- **Agent Roles:** YAML definition in `config/agentRoles.yml` + runtime loader.
- **StateGraphRouter:** JSON/TS definition of nodes, each node points to handler + success/fail transitions.
- **Pattern Evolution:** Maintain population of strategies; evaluation uses telemetry + PAL signals; store in `pattern_strategies` table.
---
## β
Deliverables
1. `apps/backend/src/mcp/cognitive/UnifiedGraphRAG.ts`
2. `apps/backend/src/mcp/cognitive/StateGraphRouter.ts`
3. `apps/backend/src/mcp/cognitive/PatternEvolutionEngine.ts`
4. Updates to `AutonomousTaskEngine.ts` for role assignments
5. Config docs: `docs/PHASE_2_GUIDE.md`
---
## π
Milestones
| Date | Milestone |
| --- | --- |
| Week 5 end | Graph schema + GraphRAG prototype |
| Week 6 end | Role-based agents live in TaskEngine |
| Week 7 end | StateGraphRouter orchestrating decisions |
| Week 8 end | PatternEvolutionEngine generating new strategies |
---
## π¨ Risks & Mitigations
- **Graph Complexity** β enforce depth/beam limits; fallback to classical SRAG if query too broad.
- **Agent Conflicts** β Guardian role monitors conflicting outputs.
- **Performance** β nightly batch evaluations for PatternEvolution to avoid runtime spikes.
---
## π’ Next Actions
1. Build graph schema + ingestion helpers.
2. Scaffold `UnifiedGraphRAG.ts`.
3. Define role templates + update TaskEngine.
4. Design StateGraphRouter JSON schema.
|