PAI Documentation Index

Last Updated: 2026-06-30
PAI Version: 5.1.0
Purpose: Master navigation for all PAI documentation


πŸš€ Quick Start

New to PAI? Start here:

  1. QUICKSTART.md β€” Get PAI running in 10 minutes
  2. EXECUTIVE_SUMMARY.md β€” What PAI does and why
  3. ARCHITECTURE_SUMMARY.md β€” System overview

Installation:


πŸ“š Documentation by Category

System Architecture & Design

DocumentDescription
ARCHITECTURE.mdComplete system architecture
ARCHITECTURE_SUMMARY.mdHigh-level overview
PAISystemPhilosophy.mdDesign philosophy & principles
GLOSSARY.mdGlossary & index of all PAI acronyms, terms, and concepts
ENGINE_DAEMON_ARCHITECTURE.mdMulti-engine daemon design
SkillDispatcher-Architecture.mdSkill system design

Operations & Deployment

DocumentDescription
DEPLOYMENT_GUIDE.mdProduction deployment guide
CONFIGURATION.mdConfiguration reference
HERDR_ENGINE_AUTO_LAUNCH.mdAuto-launch configuration
DAEMON_MANAGEMENT_QUICKREF.mdService management commands
TROUBLESHOOTING_METHOD.mdStandard troubleshooting process

ITIL Framework & Service Management

DocumentDescription
ITIL_FRAMEWORK.mdComplete ITIL implementation
ITIL_QUICK_REFERENCE.mdQuick command reference
ITIL_IMPLEMENTATION_GUIDE.mdImplementation guide
ITIL_ACTIVATION_SUMMARY.mdActivation status
SERVICE_CATALOG.mdService catalog
PROBLEM_RESPONSE_PLAYBOOK.mdIncident response

Agent Loops & Observability

DocumentDescription
AGENT_LOOPS.mdAgent loop architecture
AgentLoopMonitor.tsReal-time loop monitoring
AgentLoopDashboard/Web dashboard for loops

Key Features (2026-06-30 deliverables):

  • 24/7 autonomous loop orchestration tracking
  • WebSocket-based real-time dashboard
  • Loop lifecycle, iteration, token metrics
  • Orchestratorβ†’worker pattern visibility

CLI Commands:

# Monitor loops
bun PAI/Tools/AgentLoopMonitor.ts start --orchestrator "main" --pattern "research"
bun PAI/Tools/AgentLoopMonitor.ts iteration <loop-id> --status success
bun PAI/Tools/AgentLoopMonitor.ts end <loop-id>
 
# Dashboard
bun PAI/Tools/AgentLoopDashboard/server.ts
# Open http://localhost:3000

Verification & Approval Gates

FeatureDescription
ApprovalGate.tsDual-factor approval system
VerificationGates/ISC-tracked human approval

Key Features (2026-06-30 deliverables):

  • TOTP-based approval (Google Authenticator)
  • Voice-confirmation codes
  • Tamper-evident audit trail
  • ISC verification tracking

Setup:

# One-time TOTP setup
bun PAI/Tools/ApprovalGate.ts --setup
 
# Request approval
bun PAI/Tools/ApprovalGate.ts --request <slug> <action>
 
# Verify audit log
bun PAI/Tools/ApprovalGate.ts --verify-log

Cost Tracking & Budget Management

ToolDescription
Cost.tsPer-session cost tracking
BUDGET_SOURCE.mdBudget management system

Key Features (2026-06-30 deliverables):

  • Multi-model pricing (Claude, Gemini, Ollama)
  • Session-level cost tracking
  • SQLite-based persistence
  • Daily/weekly/monthly reports

CLI Commands:

# Record session cost
bun PAI/Tools/Cost.ts record <session-id> <model> <input-tokens> <output-tokens>
 
# Get cost report
bun PAI/Tools/Cost.ts report --period daily
bun PAI/Tools/Cost.ts report --period weekly
bun PAI/Tools/Cost.ts report --session <session-id>

