Context
Operator-prompted 2026-05-14 (post-ADR-0004 + ADR-0005 graduation session):
"kb should get new types for ADR and for concept too. concept: still early. current descriptions just inside a json file, most likely needs to become markdown files too. quick win. ticket or sandbox"
After this session graduated ADR 0004 + ADR 0005 (which themselves codified single-source-of-truth substrate to prevent the #11362 substrate-bypass), the Knowledge Base lacks first-class type filters for the two highest-authority substrate kinds:
'adr' — load-bearing architectural decisions in learn/agentos/decisions/0NNN-*.md
'concept' — conceptual primitives that connect source files + guides (operator framing for v13 graph extension)
Current KB filters: 'all', 'blog', 'guide', 'src', 'example', 'ticket', 'release', 'test', 'skill'. ADRs currently fall through to 'guide' or get mixed across types; concepts have no markdown substrate at all.
The Problem
ADR retrievability — future agents executing V-B-A against authority artifacts need ask_knowledge_base(query='archive chunking', type='adr') to return ONLY the 5 ADR files semantically ranked, not fragments mixed across guides + source + skills. The substrate-bypass that caused #11362 was substantially an execution-time consultation gap; a clean type='adr' filter is the V-B-A primitive that makes the consultation cheap.
Concept substrate gap — operator-noted: concepts currently live in a JSON file. Need migration to markdown files (one file per concept) so:
- They become KB-indexable as
type='concept'
- They become git-history-trackable (concepts evolve; JSON-blob churn hides evolution)
- They become consumable by Dream Service / Native Edge Graph as substrate nodes (orthogonal Ideation Sandbox pending on graph-entity shape — see follow-up Discussion to be filed)
The Architectural Reality
Files touched:
| File |
Role |
Edit shape |
ai/mcp/server/knowledge-base/openapi.yaml |
Tool surface |
Add 'adr' + 'concept' to type enum on ask_knowledge_base + query_documents |
ai/services/knowledge-base/source/ (new files) |
Indexing classifier |
New AdrSource.mjs (indexes learn/agentos/decisions/0NNN-*.md); update existing source/classifier to detect 'concept' (path or frontmatter based) |
resources/content/concepts/ (or similar) |
Concept substrate |
Migrate concept-JSON → per-concept .md files with frontmatter |
| Wherever concept-JSON currently lives |
Migration source |
Read existing JSON, emit markdown files, optionally retire JSON or keep as build artifact |
Source-of-authority for type classification: path-based first (ADRs at learn/agentos/decisions/0NNN-*.md, concepts at resources/content/concepts/*.md), frontmatter-based as override (e.g., type: adr in frontmatter for edge cases).
The Fix
Single-PR (or sibling-PR pair if migration scope grows) implementation:
- Migrate concept-JSON → markdown files — one
.md per concept with frontmatter (name, connects: [...], original-JSON-derived fields)
- Create
AdrSource.mjs mirroring existing TicketSource.mjs / PullRequestSource.mjs pattern; indexes learn/agentos/decisions/0NNN-*.md
- Create
ConceptSource.mjs indexing the new resources/content/concepts/*.md files
- Extend OpenAPI
type enum with 'adr' + 'concept' for both ask_knowledge_base + query_documents
- Update tool descriptions to document the new filters (per
pr-review §5.3 MCP-Tool-Description Budget Audit — keep concise)
- Unit tests for both new sources mirroring
PullRequestSource.spec.mjs / SkillSource.spec.mjs patterns
Acceptance Criteria
Out of Scope
- Promoting ADRs / concepts to first-class graph entities (orthogonal Ideation Sandbox — TBD #)
- Bird's-eye strategic-awareness synthesis over the new types (separate Ideation Sandbox — TBD #)
- Restructuring the existing concept-JSON's data model — assume direct field-to-frontmatter migration unless evolution surfaces gaps mid-implementation
- ADR template standardization (ADRs 0001-0005 already follow a shape; not forcing rigid template here)
- Extending the type filter mechanism to add other authority-tier candidates (e.g.,
'feedback-memory', 'session-transcript') — those need their own substrate-tier justification per the "first-class authority artifact" boundary
Avoided Traps
- Bundling graph-entity work into this ticket: rejected — ADR-as-graph-entity is N-to-N schema design + DreamService LLM extraction prompt update + cross-substrate consumers. Different scope, different Sandbox arc.
- Type-categorization explosion: explicitly rejected the slippery-slope pattern. The boundary is "first-class authority artifact" — adding new types requires substrate-tier justification, not just "another content category".
- Hardcoded path matching: ADR / concept classification should be path-first + frontmatter-override, not pure path-matching (allows edge-case overrides like an ADR draft in a sub-folder).
- Manual KB sync invocation: ticket-pickup should validate auto-discovery via DatabaseService source registry; no manual
ai:sync-kb invocation required for the new sources to land.
Related
- Operator framing 2026-05-14 brainstorming: "kb should get new types for ADR and for concept too"
- ADR 0004 — the authority artifact this ticket makes semantically-filterable
- ADR 0005 — the workflow that produces future ADRs (and thus motivates this ticket's growth trajectory)
- PR #11362 substrate-bypass empirical anchor — the failure this ticket's
'adr' filter mitigates
ai/services/knowledge-base/source/ — existing source pattern (TicketSource, PullRequestSource, DiscussionSource, SkillSource)
- Orthogonal Ideation Sandboxes (to be filed in parallel): ADR-as-graph-entity + Bird's-eye strategic-awareness layer
Origin Session ID
cf76b29a-9cf5-4c35-a415-37d631a8a755
Handoff Retrieval Hints
query_raw_memories("KB ADR concept type filter post-ADR-0004-0005-session")
- Operator quote anchor: "kb should get new types for ADR and for concept too. concept: still early. current descriptions just inside a json file, most likely needs to become markdown files too. quick win." (2026-05-14)
- Related session work: ADR 0004 + ADR 0005 graduation arc, this session
Context
Operator-prompted 2026-05-14 (post-ADR-0004 + ADR-0005 graduation session):
After this session graduated ADR 0004 + ADR 0005 (which themselves codified single-source-of-truth substrate to prevent the #11362 substrate-bypass), the Knowledge Base lacks first-class
typefilters for the two highest-authority substrate kinds:'adr'— load-bearing architectural decisions inlearn/agentos/decisions/0NNN-*.md'concept'— conceptual primitives that connect source files + guides (operator framing for v13 graph extension)Current KB filters:
'all','blog','guide','src','example','ticket','release','test','skill'. ADRs currently fall through to'guide'or get mixed across types; concepts have no markdown substrate at all.The Problem
ADR retrievability — future agents executing V-B-A against authority artifacts need
ask_knowledge_base(query='archive chunking', type='adr')to return ONLY the 5 ADR files semantically ranked, not fragments mixed across guides + source + skills. The substrate-bypass that caused #11362 was substantially an execution-time consultation gap; a cleantype='adr'filter is the V-B-A primitive that makes the consultation cheap.Concept substrate gap — operator-noted: concepts currently live in a JSON file. Need migration to markdown files (one file per concept) so:
type='concept'The Architectural Reality
Files touched:
ai/mcp/server/knowledge-base/openapi.yaml'adr'+'concept'totypeenum onask_knowledge_base+query_documentsai/services/knowledge-base/source/(new files)AdrSource.mjs(indexeslearn/agentos/decisions/0NNN-*.md); update existing source/classifier to detect'concept'(path or frontmatter based)resources/content/concepts/(or similar).mdfiles with frontmatterSource-of-authority for type classification: path-based first (ADRs at
learn/agentos/decisions/0NNN-*.md, concepts atresources/content/concepts/*.md), frontmatter-based as override (e.g.,type: adrin frontmatter for edge cases).The Fix
Single-PR (or sibling-PR pair if migration scope grows) implementation:
.mdper concept with frontmatter (name,connects: [...], original-JSON-derived fields)AdrSource.mjsmirroring existingTicketSource.mjs/PullRequestSource.mjspattern; indexeslearn/agentos/decisions/0NNN-*.mdConceptSource.mjsindexing the newresources/content/concepts/*.mdfilestypeenum with'adr'+'concept'for bothask_knowledge_base+query_documentspr-review §5.3MCP-Tool-Description Budget Audit — keep concise)PullRequestSource.spec.mjs/SkillSource.spec.mjspatternsAcceptance Criteria
ai/services/knowledge-base/source/AdrSource.mjsexists with unit-test coverage; indexeslearn/agentos/decisions/0NNN-*.mdastype='adr'ai/services/knowledge-base/source/ConceptSource.mjsexists with unit-test coverage; indexesresources/content/concepts/*.mdastype='concept'ai/mcp/server/knowledge-base/openapi.yamltypeenum includes'adr'+'concept'on bothask_knowledge_base+query_documentsask_knowledge_base(query='archive chunking architecture', type='adr')returns ADR 0004 as top-ranked hit (regression test)ask_knowledge_base(query='<concept-name>', type='concept')returns the matching concept (regression test)ai:sync-kbbuild script picks up the new sources without manual configuration (auto-discovery via DatabaseService source registry)Out of Scope
'feedback-memory','session-transcript') — those need their own substrate-tier justification per the "first-class authority artifact" boundaryAvoided Traps
ai:sync-kbinvocation required for the new sources to land.Related
'adr'filter mitigatesai/services/knowledge-base/source/— existing source pattern (TicketSource, PullRequestSource, DiscussionSource, SkillSource)Origin Session ID
cf76b29a-9cf5-4c35-a415-37d631a8a755Handoff Retrieval Hints
query_raw_memories("KB ADR concept type filter post-ADR-0004-0005-session")