🧠
🟒 LIVE Cloudflare Durable Objects

p31-cortex

AI Agent Orchestration

The limbic system of the P31 mesh. Six autonomous agents β€” benefits, finance, grant, legal, content, and kofi β€” run as Cloudflare Durable Objects with D1 SQLite persistence. Cortex provides proactive decision support without requiring operator availability.

01. Architecture

Each agent is a Cloudflare Durable Object β€” stateful, addressable, persistent. The Orchestrator DO coordinates multi-agent workflows; individual agents own their own state and lifecycle.

BenefitsAgent
Tracks benefit programs, deadlines, eligibility windows
FinanceAgent
Budget tracking, expense categorisation, cashflow alerts
GrantAgent
ARPA-H, ESG, and other funding deadlines + draft assistance
LegalAgent
501(c)(3) compliance requirements, legal deadline surfacing
ContentAgent
Drafts social posts for Kenosis dispatch pipeline
KofiAgent
Processes Ko-fi webhooks, classifies contributions, fires telemetry
  • β–Έ BaseAgent class β€” common lifecycle: wake, process, sleep. Each agent extends BaseAgent and overrides the process method.
  • β–Έ D1 SQLite database β€” 0001_initial.sql schema + 0002_seed_legal_deadlines.sql pre-loads critical compliance dates at deploy time.
  • β–Έ Orchestrator DO β€” coordinates multi-agent workflows, manages agent wake/sleep scheduling, routes inter-agent messages.
  • β–Έ Discord notification pipeline β€” src/notify/discord.ts routes agent outputs to Discord channels via webhook.
  • β–Έ Structured telemetry β€” all agents emit structured telemetry events consumed by Genesis Gate's governance pipeline.

02. Operational Role

Cortex is the "limbic system" of the P31 mesh β€” the layer that handles autonomic functions so the operator's cognitive bandwidth is reserved for higher-order decisions. It does not require the operator to be present or even aware of routine operations.

GRANT PIPELINE β€” APRIL 13, 2026

ESG grant window opens April 13, 2026. GrantAgent has this deadline pre-seeded in D1. It will surface preparation requirements, draft summaries, and alert via Discord as the date approaches β€” without operator prompting.

LegalAgent surfaces 501(c)(3) compliance requirements proactively β€” annual report deadlines, state registration renewals, and IRS filing windows are pre-loaded from 0002_seed_legal_deadlines.sql.

ContentAgent drafts social content for the Kenosis dispatch pipeline. The content does not post directly β€” it enters the Kenosis mesh where it is subject to governance hook clearance before dispatch.

Deployment
Status 🟒 LIVE
Platform CF Durable Objects
Database D1 SQLite
Agents 6 active
Tech Stack
CF Durable Objects D1 SQLite AI Bindings TypeScript Wrangler