How myicor/mypka works
Purpose and Operating Model
myPKA is a local-first, LLM-agnostic personal knowledge-assistance scaffold. Plain Markdown files are canonical; YAML frontmatter supplies structured fields and wikilinks connect entities. The repository combines an AI-team operating model, a knowledge-folder schema, and an optional local Cockpit UI. Root bootstrap and behavior contracts are ADAPTER-PROMPT.md, AGENTS.md, and Team/agent-index.md.
Human/LLM Entry Points
Users point an LLM at the repository and begin with ADAPTER-PROMPT.md; the root AGENTS.md governs shared behavior. Larry is the routing/orchestration boundary rather than an implementation runtime: Team/Larry - Orchestrator/AGENTS.md. Specialist contracts reside under Team/, while atomic procedures, multi-agent workstreams, and durable conventions are under Team Knowledge/SOPs/, Team Knowledge/Workstreams/, and Team Knowledge/Guidelines/.
Knowledge and Work-State Layer
PKM/ is the canonical personal knowledge store: structured life entities, CRM, documents, images, and dated journals. Templates define entity shape in Team Knowledge/Templates/; frontmatter conventions are centralized in Team Knowledge/Guidelines/GL-002-frontmatter-conventions.md. Raw intake enters Team Inbox/, gets normalized and filed into PKM, and research or multi-specialist artifacts go to Deliverables/. Wikilinks form the cross-document graph rather than folder hierarchy.
Multi-Agent Continuity Workflow
Larry accepts and routes requests to six role-specific agents; their contracts and durable journals are colocated in paths such as Team/Pax - Researcher/AGENTS.md and Team/Silas - Database Architect/AGENTS.md. Work spanning sessions is represented as Markdown task files progressing through Team Knowledge/tasks/open/, Team Knowledge/tasks/in-progress/, and archived outcomes. Session logs preserve operational history in Team Knowledge/session-logs/. This is a filesystem workflow, so an LLM performs transitions and follows SOPs rather than invoking a central workflow engine.
Cockpit Local Application
The bundled expansion at Expansions/mypka-cockpit/ is a local dashboard over the scaffold and SQLite mirror. Its Node server entry point is Expansions/mypka-cockpit/server/server.js; request composition and Cockpit data access are centered on server/cockpit.js and server/queries.js. The Vite/React TypeScript client starts at web/src/main.tsx and web/src/App.tsx, routing to views for dashboard, planner, documents, journal, graph/connections, workbench, and domain modules. Authentication is local PIN/session-oriented via server/auth.js and web/src/components/AuthGate.tsx.
Storage, Planner, and Content Boundaries
Markdown remains authoritative. SQLite is a regenerable read/lookup layer defined by Expansions/mypka-cockpit/sqlite-extension/schema/ and populated by scripts/regen-mypka-db.py; Cockpit database migrations live in server/migrations/. The planner is a distinct persisted subsystem with API/database boundaries at server/plannerRoutes.js and server/plannerDb.js, consumed by planner UI/API logic under web/src/lib/plannerApi.ts and web/src/views/PlannerView.tsx. File-backed Markdown operations, document views, journal feeds, graph extraction, and workbench editing are exposed through dedicated server modules such as server/documentsApi.js, server/journalFeed.js, server/graph.js, and server/workbench.js.
Integrations and Extensibility
Expansion packs are installed alongside the Cockpit under Expansions/, governed by Expansions/docs/expansion-spec.md and Team Knowledge/Workstreams/WS-003-install-an-expansion.md. Cockpit connectors isolate external task/calendar/mail providers through server/connectors/registry.js, with implementations for ClickUp, Todoist, iCal, and IMAP. Credential/environment handling is separated in server/connectors/env.js; external embed retrieval is implemented by scripts/fetch-embed.mjs. The primary runtime stack is local Node.js for server/scripts, React/Vite/TypeScript for the UI, Python for migration/generation utilities, and SQLite for the optional mirror and Cockpit state.
Main entry points: PKM PKM Markdown Store · Pax - Researcher/AGENTS.md Specialist Agents · server.js Cockpit Node Server · Larry - Orchestrator/AGENTS.md Larry Orchestrator
Components 21
AI Team Operating Model
Markdown contracts direct LLM-led work.
- Adapter Prompt · Starting instructions for users and LLMs.
ADAPTER-PROMPT.md - Shared Agent Rules
AGENTS.md - Larry Orchestrator · Routes requests without being a runtime service.
Team/Larry - Orchestrator/AGENTS.md - Specialist Agents · Six role-specific agents with durable journals.
Team/Pax - Researcher/AGENTS.md - SOPs & Workstreams · Atomic procedures, conventions, and multi-agent work.
Team Knowledge/SOPs
Knowledge Workflow
Filesystem-based knowledge and work state.
- Team Inbox
Team Inbox - PKM Markdown Store · Authoritative structured entities, documents, media, and journals.
PKM - Entity Templates
Team Knowledge/Templates - Frontmatter Conventions
Team Knowledge/Guidelines/GL-002-frontmatter-conventions.md - Task State Files · Markdown tasks move from open through in-progress to archived outcomes.
Team Knowledge/tasks/open - Session Logs
Team Knowledge/session-logs - Deliverables
Deliverables
Cockpit Application
Optional local dashboard and APIs.
- Cockpit Node Server · Local server entry point and request host.
Expansions/mypka-cockpit/server/server.js - Cockpit Content APIs · Document, journal, graph, and workbench filesystem operations.
Expansions/mypka-cockpit/server/cockpit.js - Local PIN Auth
Expansions/mypka-cockpit/server/auth.js - React Cockpit UI · Dashboard and domain views, including documents, journal, graph, and workbench.
Expansions/mypka-cockpit/web/src/App.tsx
Storage & Planner
Canonical Markdown plus regenerable local state.
- SQLite Mirror · Derived Markdown mirror plus Cockpit state.
Expansions/mypka-cockpit/sqlite-extension/schema - Persisted Planner · Separate planner persistence boundary.
Expansions/mypka-cockpit/server/plannerRoutes.js - Planner UI API
Expansions/mypka-cockpit/web/src/lib/plannerApi.ts
Integrations & Extensions
Optional packs and external-provider connectors.
- Provider Connectors · ClickUp, Todoist, iCal, and IMAP adapters.
Expansions/mypka-cockpit/server/connectors/registry.js - Expansion Specification
Expansions/docs/expansion-spec.md
Connections 22
- Adapter Prompt → Shared Agent Rules: loads
- Shared Agent Rules → Larry Orchestrator: governs
- Larry Orchestrator → Specialist Agents: routes work to
- Specialist Agents → SOPs & Workstreams: follow
- Larry Orchestrator → Task State Files: advances
- Specialist Agents → Session Logs: record sessions
- Team Inbox → PKM Markdown Store: normalized and filed
- Entity Templates → PKM Markdown Store: defines entity shape
- Frontmatter Conventions → PKM Markdown Store: standardizes metadata
- Specialist Agents → Deliverables: produce
- SOPs & Workstreams → Task State Files: guides transitions
- Cockpit Node Server → Cockpit Content APIs: hosts
- Cockpit Node Server → Local PIN Auth: enforces
- React Cockpit UI → Cockpit Node Server: local requests
- Cockpit Content APIs → PKM Markdown Store: reads and edits
- Cockpit Content APIs → SQLite Mirror: queries
- PKM Markdown Store → SQLite Mirror: regenerated into
- Planner UI API → Persisted Planner: uses
- React Cockpit UI → Planner UI API: renders planner
- Persisted Planner → SQLite Mirror: persists locally
- Cockpit Node Server → Provider Connectors: loads
- Expansion Specification → Provider Connectors: governs extension shape