Skip to content

Agentic System (PAI)

active

Multi-agent AI infrastructure where autonomous agents coordinate tasks, manage knowledge, and execute work across a distributed homelab.

TypeScript Bun Claude API MCP systemd Tailscale Obsidian

PAI (Personal AI Infrastructure) is a system of autonomous AI agents that coordinate work, manage knowledge, and execute tasks across my homelab. It’s the connective tissue between everything I build.

For a non-technical overview of how this system fits into my daily life, check the AI Infrastructure page.

Architecture

                    ┌─────────────┐
                    │  Zarq Board │  (task coordination)
                    │  Bun + TS   │
                    └──────┬──────┘

            ┌──────────────┼──────────────┐
            │              │              │
     ┌──────┴──────┐ ┌────┴─────┐ ┌──────┴──────┐
     │    Zarq     │ │   Ping   │ │  Maverick   │
     │ Claude Code │ │ Telegram │ │  OpenCode   │
     │  X1 Carbon  │ │ X1 Carbon│ │  Legion     │
     └──────┬──────┘ └────┬─────┘ └─────────────┘
            │              │
     ┌──────┴──────────────┴──────┐
     │       Agent-PKM            │
     │  (knowledge base sync)     │
     │    JSONL / YAML / MD       │
     └────────────┬───────────────┘

     ┌────────────┴───────────────┐
     │      Obsidian Vault        │
     │   (PARA method, 5+ years)  │
     └────────────────────────────┘

Agent Roster

AgentPlatformHostStatus
ZarqClaude CodeX1 CarbonActive
Pinggrammy (Telegram)X1 CarbonActive
MaverickOpenCodeLegionActive
PongTBDLegion WSL2Gated
NeoTBDMobileGated
ScripterOpenClawRetiredArchived (Mar 2026)

Key Technical Decisions

Task isolation via git worktrees. When an agent picks up a task, it creates a worktree with its own branch. This prevents conflicts when multiple agents work on the same codebase. The worktree gets merged back to main and cleaned up when the task is done.

Shared context via filesystem. Agents share state through a common directory (shared-ai-context/). It contains a task board JSON, activity logs, and a current-state summary. Each agent reads this at session start. Simple, debuggable, no database needed.

LLM fallback chain. API calls go through a priority chain: Anthropic, then OpenRouter, then Groq, then local Ollama. If one provider is down or credits are low, the next one picks up automatically.

systemd user services. All long-running agents run as systemd user services. Auto-restart on crash, logs via journalctl, starts on boot. The service files live in each project repo.

Services

ServiceDescriptionRuntime
zarq-boardTask coordination APIBun + TypeScript
zarq-watcherBoard event watcherBun + TypeScript
pingTelegram botBun + grammy
agent-pkm-syncVault to agent knowledge syncBun + TypeScript
pkm-watcherVault file change detectorPython + watchdog

What I Learned

Building PAI taught me that agent coordination is harder than agent capability. Making one agent smart is straightforward. Making three agents work on different things without stepping on each other, sharing context without flooding each other, and recovering gracefully when one goes offline. That’s the real problem.

The simplest solutions won. File-based shared state beats a database. Git worktrees beat branch switching. systemd beats custom process managers. Every time I tried to add complexity, I ended up reverting to the simpler approach.