Skip to content

feat(prompt): OKF-inspired cross-links + tags for agent memory#54

Merged
juacker merged 1 commit into
mainfrom
feat/memory-okf-crosslinks-tags
Jun 14, 2026
Merged

feat(prompt): OKF-inspired cross-links + tags for agent memory#54
juacker merged 1 commit into
mainfrom
feat/memory-okf-crosslinks-tags

Conversation

@juacker

@juacker juacker commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Context

Investigated whether Google's Open Knowledge Format (OKF v0.1, GoogleCloudPlatform/knowledge-catalog) can improve CLAI's agent-memory handling.

Finding: OKF is a data-catalog interchange format (concepts describing data assets, exchanged across orgs, consumed programmatically by agents) — not an agent-memory architecture. CLAI's memory is a per-workspace, single-producer, temporal scratchpad that is prompt-fed and rendered as a flat markdown file list (workspace.rs collect_filesWorkspaceFilePreviewPanel.tsx), never parsed. So OKF's core machinery (required type, schema conformance, graph traversal, cross-org bundles) buys CLAI nothing today, and OKF is strictly less expressive on the axes that matter for an agent that learns: it has no belief-confidence and no cognitive layering.

The striking part is the convergence: CLAI already uses markdown + YAML frontmatter, an index.md catalog, and a date-grouped journal/ (≈ OKF's log.md). Evidence CLAI got the format right — not a reason to adopt OKF wholesale.

Change (narrow, additive — prompt only)

Folds the two genuinely useful OKF conventions into the Agent Memory section of the system prompt (engine.rs):

  • Cross-linking — knowledge entries can link to their supporting evidence (a journal day, a checkpoint, a PR) with relative markdown links inside .clai/memory/, so memory forms a navigable graph instead of disconnected notes.
  • Broken-link tolerance — a link whose target was pruned/not-yet-written is not an error and must never block.
  • tags — optional cross-cutting frontmatter labels so related heuristics stay retrievable as knowledge.md grows.

Deliberately untouched: the three-layer cognitive model (state/knowledge/journal) and the confidence tags (hypothesis/provisional/confirmed) — both of which OKF lacks.

Not in scope

Full OKF conformance only pays off if CLAI later wants to export/share knowledge bundles across workspaces or tools. That's a separate product decision; flagged for the future, not built here.

Tests

build_system_prompt_includes_agent_memory_guidance_for_automations extended to assert the new conventions are present without disturbing the existing memory assertions.

cargo test --lib: 613 passed. cargo fmt --check, cargo clippy --lib --tests clean.

CLAI's agent memory and Google's Open Knowledge Format (OKF) already
converge on the same substrate — a directory of markdown files with YAML
frontmatter, an index.md catalog, and a date-grouped log (our journal/ ≈
OKF's log.md). OKF is a data-catalog interchange format, not a memory
architecture, so its core (per-concept 'type', schema conformance, graph
traversal, cross-org exchange) doesn't fit a per-workspace agent
scratchpad that is prompt-fed and rendered as a flat file list, never
parsed. Two of its conventions are genuinely additive, though:

- Cross-linking: knowledge entries can now link to their supporting
  evidence (a journal day, a checkpoint, a PR) with relative markdown
  links, so memory forms a navigable graph instead of disconnected notes
  — plus OKF's broken-link tolerance so a pruned target never blocks.
- tags: optional cross-cutting frontmatter labels so related heuristics
  stay retrievable as knowledge.md grows.

The three-layer cognitive model (state/knowledge/journal) and the
confidence tags (hypothesis/provisional/confirmed) — both of which OKF
lacks and which are more sophisticated for an agent that learns — are
left untouched. Prompt-only change; the memory panel still renders files
verbatim.

Test asserts the new conventions are present without disturbing the
existing memory assertions.
@juacker juacker marked this pull request as ready for review June 14, 2026 18:52
@juacker juacker merged commit 99cd2c1 into main Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant