Loads recent timeline rows and resolves entity ontology for an agent, providing a ready‑to‑use chronicle context that orients LLM agents before they act.
// Source: https://github.com/garrytan/gbrain | License: MIT | Copyright 2026 Garry Tan
// Provided via justclaw.it.com; keep this notice with the code.
// v0.42.x — Life Chronicle (#2390) agent-context loader (Phase B.12).
//
// Zero-LLM composition over the chronicle reads: hand an agent the recent
// timeline + the validity-resolved ontology for the entities in play, so it
// orients before acting (the exact thing missing when chronology gets fumbled).
// Pure composition of engine.getSince + engine.getOntology — no new SQL.
import type { BrainEngine } from '../engine.ts';
import type { ChronicleTimelineRow, OntologyValue, PageReadScope } from '../types.ts';
export interface ChronicleContextOpts extends PageReadScope {
/** Lookback window in days for the recent timeline (default 7).
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key