Nity Agent — Overview
Nity (Sanskrit: नित्य, nitya) — eternal, perpetual, timeless. An eternal coding companion that grows with every task it touches.
What is Nity?
Nity is the core AI extension for pi-coding-agent. It layers autonomous task execution, persistent memory, self-reflection, quality gates, and skill learning on top of the base agent framework.
Where pi-coding-agent provides the foundation — tool execution, session management, MCP integration — Nity provides the mind. It remembers what it has done, learns from outcomes, and improves its approach over time.
The 8 Component Systems
Nity is organized into 8 component systems that work together as a cohesive cognitive architecture.
| # | System | Responsibility |
|---|---|---|
| 1 | Coordinator | Orchestrates all other components; central dispatch |
| 2 | Task Analyzer | Decomposes incoming tasks into subtasks and complexity scores |
| 3 | Strategy Planner | Selects execution strategies based on task analysis |
| 4 | Execution Router | Routes tasks to the right adapter or execution path |
| 5 | Quality Gates | Validates outputs against configurable quality dimensions |
| 6 | Self-Reflection | Captures post-task learning and meta-cognitive insights |
| 7 | Skill Registry | Stores, indexes, and retrieves learned skills |
| 8 | Progress Tracker | Streams status updates during long-running operations |
The central nervous system. Receives events from pi-coding-agent, delegates to the appropriate component, and aggregates results. Initialized with references to session brain, skill registry, quality gates, and self-reflection modules.
Integration with pi-coding-agent
Nity extends pi-coding-agent through the extension API. It registers as a first-class extension, subscribes to lifecycle events, and injects tools into the agent's tool palette.
┌─────────────────────────────────────────────┐
│ pi-coding-agent │
│ ┌───────────────────────────────────────┐ │
│ │ Extension System │ │
│ │ ┌─────────────────────────────────┐ │ │
│ │ │ Nity Extension │ │ │
│ │ │ index.ts (entry point) │ │ │
│ │ │ ┌───────────┬──────────────┐ │ │ │
│ │ │ │ Coordinator│ Brain │ │ │ │
│ │ │ │ │ (memory) │ │ │ │
│ │ │ ├────────────┼──────────────┤ │ │ │
│ │ │ │ Skill │ Self- │ │ │ │
│ │ │ │ Registry │ Reflection │ │ │ │
│ │ │ └────────────┴──────────────┘ │ │ │
│ │ └─────────────────────────────────┘ │ │
│ └───────────────────────────────────────┘ │
│ ┌───────────────────────────────────────┐ │
│ │ pi-coding-agent Core │ │
│ │ (sessions, tools, MCP, sandbox) │ │
│ └───────────────────────────────────────┘ │
└─────────────────────────────────────────────┘For full details on the extension API, see the pi-mono extension documentation (opens in a new tab).
File Structure
Nity lives at extensions/nity/ with 17 source files:
extensions/nity/
├── index.ts # Extension entry point — tool registration & event wiring
├── package.json # @88pi/nity dependencies
├── types.ts # Core type definitions (NityConfig, TaskAnalysis, etc.)
├── config.ts # Configuration management
├── coordinator.ts # Central orchestrator
├── task-analyzer.ts # Task decomposition & complexity scoring
├── strategy-planner.ts # Execution strategy selection
├── execution-router.ts # Route tasks to adapters or standalone
├── standalone-runner.ts # Wraps nity-loop LoopEngine for direct execution
├── quantumreef-bridge.ts # WebSocket bridge to QuantumReef execution fabric
├── quality-gates.ts # Quality validation pipeline
├── self-reflection.ts # Post-task learning & meta-cognition
├── skill-registry.ts # Skill storage, indexing, retrieval
├── progress-tracker.ts # Real-time status streaming
├── brand/
│ ├── voice.ts # Brand voice generation by state
│ └── state-to-brand.ts # State → brand presence mapping
└── tui/
├── presence-indicator.ts # Nity presence badge in TUI
├── loop-status.ts # Loop progress display
└── memory-banner.ts # Memory/brain status bannerThe 400-line rule applies to every file in this directory. If any source file approaches 350 lines, stop and refactor into smaller, single-responsibility modules.
Implementation Status
All 5 phases from the specification are complete:
| Phase | Components | Status |
|---|---|---|
| 1. Foundation | Entry point, types, coordinator, config | ✅ Complete |
| 2. Brain & Memory | nity-memory (brain, episodes, Ralph Universal, SimpleMem) | ✅ Complete |
| 3. Execution | Task analyzer, strategy planner, router, standalone-runner, quantumreef-bridge, progress | ✅ Complete |
| 4. Quality & Reflection | Quality gates, self-reflection | ✅ Complete |
| 5. Evolution | Skill registry, learned skill derivation, integration tests | ✅ Complete |
Test coverage: 63 nity tests + 868 total across ecosystem, build clean.
All 5 spec families (nity, nity-memory, nity-loop, nity-brand, nity-bidirectional-bridge) are fully implemented and validated. The Nity Agent is production-ready.
Next Steps
- Extension Entry Point → — How
index.tswires everything together - Tool Reference → — All 12 tools with parameters and examples
- Data Flows → — Session start, task execution, and self-evolution flows