Skip to content

Instantly share code, notes, and snippets.

@andrialexandrou
Created June 30, 2026 18:20
Show Gist options
  • Select an option

  • Save andrialexandrou/17ff7723291ff35832a542a381b21bfe to your computer and use it in GitHub Desktop.

Select an option

Save andrialexandrou/17ff7723291ff35832a542a381b21bfe to your computer and use it in GitHub Desktop.
Knowledge Docs — Prior Art & Industry Reading (Rhapsody hypothesis validation)

Knowledge Docs — Prior Art & Industry Reading

Research context: validating the "persistent knowledge docs" hypothesis from the Rhapsody experiment. The question is whether a persistent, agent-readable knowledge artifact can serve four use cases: backfill, active authoring, self-healing, and team process encoding.


The Four Fronts

  1. Backfill — bootstrapping docs from existing code/history (what's already true but undocumented)
  2. Active authoring — agents writing knowledge as they work (decisions, conventions, architecture)
  3. Self-healing — detecting and correcting drift when docs become stale
  4. Team processes — encoding "how we work" (reviewers, channels, rituals) as agent-readable knowledge

Key Reads

Context Engineering (foundational framing)

Anthropic — Effective Context Engineering for AI Agents https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents

Defines context engineering as curating what goes into the context window each inference. Frames the shift from "write a good prompt" to "build a system that assembles the right context dynamically."

Simon Willison — Context Engineering https://simonwillison.net/2025/Jun/27/context-engineering/

Shorter take on the same shift. Compares it to deciding which sticky notes to leave on a junior dev's desk — and when to clear the desk so only actionable context remains.


Formats & Specifications

Google Cloud — Open Knowledge Format (OKF) v0.1 Spec https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf

Vendor-neutral, open spec (June 2026). A knowledge bundle is a directory of Markdown files. Each file encodes one concept, with YAML frontmatter (type is the only required field). Apache 2.0. Minimal contract — deliberately doesn't enforce tooling or schema registries.

Relevant because: this is what "knowledge docs as an open format" looks like when someone standardizes it.

Codified Context: Infrastructure for AI Agents in a Complex Codebase https://arxiv.org/html/2602.20478v1

Academic paper arguing that single-file manifests (AGENTS.md) don't scale. Proposes tiered infrastructure: hot memory (conventions, hooks), domain-expert agents, cold memory (knowledge base with dozens of persistent docs). Introduces freshness/decay signals so agents know when to re-validate.

Relevant because: directly addresses the scaling problem and the self-healing question.


Self-Healing & Maintenance

Anthropic — Claude Agent "Dreaming" https://www.aitrove.ai/blog/code-with-claude-2026-dreams-routines-agents

Agents analyze prior runs between sessions, revise their own memory files (MEMORY.md), prune stale knowledge, and add new learnings. Can be auto-approved or human-supervised. This is Anthropic's answer to "how do docs stay fresh."

Anthropic — Context Management on Claude Platform https://claude.com/blog/context-management

Automatic context pruning: stale tool calls/results are removed as sessions approach token limits. Complements the dreaming approach (dreaming = between-run maintenance, pruning = within-run maintenance).

Claude Code & Agent Memory: Best Practices 2026 https://orchestrator.dev/blog/2026-04-06--claude-code-agent-memory-2026/

Documents the four-layer memory architecture:

  1. CLAUDE.md — static, human-authored truths
  2. Auto Memory (MEMORY.md) — dynamic, learned from corrections
  3. Memory Tool directory — rich persistent files
  4. Subagent Memory — per-subagent isolated stores

Relevant because: shows how one system separates "what humans assert" from "what the agent learns" from "what persists long-term."


Backfill & Continuous Documentation

Swimm — Integrating Continuous Documentation https://swimm.io/blog/integrating-swimm-and-continuous-documentation-into-your-workflow

Code-coupled docs that reference live code snippets. If code changes, Swimm auto-syncs or flags the doc for review. "Docuthon" model for bootstrapping docs in undocumented codebases.

Relevant because: their auto-sync (code hash → doc validity) is a concrete self-healing mechanism. The "docuthon" is a backfill strategy.

Karpathy's LLM Wiki Guide https://blog.starmorph.com/blog/karpathy-llm-wiki-knowledge-base-guide

How to build AI-maintained knowledge bases that agents ingest and update, replacing RAG with plain Markdown. Argues for canonical Markdown as the source of truth, with embeddings/graphs as derived views.


Memory Architecture (deeper technical)

GitHub — Building an Agentic Memory System for Copilot https://github.blog/ai-and-ml/github-copilot/building-an-agentic-memory-system-for-github-copilot/

How Copilot Memory works: user/repo/session scopes, cross-agent sharing (code review agent reads memories from coding agent), opt-in persistence.

Long-term Memory for AI Agents: Mem0, LangGraph, and Beyond https://thread-transfer.com/blog/2025-03-23-long-term-memory-ai-agents/

Covers procedural memory (how-to-do-things) as distinct from episodic (what happened) and semantic (facts). Relevant framing for team processes — rituals and workflows are procedural memory.

Anthropic — Advanced Tool Use https://www.anthropic.com/engineering/advanced-tool-use

Programmatic tool calling in sandboxed environments that don't fill the model's context. Relevant to keeping knowledge doc interactions lightweight.


Synthesis

Front Industry approach Gap we'd fill
Backfill Swimm docuthons, LLM-generated summaries, code-coupled refs Agent that reads git history + existing docs and bootstraps knowledge per-concept
Active authoring OKF (one concept per file), CLAUDE.md/MEMORY.md split Agent writes knowledge as a side-effect of doing work (Scribe model)
Self-healing Anthropic "dreaming," Swimm auto-sync, code-hash freshness Between-run review loop that detects drift and proposes updates
Team processes .cursorrules, copilot-instructions.md, OKF frontmatter Human-AI-readable "how this team works" artifact that agents can propose updates to

The common thread: everyone is converging on Markdown + YAML frontmatter as the format, one concept per file as the granularity, and separation of human-authored vs agent-learned as the key architectural decision.

What nobody has cracked yet: a closed loop where the agent both uses and maintains the knowledge without human approval becoming a bottleneck. Anthropic's "dreaming" is closest but still requires periodic human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment