feat(prompt): OKF-inspired cross-links + tags for agent memory#54
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.rscollect_files→WorkspaceFilePreviewPanel.tsx), never parsed. So OKF's core machinery (requiredtype, 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.mdcatalog, and a date-groupedjournal/(≈ OKF'slog.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):.clai/memory/, so memory forms a navigable graph instead of disconnected notes.tags— optional cross-cutting frontmatter labels so related heuristics stay retrievable asknowledge.mdgrows.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_automationsextended to assert the new conventions are present without disturbing the existing memory assertions.cargo test --lib: 613 passed.cargo fmt --check,cargo clippy --lib --testsclean.