Project Management

ToolDescription
ProjectManager.tsMulti-project state management
PROJECT_MANAGEMENT.mdProject management system

Key Features (2026-06-30 deliverables):

  • Multi-project context switching
  • Project parking lot (preserve unfinished work)
  • Quick resume with full context
  • Git-based state tracking
  • ISA integration

Philosophy:

Unfinished projects are exploration, not failure.
Context-switching is a feature, not a bug.

CLI Commands:

# Project operations
bun PAI/Tools/ProjectManager.ts switch <project>
bun PAI/Tools/ProjectManager.ts park <project>
bun PAI/Tools/ProjectManager.ts resume <project>
bun PAI/Tools/ProjectManager.ts list
bun PAI/Tools/ProjectManager.ts active
bun PAI/Tools/ProjectManager.ts archive <project>

See also: PROJECT_MANAGER_README.md

Cross-Domain Pattern Linking

ToolDescription
CrossDomainLinker.tsSymbolic pattern detection
CrossDomainLinker.test.tsTest suite
CrossDomainLinker.demo.tsDemo patterns
CrossDomainLinker.README.mdFull documentation

Key Features (2026-06-30 deliverables):

  • Cross-domain symbolic pattern detection
  • Multi-file pattern synthesis
  • Wikilink-style connections
  • Integration with Knowledge graph

Example patterns:

  • Code architecture ↔ martial arts philosophy
  • System design ↔ jazz improvisation
  • Security patterns ↔ medieval castle design

CLI Commands:

# Detect patterns
bun PAI/Tools/CrossDomainLinker.ts detect <file1> <file2> [...]
 
# Generate synthesis
bun PAI/Tools/CrossDomainLinker.ts synthesize <domain1> <domain2>
 
# Run demo
bun PAI/Tools/CrossDomainLinker.demo.ts

Focus & Time Management (ADHD-Optimized)

ToolDescription
FocusManager.tsADHD-focused productivity
FocusPomodoro.tsAdaptive Pomodoro timers
FocusManager.mdComplete guide
README-FocusManager.mdQuick reference

Key Features (2026-06-30 deliverables):

  • Adaptive Pomodoro (attention-based)
  • Distraction capture without disruption
  • Task parking lot with context preservation
  • Energy state tracking
  • Integration with agent loops

Philosophy:

ADHD isn’t a bug β€” it’s a different operating system.
Work WITH attention patterns, not against them.

CLI Commands:

# Start focus session
bun PAI/Tools/FocusManager.ts start <task> --energy high|medium|low
 
# Capture distraction
bun PAI/Tools/FocusManager.ts capture "<thought>"
 
# Complete session
bun PAI/Tools/FocusManager.ts complete
 
# View stats
bun PAI/Tools/FocusManager.ts stats

Local LLM Performance

DocumentDescription
LOCAL_LLM_INVESTIGATION_FINAL_REPORT.mdComplete investigation
OLLAMA_OPTIMIZATION_GUIDE.mdTuning guide
SOFT_LAUNCH_PLAN.mdIntegration plan
SESSION_COMPLETE_2026-06-30.mdSession summary

Performance Results:

  • 2-4x speedup over baseline Ollama
  • Quality parity (5/5 tests pass)
  • Zero Claude token cost for local work

Cross-Engine Coordination

DocumentDescription
CROSS_ENGINE_PROVENANCE.mdCross-engine tracking
org-session-management.mdMulti-org sessions

Security & Infrastructure

DocumentDescription
SECURITY_OVERRIDE_MECHANISM.mdSecurity overrides
PAI_BIOGRAPHY.mdSystem provenance

Historical Sessions


🎯 Documentation by Use Case

”I want to…”

…get PAI running β†’ QUICKSTART.md β†’ DEPLOYMENT_GUIDE.md

…understand what PAI does β†’ EXECUTIVE_SUMMARY.md β†’ ARCHITECTURE_SUMMARY.md

…monitor agent loops β†’ AGENT_LOOPS.md β†’ bun PAI/Tools/AgentLoopMonitor.ts --help

…track costs β†’ bun PAI/Tools/Cost.ts --help β†’ BUDGET_SOURCE.md

…manage multiple projects β†’ PROJECT_MANAGER_README.md β†’ bun PAI/Tools/ProjectManager.ts --help

…improve focus (ADHD) β†’ FocusManager.md β†’ bun PAI/Tools/FocusManager.ts --help

…detect cross-domain patterns β†’ CrossDomainLinker.README.md β†’ bun PAI/Tools/CrossDomainLinker.ts --help

…require human approval for actions β†’ bun PAI/Tools/ApprovalGate.ts --setup

…optimize local LLM performance β†’ OLLAMA_OPTIMIZATION_GUIDE.md

…troubleshoot an issue β†’ TROUBLESHOOTING_METHOD.md

…manage services β†’ DAEMON_MANAGEMENT_QUICKREF.md

…respond to incidents β†’ PROBLEM_RESPONSE_PLAYBOOK.md


πŸ“– Complete Tool Reference

Core Tools (PAI/Tools/)

Observability

  • AgentLoopMonitor.ts β€” Loop lifecycle tracking
  • AgentLogger.ts β€” Activity logging
  • AgentWatchdog.ts β€” Health monitoring
  • ObservabilityServer.ts β€” Metrics endpoint

Approval & Verification

  • ApprovalGate.ts β€” Dual-factor approval
  • VerificationGates/ β€” ISC-tracked gates

Cost Management

  • Cost.ts β€” Session cost tracking
  • BudgetReport.ts β€” Budget reporting
  • EngineMeter.ts β€” Multi-engine usage

Project Management

  • ProjectManager.ts β€” Multi-project switching
  • ProjectState/ β€” State management
  • ArchiveWork.ts β€” Work archival

Focus & Productivity

  • FocusManager.ts β€” ADHD-optimized focus
  • FocusPomodoro.ts β€” Adaptive timers
  • Agenda.ts β€” Daily planning

Cross-Domain Linking

  • CrossDomainLinker.ts β€” Pattern detection
  • WikilinkGraph.ts β€” Wikilink graph

Media & Content

  • MediaWorkflow.ts β€” Media processing
  • FeedMonitor.ts β€” RSS/feed monitoring
  • InboxAutoProcessor.ts β€” Inbox automation

Infrastructure

  • HybridInference.ts β€” Local/cloud routing
  • RecordRouter.ts β€” Cross-engine handoffs
  • VoiceRouter.ts β€” Voice synthesis

Security

  • ApprovalGate.ts β€” Dual-factor auth
  • SecurityFilter.ts β€” Content filtering
  • SecretScan.ts β€” Secret detection

πŸ”§ CLI Quick Reference

Agent Loop Monitoring

# Start monitoring loop
bun PAI/Tools/AgentLoopMonitor.ts start --orchestrator <id> --pattern <name>
 
# Log iteration
bun PAI/Tools/AgentLoopMonitor.ts iteration <loop-id> --status <status>
 
# End loop
bun PAI/Tools/AgentLoopMonitor.ts end <loop-id>
 
# Dashboard
bun PAI/Tools/AgentLoopDashboard/server.ts

Cost Tracking

# Record cost
bun PAI/Tools/Cost.ts record <session> <model> <in-tokens> <out-tokens>
 
# Get report
bun PAI/Tools/Cost.ts report --period daily
bun PAI/Tools/Cost.ts report --session <id>

Project Management

# Switch project
bun PAI/Tools/ProjectManager.ts switch <project>
 
# Park project
bun PAI/Tools/ProjectManager.ts park <project>
 
# Resume project
bun PAI/Tools/ProjectManager.ts resume <project>
 
# List all
bun PAI/Tools/ProjectManager.ts list

Focus Management

