Cortex AI - cognitive primitives for LLM agents
Theory-of-Mind forgetting curves
What does the user still remember? Each item has a stability that grows logarithmically with exposure count and linearly with reinforcement, then decays as R(t) = exp(-t / S). The plot extends each curve from now to the horizon. Use it to decide when to re-surface a fact before it falls below useful recall.
Formula and parameters ported from src/relevance/tom/forgetting-curve.ts in the cortex-ai repo.
Items to project
auth/refresh-rotation algorithm | 0.3 | 12 | 1 |
Current state and decay thresholds
Negative-space retrieval
Given the entities currently active in your context, surfaces other entities that historically co-occur with them but are absent right now. Each finding's significance weights raw co-occurrence by recency, so a 30-day-stale partner is suppressed but a fresh absence is loud.
Algorithm ported from src/relevance/negative-space/absence-detector.ts. The co-occurrence table and last-seen ledger here are curated stand-ins for what the live cortex-ai SQLite database would hold for your machine.
Ghost findings (entities that should be present)
Hippocampal consolidation
Compresses a stream of fine-grained episodes into a smaller set of semantic capsules. Each capsule keeps the TF-IDF spine (tags + verbatim spine sentences) of the episodes it groups, so downstream agents read a few capsules instead of dozens of episodes.
TF-IDF distillation ported from src/relevance/consolidation/distiller.ts. Clustering uses scikit-learn agglomerative clustering on cosine distance.
Episodic events (git, shell, browser, calendar, screen)
2026-05-26 09:14 | calendar | Wire refresh-token endpoint to verify against the new public key. Update OAuth callback handler. |
2026-05-26 09:14 | git | Refactor JWT validation to use the new asymmetric key rotation. Old HMAC path deprecated. |
2026-05-26 11:02 | shell | Generate ed25519 signing key pair via openssl genpkey; store private key in secrets manager. |
2026-05-26 14:45 | git | Wire refresh-token endpoint to verify against the new public key. Update OAuth callback handler. |
2026-05-27 08:30 | git | Add JWKS endpoint to expose the public key with kid headers for client validation. |
2026-05-27 16:12 | browser | Reviewed RFC 7517 JSON Web Key Set spec for kid header conventions and rotation semantics. |
2026-05-28 10:00 | git | Create migration 0042 adding orders.status column with NOT NULL default and backfill plan. |
2026-05-28 11:30 | shell | Test migration on dev replica with EXPLAIN ANALYZE; lock waits acceptable under load. |
2026-05-28 13:45 | git | Add rollback procedure for migration 0042 including data preservation steps. |
2026-05-29 09:00 | calendar | Migration deployment review meeting with database team to walk through 0042 rollout. |
2026-05-29 14:00 | git | Introduce React Suspense boundaries around the dashboard panels to enable streaming SSR. |
2026-05-29 16:30 | browser | Read Next.js streaming SSR documentation regarding hydration mismatch warnings. |
2026-05-30 10:00 | git | Lazy load the analytics module with React.lazy to reduce initial bundle by 240KB. |
2026-05-30 13:00 | shell | Run lighthouse audit; LCP improved from 3.1s to 1.8s after lazy loading and Suspense. |
Capsule index