Enterprise-grade AI Agent system for code generation, analysis, and orchestration
22
stars
807
commits
TypeScript
primary language
Aug 19, 2026
updated
Enterprise-grade AI coding agent system with modular architecture.
Pi Agent is an autonomous AI orchestrator for software development — a monorepo containing the agent core, a multi-channel gateway, 40+ skills, 30+ extensions, and 20+ specialized subagents.
pi CLI installed)# Install Bun
powershell -c "irm bun.sh/install.ps1 | iex"
# Restart terminal after Bun installation
# Option 1: Clone with submodules
git clone --recurse-submodules <repo-url> ~/.pi/agent
# Option 2: If already cloned, initialize submodules
git submodule init
git submodule update --init --recursive
# Install dependencies for all extensions with package.json
cd extensions/pi-context && bun i
cd ../pi-files && bun i
cd ../pi-interactive-shell && bun i
cd ../pi-messenger && bun i
cd ../pi-subagents && bun i
# Use workflow commands in any project
/scout authentication flow # Fast code reconnaissance
/analyze database schema # Deep analysis
/brainstorm caching strategy # Design exploration
# Start the multi-channel gateway
cd ~/.pi/agent/pi-gateway && bun install && bun run start
~/.pi/agent/
├── pi-gateway/ # Multi-channel AI gateway (Telegram/Discord/WebChat)
├── extensions/ # Runtime extensions (30 modules)
│ ├── pi-interactive-shell/ # Interactive CLI overlay (vim, psql, ssh)
│ ├── pi-subagents/ # Multi-agent chains & parallel execution
│ ├── plan-mode/ # Read-only planning with command interception
│ ├── role-persona/ # Per-role memory & personality isolation
│ ├── games/ # Mini-games (Snake, Tetris, 2048, Minesweeper)
│ ├── answer.ts # Interactive Q&A TUI (Ctrl+.)
│ ├── workflow-commands.ts # /scout, /analyze, /brainstorm, /research
│ ├── safety-gates.ts # Destructive operation interception
│ └── ...
├── skills/ # Prompt-injectable capabilities (40 modules)
│ ├── ace-tool/ # Semantic code search (AugmentCode MCP)
│ ├── web-browser/ # Chromium automation (CDP)
│ ├── tmux/ # Remote terminal session control
│ ├── workhub/ # Issue/PR documentation management
│ ├── office-combo/ # Excel, PPT, PDF, Word support
│ └── ...
├── agents/ # Subagent definitions (20+ markdown specs)
├── prompts/ # Workflow templates (init, handoff, implement, etc.)
├── roles/ # Role-based persona configurations
├── commands/ # Slash command definitions (/scout, /analyze, etc.)
├── messenger/ # Inter-agent session registry & event feed
├── landing-page/ # Marketing site (Vite + Lit + Tailwind)
├── docs/ # System protocols, guides, knowledge base
├── APPEND_SYSTEM.md # Agent system prompt
├── settings.json # Agent runtime settings
├── models.json # Model provider configurations
└── auth.json # Authentication credentials
Single-port HTTP+WebSocket gateway that routes messages from Telegram, Discord, and WebChat into isolated pi agent RPC processes.
cd pi-gateway
bun install
bun run start # Start gateway (default port 18800)
bun run dev # Start with hot-reload
bun run src/cli.ts doctor # Health check
bun run src/cli.ts config show # Show current config
Key capabilities:
agent:{agentId}:{channel}:{scope}:{id} key format with role mapping/v1/chat/completions endpointpi-gateway.jsonc with JSON5 support, deep merge, hot-reloadRuntime hooks that enhance the agent's UI, commands, and behavior. → Details
| Extension | Description |
|---|---|
pi-interactive-shell/ | Run interactive CLIs (vim, psql, ssh) in TUI overlay — interactive/hands-free/dispatch modes |
pi-subagents/ | Multi-agent orchestration: chains, parallel execution, skill injection, async support |
plan-mode/ | Read-only planning mode with 40+ dangerous command interception |
role-persona/ | Per-role isolated memory, personality, workspace context |
games/ | Game framework: Snake, Tetris, 2048, Minesweeper, Breakout, Pong |
answer.ts | Interactive Q&A TUI (Ctrl+.) |
qna.ts | Editor Q&A extraction (Ctrl+,) |
continue.ts | Quick continue dialog (Ctrl+Option+C) |
handoff.ts | Context handoff to new session |
git-commit.ts | Auto git commit with message generation |
workflow-commands.ts | /scout, /analyze, /brainstorm, /research commands |
safety-gates.ts | Safety checks before destructive operations |
knowledge-builder/ | Knowledge base construction |
token-rate.ts | Token usage rate tracking |
Prompt-injectable capabilities — each skill is a SKILL.md file injected into the agent's system prompt at runtime.
| Category | Skill | Description |
|---|---|---|
| Code Search | ace-tool | Semantic fuzzy search via AugmentCode MCP |
ast-grep | AST-aware code search and rewrite | |
codemap | Code flow visualization and mapping | |
| Documentation | workhub | Issue/PR documentation management |
deepwiki | GitHub repository documentation & Q&A | |
context7 | Library documentation retrieval | |
knowledge-base | Knowledge management system | |
| Web & Search | tavily-search-free | Real-time web search |
exa | High-quality web search | |
web-browser | Chromium automation (navigation, forms, network, PDF) | |
| Dev Tools | tmux | Remote terminal session control (CLI/TUI modes) |
project-planner | Project planning & documentation | |
system-design | Architecture design (EventStorming) | |
coding-runner | Code execution sandbox | |
| Generators | office-combo | Excel, PPT, PDF, Word support |
har-to-vue | Convert HAR network captures to Vue code | |
svg-logo-generator | Generate SVG logos | |
mcp-to-skill | Wrap any MCP server as a pi skill | |
| Best Practices | react-best-practices | React patterns and conventions |
vue-best-practices | Vue patterns and conventions | |
vercel-design | Vercel design system patterns |
Specialized subagents defined as markdown files with YAML frontmatter. → Examples
| Agent | Mode | Purpose |
|---|---|---|
scout | READ-ONLY | Fast code reconnaissance via semantic search + grep |
planner | PLANNING | 5-phase task planning (discovery → design → review → plan → approval) |
worker | STANDARD | Full-capability implementation with TODO enforcement |
reviewer | READ-ONLY | Code quality & security analysis via git diff |
brainstormer | STANDARD | Design exploration and ideation |
vision | STANDARD | Multimodal analysis (images, video, PDF, UI/UX, diagrams) |
security-reviewer | READ-ONLY | Security audit |
simplifier | STANDARD | Code simplification |
system-design | STANDARD | Architecture design |
Inter-agent session registry and event feed for multi-agent coordination.
messenger/registry/ — JSON metadata per agent (PID, session, model, activity)messenger/feed.jsonl — JSONL event log (messages, test results, agent activities)messenger/inbox/ — Per-agent message directoriesRole-based persona system mapping project paths to agent identities.
roles/config.json — Path-to-role mapping (e.g., ~/.pi/agent → "zero")roles/default/ — Default role configurationrole-persona extension)graph LR
A[Phase 1: Context Retrieval] --> B[Phase 2: Analysis]
B --> C[Phase 3: Prototyping]
C --> D[Phase 4: Implementation]
D --> E[Phase 5: Audit]
| Phase | Status | Tools | Output |
|---|---|---|---|
| 1. Context Retrieval | Mandatory | ace-tool, ast-grep, rg | Complete code definitions |
| 2. Analysis & Planning | Complex tasks | Gemini | Step-by-step plan + pseudocode |
| 3. Prototyping | Mandatory | Gemini → Unified Diff | Diff only, no file writes |
| 4. Implementation | Mandatory | Claude | Production code, minimal scope |
| 5. Audit & Delivery | Mandatory | Codex/Gemini | Reviewed, delivered |
| Command | Agent | Purpose |
|---|---|---|
/scout <query> | scout | Fast code reconnaissance |
/analyze <topic> | worker | Deep code analysis |
/brainstorm <idea> | brainstormer | Design exploration |
/research <topic> | multi-tool | Parallel research |
| File | Purpose |
|---|---|
APPEND_SYSTEM.md | Agent system prompt (instructions & protocols) |
settings.json | Runtime settings (provider, thinking level, packages, extensions) |
models.json | Model provider configurations |
auth.json | Authentication credentials |
roles/config.json | Role-to-path mapping |
pi-gateway/pi-gateway.jsonc | Gateway config (port, channels, plugins, cron) |
MIT
806 commits
1 commits
TypeScript
80.8%
JavaScript
7.9%
HTML
5.8%
Python
2.7%
CSS
1.3%
Shell
1.2%
Enterprise-grade AI Agent system for code generation, analysis, and orchestration
22
stars
807
commits
TypeScript
primary language
Aug 19, 2026
updated
Enterprise-grade AI coding agent system with modular architecture.
Pi Agent is an autonomous AI orchestrator for software development — a monorepo containing the agent core, a multi-channel gateway, 40+ skills, 30+ extensions, and 20+ specialized subagents.
pi CLI installed)# Install Bun
powershell -c "irm bun.sh/install.ps1 | iex"
# Restart terminal after Bun installation
# Option 1: Clone with submodules
git clone --recurse-submodules <repo-url> ~/.pi/agent
# Option 2: If already cloned, initialize submodules
git submodule init
git submodule update --init --recursive
# Install dependencies for all extensions with package.json
cd extensions/pi-context && bun i
cd ../pi-files && bun i
cd ../pi-interactive-shell && bun i
cd ../pi-messenger && bun i
cd ../pi-subagents && bun i
# Use workflow commands in any project
/scout authentication flow # Fast code reconnaissance
/analyze database schema # Deep analysis
/brainstorm caching strategy # Design exploration
# Start the multi-channel gateway
cd ~/.pi/agent/pi-gateway && bun install && bun run start
~/.pi/agent/
├── pi-gateway/ # Multi-channel AI gateway (Telegram/Discord/WebChat)
├── extensions/ # Runtime extensions (30 modules)
│ ├── pi-interactive-shell/ # Interactive CLI overlay (vim, psql, ssh)
│ ├── pi-subagents/ # Multi-agent chains & parallel execution
│ ├── plan-mode/ # Read-only planning with command interception
│ ├── role-persona/ # Per-role memory & personality isolation
│ ├── games/ # Mini-games (Snake, Tetris, 2048, Minesweeper)
│ ├── answer.ts # Interactive Q&A TUI (Ctrl+.)
│ ├── workflow-commands.ts # /scout, /analyze, /brainstorm, /research
│ ├── safety-gates.ts # Destructive operation interception
│ └── ...
├── skills/ # Prompt-injectable capabilities (40 modules)
│ ├── ace-tool/ # Semantic code search (AugmentCode MCP)
│ ├── web-browser/ # Chromium automation (CDP)
│ ├── tmux/ # Remote terminal session control
│ ├── workhub/ # Issue/PR documentation management
│ ├── office-combo/ # Excel, PPT, PDF, Word support
│ └── ...
├── agents/ # Subagent definitions (20+ markdown specs)
├── prompts/ # Workflow templates (init, handoff, implement, etc.)
├── roles/ # Role-based persona configurations
├── commands/ # Slash command definitions (/scout, /analyze, etc.)
├── messenger/ # Inter-agent session registry & event feed
├── landing-page/ # Marketing site (Vite + Lit + Tailwind)
├── docs/ # System protocols, guides, knowledge base
├── APPEND_SYSTEM.md # Agent system prompt
├── settings.json # Agent runtime settings
├── models.json # Model provider configurations
└── auth.json # Authentication credentials
Single-port HTTP+WebSocket gateway that routes messages from Telegram, Discord, and WebChat into isolated pi agent RPC processes.
cd pi-gateway
bun install
bun run start # Start gateway (default port 18800)
bun run dev # Start with hot-reload
bun run src/cli.ts doctor # Health check
bun run src/cli.ts config show # Show current config
Key capabilities:
agent:{agentId}:{channel}:{scope}:{id} key format with role mapping/v1/chat/completions endpointpi-gateway.jsonc with JSON5 support, deep merge, hot-reloadRuntime hooks that enhance the agent's UI, commands, and behavior. → Details
| Extension | Description |
|---|---|
pi-interactive-shell/ | Run interactive CLIs (vim, psql, ssh) in TUI overlay — interactive/hands-free/dispatch modes |
pi-subagents/ | Multi-agent orchestration: chains, parallel execution, skill injection, async support |
plan-mode/ | Read-only planning mode with 40+ dangerous command interception |
role-persona/ | Per-role isolated memory, personality, workspace context |
games/ | Game framework: Snake, Tetris, 2048, Minesweeper, Breakout, Pong |
answer.ts | Interactive Q&A TUI (Ctrl+.) |
qna.ts | Editor Q&A extraction (Ctrl+,) |
continue.ts | Quick continue dialog (Ctrl+Option+C) |
handoff.ts | Context handoff to new session |
git-commit.ts | Auto git commit with message generation |
workflow-commands.ts | /scout, /analyze, /brainstorm, /research commands |
safety-gates.ts | Safety checks before destructive operations |
knowledge-builder/ | Knowledge base construction |
token-rate.ts | Token usage rate tracking |
Prompt-injectable capabilities — each skill is a SKILL.md file injected into the agent's system prompt at runtime.
| Category | Skill | Description |
|---|---|---|
| Code Search | ace-tool | Semantic fuzzy search via AugmentCode MCP |
ast-grep | AST-aware code search and rewrite | |
codemap | Code flow visualization and mapping | |
| Documentation | workhub | Issue/PR documentation management |
deepwiki | GitHub repository documentation & Q&A | |
context7 | Library documentation retrieval | |
knowledge-base | Knowledge management system | |
| Web & Search | tavily-search-free | Real-time web search |
exa | High-quality web search | |
web-browser | Chromium automation (navigation, forms, network, PDF) | |
| Dev Tools | tmux | Remote terminal session control (CLI/TUI modes) |
project-planner | Project planning & documentation | |
system-design | Architecture design (EventStorming) | |
coding-runner | Code execution sandbox | |
| Generators | office-combo | Excel, PPT, PDF, Word support |
har-to-vue | Convert HAR network captures to Vue code | |
svg-logo-generator | Generate SVG logos | |
mcp-to-skill | Wrap any MCP server as a pi skill | |
| Best Practices | react-best-practices | React patterns and conventions |
vue-best-practices | Vue patterns and conventions | |
vercel-design | Vercel design system patterns |
Specialized subagents defined as markdown files with YAML frontmatter. → Examples
| Agent | Mode | Purpose |
|---|---|---|
scout | READ-ONLY | Fast code reconnaissance via semantic search + grep |
planner | PLANNING | 5-phase task planning (discovery → design → review → plan → approval) |
worker | STANDARD | Full-capability implementation with TODO enforcement |
reviewer | READ-ONLY | Code quality & security analysis via git diff |
brainstormer | STANDARD | Design exploration and ideation |
vision | STANDARD | Multimodal analysis (images, video, PDF, UI/UX, diagrams) |
security-reviewer | READ-ONLY | Security audit |
simplifier | STANDARD | Code simplification |
system-design | STANDARD | Architecture design |
Inter-agent session registry and event feed for multi-agent coordination.
messenger/registry/ — JSON metadata per agent (PID, session, model, activity)messenger/feed.jsonl — JSONL event log (messages, test results, agent activities)messenger/inbox/ — Per-agent message directoriesRole-based persona system mapping project paths to agent identities.
roles/config.json — Path-to-role mapping (e.g., ~/.pi/agent → "zero")roles/default/ — Default role configurationrole-persona extension)graph LR
A[Phase 1: Context Retrieval] --> B[Phase 2: Analysis]
B --> C[Phase 3: Prototyping]
C --> D[Phase 4: Implementation]
D --> E[Phase 5: Audit]
| Phase | Status | Tools | Output |
|---|---|---|---|
| 1. Context Retrieval | Mandatory | ace-tool, ast-grep, rg | Complete code definitions |
| 2. Analysis & Planning | Complex tasks | Gemini | Step-by-step plan + pseudocode |
| 3. Prototyping | Mandatory | Gemini → Unified Diff | Diff only, no file writes |
| 4. Implementation | Mandatory | Claude | Production code, minimal scope |
| 5. Audit & Delivery | Mandatory | Codex/Gemini | Reviewed, delivered |
| Command | Agent | Purpose |
|---|---|---|
/scout <query> | scout | Fast code reconnaissance |
/analyze <topic> | worker | Deep code analysis |
/brainstorm <idea> | brainstormer | Design exploration |
/research <topic> | multi-tool | Parallel research |
| File | Purpose |
|---|---|
APPEND_SYSTEM.md | Agent system prompt (instructions & protocols) |
settings.json | Runtime settings (provider, thinking level, packages, extensions) |
models.json | Model provider configurations |
auth.json | Authentication credentials |
roles/config.json | Role-to-path mapping |
pi-gateway/pi-gateway.jsonc | Gateway config (port, channels, plugins, cron) |
MIT
806 commits
1 commits
TypeScript
80.8%
JavaScript
7.9%
HTML
5.8%
Python
2.7%
CSS
1.3%
Shell
1.2%