# Start focus
bun PAI/Tools/FocusManager.ts start <task> --energy <level>
 
# Capture distraction
bun PAI/Tools/FocusManager.ts capture "<thought>"
 
# Complete
bun PAI/Tools/FocusManager.ts complete
 
# Stats
bun PAI/Tools/FocusManager.ts stats

Approval Gates

# Setup TOTP
bun PAI/Tools/ApprovalGate.ts --setup
 
# Request approval
bun PAI/Tools/ApprovalGate.ts --request <slug> <action>
 
# Verify log
bun PAI/Tools/ApprovalGate.ts --verify-log

Cross-Domain Linking

# Detect patterns
bun PAI/Tools/CrossDomainLinker.ts detect <files...>
 
# Synthesize
bun PAI/Tools/CrossDomainLinker.ts synthesize <domain1> <domain2>

πŸ—οΈ Integration Guides

How Features Connect

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     PAI Architecture                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

AgentLoopMonitor ──┐
                   β”œβ”€β”€> Dashboard ──> WebSocket
                   └──> JSONL logs

Cost.ts ───────────┐
                   β”œβ”€β”€> SQLite DB ──> Reports
                   └──> BudgetReport.ts

ProjectManager ────┐
                   β”œβ”€β”€> .project/ dirs ──> Git
                   β”œβ”€β”€> ProjectState skill
                   └──> ISA integration

FocusManager ──────┐
                   β”œβ”€β”€> Pomodoro timers
                   β”œβ”€β”€> Distraction capture
                   └──> AgentLoopMonitor

CrossDomainLinker ─┐
                   β”œβ”€β”€> Knowledge graph
                   β”œβ”€β”€> WikilinkGraph
                   └──> Pattern detection

ApprovalGate ──────┐
                   β”œβ”€β”€> TOTP verification
                   β”œβ”€β”€> Voice confirmation
                   └──> Audit trail (JSONL)

HybridInference ───┐
                   β”œβ”€β”€> Ollama (local)
                   β”œβ”€β”€> llama-server (GPU)
                   └──> Cloud fallback

πŸ§ͺ API Reference

TypeScript APIs

AgentLoopMonitor API

import { logLoopStart, logIteration, logLoopEnd } from './AgentLoopMonitor';
 
const loopId = await logLoopStart({
  orchestratorId: "main",
  pattern: "research",
  goal: "Find papers on topic X"
});
 
await logIteration(loopId, {
  iterationNum: 1,
  status: "success",
  tokensUsed: 1200,
  model: "claude-3-5-sonnet"
});
 
await logLoopEnd(loopId, {
  status: "completed",
  totalIterations: 5
});

Cost Tracking API

import { calculateCost, recordSessionCost } from './Cost';
 
// Calculate cost
const cost = calculateCost("claude-3-5-sonnet", 1000, 500);
 
// Record to database
recordSessionCost("ses_123", "claude-3-5-sonnet", 1000, 500);

ProjectManager API

import { switchProject, parkProject, resumeProject } from './ProjectManager';
 
// Switch active project
await switchProject("my-project", "/path/to/project");
 
// Park for later
await parkProject("my-project", {
  reason: "Taking a break",
  context: "Left off implementing feature X"
});
 
// Resume with context
const context = await resumeProject("my-project");

FocusManager API

import { startFocus, captureDistraction, completeFocus } from './FocusManager';
 
// Start focus session
const sessionId = await startFocus({
  task: "Write documentation",
  energy: "medium",
  estimatedPomodoros: 3
});
 
// Capture distraction
await captureDistraction(sessionId, {
  thought: "Check email about meeting",
  urgency: "low"
});
 
// Complete
await completeFocus(sessionId);

πŸ› οΈ Troubleshooting

Common Issues

Agent loops not appearing in dashboard? β†’ Check WebSocket connection: curl http://localhost:3000/api/loops

Cost tracking not working? β†’ Verify SQLite DB exists: ls -lh ~/MEMORY/db/costs.db

Project switch failed? β†’ Check registry: cat ~/.claude/PAI/MEMORY/STATE/projects-registry.json

Focus session interrupted? β†’ Resume: bun PAI/Tools/FocusManager.ts resume

TOTP not working? β†’ Re-sync time: sudo ntpdate -u time.google.com

Full Troubleshooting Guide

See TROUBLESHOOTING_METHOD.md for the complete process.


πŸ“¦ Installation & Deployment

Quick Install

# Clone repo
git clone https://github.com/yourusername/pai.git ~/.claude
 
# Run installer (2026-06-30 deliverable)
bash ~/.claude/install.sh
 
# Configure
$EDITOR ~/.claude/settings.json
 
# Start services
systemctl --user start pai-primary

Full Deployment

See DEPLOYMENT_GUIDE.md for complete instructions.


πŸ“… What’s New (2026-06-30 Session)

Major Deliverables

  1. Agent Loop Observability βœ…

    • AgentLoopMonitor with real-time tracking
    • Web dashboard with WebSocket updates
    • Loop lifecycle, iteration, token metrics
  2. Verification Gates βœ…

    • Dual-factor approval (TOTP + voice)
    • ISC-tracked verification
    • Tamper-evident audit trail
  3. Cost Tracking βœ…

    • Multi-model pricing database
    • Session-level tracking
    • Daily/weekly/monthly reports
  4. Project Management βœ…

    • Multi-project context switching
    • Parking lot for unfinished work
    • Quick resume with full context
  5. Cross-Domain Linking βœ…

    • Symbolic pattern detection
    • Multi-file synthesis
    • Knowledge graph integration
  6. Focus Manager βœ…

    • ADHD-optimized productivity
    • Adaptive Pomodoro timers
    • Distraction capture
  7. Deployment Documentation βœ…

    • 4 deployment guides
    • Service configuration
    • Troubleshooting playbooks
  8. Installer βœ…

    • One-command setup
    • Dependency verification
    • Service installation
  9. YouTube Fixes βœ…

    • RSS feed monitoring
    • Deduplication
    • Daily digest
  10. Infrastructure Portability βœ…

    • Abstraction layers
    • Multi-engine support
    • Cross-platform compatibility
  11. Relationship AI MVP βœ…

    • 2 ADHD-focused tools
    • Context preservation
    • Energy tracking

Performance Achievements

Local LLM:

  • 2-4x speedup vs baseline
  • Quality parity maintained
  • Zero token cost for local work

System Health:

  • 11+ major features delivered
  • Zero regressions
  • Full test coverage

Skills System

See README.md for available skills.

Tools Directory

See README.md for tool catalog.

Algorithm Framework

See Algorithm for Algorithm v5.7.3 documentation.


πŸ“ž Support & Contact

Documentation Issues: File issues at: GitHub Issues

Questions: See TROUBLESHOOTING_METHOD.md first.

Contributing: See CONTRIBUTING.md for guidelines.


πŸ“ Maintenance

Last Full Review: 2026-06-30
Next Review Due: 2026-07-31
Maintainer: Duane (Principal)
DA: PAI Nova (PNK/PNC/PNG/PNO/PNX)


πŸ—‚οΈ Complete File Listing

