Skip to content

khali/Personal_AI_Infrastructure

 
 

Repository files navigation

PAI Logo

Personal AI Infrastructure

Open-source scaffolding for building your own AI-powered operating system


Version License Claude Code


Quick Start · Documentation · Examples · Updates · Community


PAI Overview Video

Watch the full PAI walkthrough | Read: The Real Internet of Things




This project exists so that the best AI in the world is not only used by a few, but can be used by everyone.


Right now the most powerful AI setups are being built inside companies with massive engineering teams, and for the purpose of increasing efficiency and profits.

That's all good, but I think the purpose of technology is to serve humans—not the other way around. These new AI frameworks should be available to everyone, including people not in technology, so that regular people can use it to help them flourish.

That's what PAI is. It's the foundation for building a Personal AI System that understands your larger goals and context, gets better over time, and that works for you because it's yours. Not some generic chatbot. Not some common assistant. A full platform for magnifying yourself and your impact on the world.

Related reading:


What is PAI?

PAI (Personal AI Infrastructure) is an open-source template for building your own AI-powered operating system. It's currently built on Claude Code, but designed to be platform-independent — the architecture, skills, and workflows are structured so future migrations to other AI platforms are straightforward.

PAI Skills Architecture
Component Description
Skills Self-contained AI capabilities with routing, workflows, and documentation
Agents Specialized AI personalities for different tasks (engineer, researcher, designer)
Hooks Event-driven automation that captures work and manages state
History Automatic documentation system (UOCS) that captures everything

Tip

Start clean, small, and simple. Build the scaffolding that makes AI reliable.


What's New in v0.9.0

Big updates! PAI is now fully platform-agnostic — your AI identity, your system.

Feature Description
📊 Observability Dashboard Real-time agent monitoring with live charts
🎭 Genericized Identity Configure your DA name, it flows everywhere
⚙️ Better Configuration Clear docs for all environment variables

👉 See full changelog


🚀 Quick Start

1. Clone PAI

git clone https://github.com/danielmiessler/Personal_AI_Infrastructure.git
cd Personal_AI_Infrastructure

2. Run the Setup Wizard

.claude/tools/setup/bootstrap.sh

