Inject knowledge-wiki index (wiki/INDEX.md) into session context - #475
Open
kayeungadrian-tam wants to merge 1 commit into
Open
Inject knowledge-wiki index (wiki/INDEX.md) into session context#475kayeungadrian-tam wants to merge 1 commit into
kayeungadrian-tam wants to merge 1 commit into
Conversation
Workspaces that maintain a long-lived knowledge base as markdown pages under wiki/ get their INDEX.md injected at engine build, alongside AGENTS.md — the progressive-disclosure trick the skills catalog already uses: sessions carry a map of what is known at flat context cost; pages load on demand via file tools. Absent wiki/ ⇒ zero change. Index capped at 6k chars with a nudge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What this adds
A convention: a workspace that maintains a long-lived knowledge base keeps it as markdown pages under
wiki/with anINDEX.mdmap-of-content. At engine build, ONLY the index is injected into the system prompt (alongside AGENTS.md), with a short preamble telling the agent to open pages on demand and revise them in place. Nowiki/→ zero change to behavior. Index capped at 6k chars.This is the same progressive-disclosure trick the skills catalog already uses, applied to knowledge: sessions carry a map of what is known at flat context cost, while the knowledge itself grows without bounding context.
Why (field evidence)
Running a 24/7 self-waking monitoring agent (heart-rate + room-climate guardian) surfaced the limit of flat memory: append-only entries that are 80% duplicates ("still 26.5°C…" × N cycles). Restructuring its knowledge as a git-backed wiki — living pages, revised in place, [[wikilinked]], with a nightly consolidation automation — worked immediately: the consolidator's first unsupervised run correctly concluded "no durable knowledge today", touched one timestamp line, and committed. The missing platform piece was sessions knowing the wiki exists without being told: this PR.
Pairs naturally with the existing AGENTS.md ingestion (same file, same injection site) and with git-tracked workspaces (page history = provenance for every belief an agent holds).
Change
project.py:load_wiki_index()— reads<workspace>/wiki/INDEX.md, caps at 6k, wraps with usage preambleagent.py: inject after AGENTS.md inbuild_enginepytest tests/test_skills.py: 9/9.🤖 Generated with Claude Code