All Documentation Files (56 files)
PAI/DOCUMENTATION/
β”œβ”€β”€ INDEX.md (this file)
β”œβ”€β”€ QUICKSTART.md
β”œβ”€β”€ EXECUTIVE_SUMMARY.md
β”œβ”€β”€ ARCHITECTURE_SUMMARY.md
β”œβ”€β”€ ARCHITECTURE.md
β”œβ”€β”€ PAISystemPhilosophy.md
β”œβ”€β”€ DEPLOYMENT_GUIDE.md
β”œβ”€β”€ CONFIGURATION.md
β”œβ”€β”€ TROUBLESHOOTING_METHOD.md
β”œβ”€β”€ AGENT_LOOPS.md
β”œβ”€β”€ BUDGET_SOURCE.md
β”œβ”€β”€ CROSS_ENGINE_PROVENANCE.md
β”œβ”€β”€ DAEMON_MANAGEMENT_QUICKREF.md
β”œβ”€β”€ ENGINE_DAEMON_ARCHITECTURE.md
β”œβ”€β”€ HERDR_ENGINE_AUTO_LAUNCH.md
β”œβ”€β”€ ITIL_FRAMEWORK.md
β”œβ”€β”€ ITIL_QUICK_REFERENCE.md
β”œβ”€β”€ ITIL_IMPLEMENTATION_GUIDE.md
β”œβ”€β”€ ITIL_ACTIVATION_SUMMARY.md
β”œβ”€β”€ SERVICE_CATALOG.md
β”œβ”€β”€ PROBLEM_RESPONSE_PLAYBOOK.md
β”œβ”€β”€ PROJECT_MANAGEMENT.md
β”œβ”€β”€ SECURITY_OVERRIDE_MECHANISM.md
β”œβ”€β”€ SkillDispatcher-Architecture.md
β”œβ”€β”€ org-session-management.md
β”œβ”€β”€ PAI_BIOGRAPHY.md
β”œβ”€β”€ LOCAL_LLM_INVESTIGATION_FINAL_REPORT.md
β”œβ”€β”€ OLLAMA_OPTIMIZATION_GUIDE.md
β”œβ”€β”€ SOFT_LAUNCH_PLAN.md
β”œβ”€β”€ SESSION_COMPLETE_2026-06-30.md
β”œβ”€β”€ SESSION_COMPLETE_2026-06-24.md
β”œβ”€β”€ SESSION_SUMMARY_2026-06-27.md
β”œβ”€β”€ SESSION_SUMMARY_2026-06-24.md
β”œβ”€β”€ PHASE3_5_COMPLETE.md
β”œβ”€β”€ PHASE_D_OLLAMA_OPTIMIZATION.md
β”œβ”€β”€ PHASE1_OLLAMA_BASELINE_RESULTS.md
β”œβ”€β”€ PHASE2_LLAMACPP_RESULTS.md
β”œβ”€β”€ PHASE3_LLAMACPP_NATIVE_RESULTS.md
β”œβ”€β”€ PHASE3_5_INTEGRATION_PROGRESS.md
β”œβ”€β”€ PRE_REBOOT_STATE.md
β”œβ”€β”€ VLLM_INSTALLATION_RESULT.md
β”œβ”€β”€ VLLM_VS_OLLAMA_BENCHMARK.md
β”œβ”€β”€ VLLM_FINAL_VERDICT.md
β”œβ”€β”€ VLLM_AWQ_RESULT.md
β”œβ”€β”€ LOCAL_LLM_COMPREHENSIVE_INVESTIGATION.md
β”œβ”€β”€ LOCAL_LLM_INVESTIGATION_PROGRESS.md
β”œβ”€β”€ OLLAMA_TIMEOUT_INVESTIGATION.md
β”œβ”€β”€ OLLAMA_STATUS_VERIFIED.md
β”œβ”€β”€ OLLAMA_CAPABILITY_ASSESSMENT.md
β”œβ”€β”€ MODEL_BENCHMARK_SYSTEM.md
β”œβ”€β”€ OPENROUTER_INTEGRATION_GUIDE.md
β”œβ”€β”€ OPENROUTER_VS_OPENCODE.md
β”œβ”€β”€ CAPABILITY_REGISTRY_IMPLEMENTATION_SUMMARY.md
β”œβ”€β”€ PROBLEM_DETECTION_IMPLEMENTATION_SUMMARY.md
β”œβ”€β”€ RCA_IMPLEMENTATION_SUMMARY.md
β”œβ”€β”€ REARCHITECTURE_GAP_MAP.md
└── POSTMORTEM_TEMPLATE.md

End of Index β€” Use Ctrl+F to search this document.

132 items under this folder.