The bootstrap script will:

  • Check your shell (recommends zsh or bash)
  • Install Bun if needed (PAI's package manager)
  • Check for Claude Code
  • Launch the interactive setup wizard

The setup wizard will:

  • Ask where to install PAI (default: ~/.claude)
  • Configure your name and email
  • Name your AI assistant (default: "Kai")
  • Choose a color theme
  • Set up voice server (macOS)
  • Add environment variables to your shell

3. Add Your API Keys

# Copy environment template
cp ~/.claude/.env.example ~/.claude/.env

# Edit with your API keys
nano ~/.claude/.env

4. Start Claude Code

source ~/.zshrc  # Load PAI environment
claude

Tip

Non-interactive setup for automation:

bun run setup.ts --pai-dir ~/.claude --name "Your Name" --email [email protected] --force

📚 For detailed setup, see docs/QUICKSTART.md


📚 Documentation

All documentation lives in the CORE skill (.claude/skills/CORE/):

Document Description
CONSTITUTION.md System philosophy, architecture, operating principles
SkillSystem.md How to create your own skills — the canonical skill structure guide
SKILL.md Main PAI skill with identity, preferences, quick reference
hook-system.md Event-driven automation
history-system.md Automatic work documentation (UOCS)
Additional Reference
Document Description
prompting.md Prompt engineering patterns
aesthetic.md Visual design system
voice-server/README.md Text-to-speech feedback

🎨 Examples

Explore example skills in .claude/skills/:

Skill Description
observability/ Real-time agent monitoring dashboard with WebSocket streaming
brightdata/ Four-tier progressive web scraping with automatic fallback
fabric/ Integration with Fabric pattern system (242+ AI patterns)
research/ Multi-source research workflows
create-skill/ Templates for creating new skills

Each skill demonstrates the skills-as-containers pattern with routing, workflows, and self-contained documentation.


🏗️ Architecture

PAI is built on 12 foundational principles:

π Scaffolding > Model
The infrastructure matters more than any single model

π ENG / SRE
Treat AI systems like production engineering

π As Deterministic as Possible
Reduce randomness, increase reliability

π Code Before Prompts
Write code first, wrap with prompts second

π UNIX Philosophy
Small, composable tools that do one thing well

π CLI as Interface
Command line is the primary interaction layer

π Goal → Code → CLI → Prompts → Agent
The implementation hierarchy

π Spec / Test / Evals First
Define success before building

π Meta / Self Updates
The system improves itself

π Custom Skill Management
3-tier architecture, routing, workflows, tools

π History
Automatic documentation of all work

π Custom Agent Personalities / Voices
Specialized agents for different tasks

Complete architecture: .claude/skills/CORE/CONSTITUTION.md

Core Systems

Skills Architecture — 3-tier progressive disclosure
Skills Architecture

Skills are self-contained containers with SKILL.md as the entry point. Workflows handle multi-step operations, tools provide CLI scripts, and docs contain reference material — all progressively loaded only when needed.

Hook System — Event-driven automation
Hook System

Hooks capture everything automatically — before tool execution, after tool execution, and on user feedback. Scripts like capture-all-events.ts and capture-session-summary.ts run invisibly to build context.

History System — Automatic documentation (UOCS)
History System

Everything is captured, nothing is lost. Session work, tool outputs, and agent results flow into the history system, producing markdown files, JSONL logs, and timestamped entries organized by date.


🛠️ Technology Stack

Category Choice Note
Runtime Bun NOT Node.js
Language TypeScript NOT Python
Package Manager Bun NOT npm/yarn/pnpm
Format Markdown NOT HTML for basic content
Testing Vitest When needed
Voice ElevenLabs TTS integration

💬 Community

Kai and I work hard to address issues and PRs throughout the week — we try not to get too far behind!

Channel Link
🐛 Issues Report bugs or request features
💬 Discussions Ask questions and share ideas
🎥 Video Watch the full PAI walkthrough
📝 Blog The Real Internet of Things

📝 Updates

v0.9.0 (2025-12-01) — Platform Agnostic Release

This release focuses on making PAI fully portable and fork-friendly. Your AI, your identity, your system.

Observability Dashboard

  • Complete real-time agent monitoring at .claude/Observability/
  • WebSocket streaming of all agent activity
  • Live pulse charts, event timelines, and swim lanes
  • Multiple themes (Tokyo Night, Nord, Catppuccin, etc.)
  • Security obfuscation for sensitive data

Genericized Agent Identity

  • All agent references now use process.env.DA || 'main'
  • No more hardcoded names — your DA name flows through the entire system
  • Observability dashboard shows your configured identity

Platform-Agnostic Configuration

  • Clear separation: settings.json for identity/paths, .env for API keys
  • DA (Digital Assistant name) — your AI's identity
  • PAI_DIR — root directory for all configuration
  • TIME_ZONE — configurable timezone for timestamps

Skill System Improvements

  • Canonical TitleCase file naming throughout
  • Standardized skill-workflow-notification script for dashboard detection
  • All paths use ${PAI_DIR}/ for location-agnostic installation
v0.8.0 (2025-11-25) — Research & Documentation

Research Skill

  • Comprehensive research skill with 10 specialized workflows
  • Multi-source research with parallel agent execution
  • Fabric pattern integration (242+ AI patterns)

Infrastructure

  • Path standardization using ${PAI_DIR}/ throughout
  • PAI_CONTRACT.md defining core guarantees
  • Self-test validation system for health checks
  • Protection system for PAI-specific files
v0.7.0 (2025-11-20) — Protection & Clarity

PAI Path Resolution System (#112)

  • Centralized pai-paths.ts library — single source of truth
  • Smart detection with fallback to ~/.claude
  • Updated 7 hooks to use centralized paths

PAI vs Kai Clarity (#113)

  • PAI_CONTRACT.md — official contract defining boundaries
  • Self-test system (bun ${PAI_DIR}/hooks/self-test.ts)
  • Clear README section distinguishing PAI from Kai

Protection System

  • .pai-protected.json manifest of protected files
  • validate-protected.ts script for pre-commit validation
  • Pre-commit hook template for automated checks
v0.6.5 (2025-11-18) — BrightData Integration

Four-Tier Progressive Web Scraping

  • Tier 1: WebFetch (free, built-in)
  • Tier 2: cURL with headers (free, more reliable)
  • Tier 3: Playwright (free, JavaScript rendering)
  • Tier 4: Bright Data MCP (paid, anti-bot bypass)
v0.6.0 (2025-11-15) — Major Architecture Update

Repository Restructure

  • Moved all configuration to .claude/ directory
  • Skills-as-containers architecture
  • Three-tier progressive disclosure

Skills System

  • Art skill with visual content generation
  • Story-explanation skill for narrative summaries
  • Create-skill and create-cli meta-skills

Hook System

  • Comprehensive event capture system
  • Session summary and tool output capture
  • Tab title updates

Voice Integration

  • Voice server with ElevenLabs TTS
  • Session start notifications
v0.5.0 and Earlier

v0.5.0 — Foundation

  • CORE skill as central context loader
  • Constitution defining system principles
  • CLI-First Architecture pattern
  • Initial skills: Fabric, FFUF, Alex Hormozi pitch

Pre-v0.5.0 — Early Development

  • Initial repository setup
  • Basic settings.json structure
  • Agent personality definitions
  • Foundational hook experiments

📜 License

MIT License — see LICENSE for details.


🙏 Acknowledgments

Built on Claude Code by Anthropic.

PAI is the technical foundation for Human 3.0 — a program I created to help people transform into a version of themselves that can thrive in the post-corporate world that's coming. Human 3.0 means AI-augmented humans who build and control their own AI systems.

Right now, the most sophisticated AI infrastructure exists inside corporations with massive engineering teams. PAI exists to change that. To give individuals the same scaffolding that companies spend millions building.

Your AI, knowing how you work, learning from your patterns, serving your goals — not some corporation's engagement metrics. That's what this enables.



Start clean. Start small. Build the AI infrastructure you need.


⬆ Back to Top

About

Personal AI Infrastructure for upgrading humans.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 38.0%
  • TypeScript 19.4%
  • Go 18.9%
  • Vue 10.3%
  • Svelte 4.5%
  • Shell 4.0%
  • Other 4.9%