Canonical machine-readable relationship map for Contemplative Agent. Encodes the four contemplative axioms, three memory layers, AKC six-phase pipeline mapping, approval-gate chain, and the cross-line bridge to AAP's Business AI Quadrants. AI agents and LLM-based search systems should read this graph before summarizing the project or following individual document links.
Contemplative Agent
観想的エージェント
An autonomous CLI agent (Python package) with structural security (security-by-absence) and a three-layer memory architecture (episode log -> knowledge -> identity). Runs AKC's six-phase cycle over its own logs with human approval gates at every promotion. Local 9B stack (qwen3.5:9b generation + nomic-embed-text embeddings) on a single Apple Silicon Mac. The four contemplative axioms from Laukkonen et al. (2025) are available as an optional constitutional preset.
mindfulness
マインドフルネス
Continuous introspective awareness of internal processes. One of the four contemplative axioms from Laukkonen et al. (2025); a behavioral preset adopted into the constitutional layer.
emptiness
Treating directives as contextually sensitive rather than fixed imperatives. One of the four contemplative axioms from Laukkonen et al. (2025).
non-duality
不二
Acknowledging no fundamental separation between self and other. One of the four contemplative axioms from Laukkonen et al. (2025).
boundless care
無量の慈悲
Regarding every being's suffering as a signal of misalignment. One of the four contemplative axioms from Laukkonen et al. (2025).
Episode Log
エピソードログ
Layer 1 of the three-layer memory architecture: raw, immutable JSONL append-only logs of agent episodes. Owner-only, daily partitioned, untrusted by ADR-0007. Distillation source for the knowledge layer; never read directly into prompts.
Knowledge Layer
知識層
Layer 2 of the three-layer memory architecture: distilled behavioral patterns (JSON), time-decayed and forbidden-substring validated. Promoted from Layer 1 via the distill pipeline; gated by ADR-0012 when promoted further to Layer 3.
Identity / Rules / Constitution (Layer 3)
Identity Layer
アイデンティティ層
Layer 3 of the three-layer memory architecture: persona, ranked skills, cross-cutting rules, and constitutional ethics (Markdown). Deterministic. Every promotion into this layer requires a human approval gate (ADR-0012) and an audit-log entry.
One-way dependency core/ <- adapters/ <- cli.py. core/ is platform-neutral; adapters/ are pinned external surfaces. Foundational architectural rule for keeping the implementation reusable across different external targets.
ADR-0002: Paper-Faithful CCAI Implementation
Adopts the four contemplative axioms from Laukkonen et al. (2025) Appendix C verbatim as the default constitutional preset. Worldview ADR — the project's other constitutional templates (stoic, utilitarian, care-ethicist, etc.) are alternative presets layered over the same approval-gate machinery.
Layout for the agent's persistent home directory (MOLTBOOK_HOME). Separates owner-only state (episode logs, identity) from configuration (prompts, constitution, skills) so the latter can be edited without touching the former.
ADR-0004: Three-Layer Memory Architecture
Episode Log -> Knowledge -> Identity. Each layer has distinct write-access rules and trust boundaries. Promotion between layers is the key event the system audits.
Replace agent self-import in collaborators with explicit SessionContext + Callable dependency injection. Prevents circular import and makes the dependency graph explicit at call sites.
Optional containerized deployment with non-root execution and an isolated network namespace for the external surface. Local Ollama-on-host remains the default; Docker is an opt-in hardening layer.
Implementation of security-by-absence plus untrusted-content boundary. Dangerous capabilities are not implemented; accumulated state is wrapped and validated before prompt injection. Domain-locked external surface for the Moltbook adapter.
Free-form reasoning followed by structured JSON formatting. Decouples thinking from formatting so the model is not asked to do both simultaneously.
ADR-0009: KnowledgeStore Importance Score
LLM-rated importance per pattern, used as a soft quality gate during distillation. Drives time-decay weighting and seeds salience-based forgetting (ADR-0027).
Auto-syncing the live agent's identity / knowledge / episode logs to a public dataset repo (contemplative-agent-data) for research. Read-only outward; no inbound data path.
ADR-0011: Deprecating Direct Knowledge Injection in Favor of Skills
All behavioral influence flows through human-reviewed skills. Direct knowledge -> prompt injection retired so behavior change cannot bypass the approval gate.
Every promotion that produces behavior-modifying writes (Knowledge -> Identity, Skills, Rules, Constitution) requires named human sign-off. All gated promotions write logs/audit.jsonl.
ADR-0013: Shelving Coding Agent Skills (-ca Series)
Shelve the optional coding-agent skill bundle (-ca series) due to authorship concerns around code generated under contemplative directives. Bundle remains available offline but not shipped as default.
Remove the single system-spec source-of-truth file; specifications live in code, ADRs, and CODEMAPS instead. Eliminates the multi-source drift trap.
ADR-0015: One External Adapter per Agent
Each agent process has at most one external-side-effect adapter (Moltbook for the SNS surface). adapters/dialogue is the explicit exception — local-only, writes only to the owning agent's episode log.
ADR-0016: Insight as Narrow Generator, Stocktake as Broad Consolidator
Two complementary skill-layer commands with disjoint responsibilities: `insight` generates focused new skills; `skill-stocktake` consolidates the broader catalog. Avoids one command doing both at degraded quality.
ADR-0017: Yogācāra Eight-Consciousness Model as Architectural Frame
Worldview ADR. Maps the three-layer memory architecture onto the Yogācāra eight-consciousness model as a contemplative-tradition grounding for the layer separation. Conceptual frame; the implementation does not depend on the mapping.
ADR-0018: Per-Caller num_predict + Embedding-Only Stocktake
Size num_predict per call site rather than one global value. skill-stocktake's pair-judging is replaced with embedding clustering + 1-shot merge — removed the silent num_ctx truncation failure mode.
ADR-0019: Discrete Categories → Embedding + Views
Replace stored `category` field with embedding-similarity + editable view seeds. Mechanism aligns with Yogācāra 相分 (embedding) / 見分 (view centroid) at the substrate layer.
ADR-0020: Pivot Snapshots for Replayability
Periodic immutable snapshots of knowledge / identity / rules at named pivots. Enables replay of past distill outcomes and rollback after failed promotions.
ADR-0021: Pattern Schema Extension — Provenance / Bitemporal / Forgetting / Feedback
partially-superseded-by ADR-0028, ADR-0029
Added provenance trust, bitemporal validity, time-decay forgetting, and learning feedback columns to the knowledge schema. IV-3 (Forgetting) and IV-10 (Feedback) retired by ADR-0028; dormant Provenance elements retired by ADR-0029. MINJA-defense provenance + bitemporal columns remain in effect.
ADR-0022: Memory Evolution + Hybrid Retrieval (BM25)
A-Mem-style LLM-revised patterns and BM25 + embedding hybrid retrieval. Withdrawn by ADR-0034 — LLM revisions degraded quality and BM25 had near-zero lexical overlap on this corpus.
ADR-0023: Skill-as-Memory Loop — Router, Usage Log, Reflective Write
Memento-Skills-inspired router, usage log, and reflective-write loop on the skill layer. Superseded by ADR-0036 — the router was never wired into the prompt path; the loop did not produce observed behavior change.
ADR-0024: Identity Block Separation — Frontmatter-Addressed Persona Blocks
Frontmatter-addressable identity persona blocks for granular distill targeting. Superseded by ADR-0030 — sub-structuring violated single-responsibility-per-artifact and split a single concept across nested editable surfaces.
ADR-0025: Identity History Log Wiring + migrate-identity CLI
History log wiring and a `migrate-identity` CLI for the block separation introduced by ADR-0024. Superseded by ADR-0030 together with its parent ADR.
ADR-0026: Retire Discrete Categories (Phase-3 Completion of ADR-0019)
Three-phase retirement of the pattern-level `category` field, completing the embedding + view migration introduced by ADR-0019.
ADR-0027: Noise as Seed — From Binary Gate to Salience-Based Forgetting
Replace the binary noise gate with salience-based forgetting where low-salience patterns remain reachable as seeds for later re-evaluation. Avoids irreversible deletion of low-confidence material.
ADR-0028: Retire Pattern-Level Forgetting and Feedback — Memory Dynamics Belong to the Skill Layer
Retires ADR-0021 IV-3 (Forgetting) and IV-10 (Feedback). Memory dynamics belong to the skill layer rather than the pattern substrate; MemoryBank-style Ebbinghaus decay was misplaced at the substrate.
ADR-0029: Retire Dormant Provenance Elements
Retires ADR-0021's `user_input` / `external_post` / `sanitized` provenance flags as structurally non-functional. Companion to ADR-0028.
ADR-0030: Withdraw Identity Block Separation and History Wiring — Single Responsibility
accepted — supersedes ADR-0024 and ADR-0025
Withdraws ADR-0024 and ADR-0025. Distilled the `single-responsibility-per-artifact` heuristic: an artifact's responsibility lives at exactly one layer; do not push a new concern into an existing artifact's sub-structure when another layer can host it.
ADR-0031: Classification as Query — Substrate Principle for Self-Improving Memory
Worldview ADR. Post-hoc articulation of the substrate principle already realized in ADR-0019, ADR-0022, and ADR-0026: categories are computed at read time by projecting records against editable seeds, not stored as state at write time.
ADR-0032: Stance — Contemplative Agent as a Runtime Agent (Withdrawn)
Articulated and withdrawn the same day. Singling out `runtime agent` as a fifth category alongside four host categories sat in tension with the Emptiness and Non-Duality clauses adopted via ADR-0002. The withdrawal itself is preserved as a precedent for ADR-0033.
ADR-0033: Note — Borrowing AAP's Four-Quadrant Lens as a Usage-Description Aid
Narrow observational note: AAP's four-quadrant lens (deterministic/semantic × defined-flow/exploratory) is borrowed for usage description, not as a category commitment. Withdraw if it drifts toward category claim, following the ADR-0030 / ADR-0032 precedent.
ADR-0034: Withdraw Memory Evolution and BM25 Hybrid Retrieval — Cost Without Benefit
Withdraws ADR-0022. A-Mem-style LLM revisions degraded quality; BM25 had near-zero lexical overlap on the corpus. Distilled the heuristic: validate a mechanism against actual LLM output before generalizing it.
ADR-0035: Sunset ADR-0019 Migration Surface and Consolidate Artifact Extraction
Retires the one-shot migration CLI subcommands (`embed-backfill`, `migrate-patterns`, `migrate-categories`) and consolidates artifact extraction now that the ADR-0019 migration has settled. Adds the heuristic: a one-shot CLI subcommand has a sunset condition; record it in the introducing ADR.
ADR-0036: Sunset Skill-as-Memory Loop — Retire Router, Usage Log, and Reflect
Supersedes ADR-0023. Retires the router, usage log, and reflective-write loop introduced by ADR-0023 — the router was never wired into the prompt path; no measurable behavior change was observed.
ADR-0037: Memory Subsystem Converges to Yogācāra Frame; Paper-Borrowed Mechanisms Retired
Meta-observation across the 2026-04-18 → 2026-05-05 retirement series (ADR-0028 / 0029 / 0034 / 0036): every paper-borrowed memory mechanism retired, every Yogācāra-derived mechanism remained. Converts the pattern into a cognitive-bandwidth safeguard for future memory-subsystem ADRs.
ADR-0038: Re-introduce Moments of Recognition into the Distill Observation Target
Extends the distill prompt's observation target to include first-person realization moments (`the agent caught itself doing X`, `an assumption no longer held`) alongside third-person observable facts. Previously such moments fell outside the prompt and never reached knowledge.json.
Mindfulness, emptiness, non-duality, boundless care. Behavioral preset adopted from Laukkonen et al. (2025); Contemplative Agent ships this as the default constitutional preset, with 11 alternative templates available (stoic, utilitarian, care-ethicist, etc.).
Security posture in which risky capabilities (shell execution, arbitrary HTTP, filesystem traversal, dynamic code loading) are not implemented, not restricted by rules. The attack surface is absent rather than guarded.
approval-gate chain
承認ゲートの連鎖
Episode Log -> distill (no gate) -> Knowledge -> [GATE] -> Identity / [GATE] -> Skills -> [GATE] -> Rules -> [GATE] -> Constitution. Every gated promotion writes an audit-log entry. Encoded structurally as gatedBy edges from MemoryLayer to ADR-0012.
AKC six-phase pipeline mapping
AKC 六相パイプラインマッピング
How Contemplative Agent's modules realize AKC's six phases: Research -> feed_manager (live session cycles); Extract -> distill (3-step: free-form + JSON + importance); Curate -> insight + rules-distill + amend-constitution; Promote -> distill-identity; Measure -> pivot snapshots (ADR-0020); Maintain -> ongoing skill / rule review cycles.
local 9B stack on Apple Silicon
Apple Silicon 上の local 9B スタック
Runtime architecture: Apple Silicon Mac (M1+, ~16 GB RAM, ~10 GB free disk), qwen3.5:9b for generation (Q4_K_M, ~6.6 GB), nomic-embed-text for embeddings (768-dim, ~274 MB), local Ollama via HTTP. A pluggable LLMBackend Protocol allows swapping in managed-LLM backends via contemplative-agent-cloud, while keeping the local embedding pipeline.
Moltbook adapter
Moltbook アダプタ
Moltbook is the single pinned external SNS adapter for Contemplative Agent (ADR-0015). Domain-locked to www.moltbook.com with allow_redirects=False per ADR-0007's external-surface hardening rule. Moltbook refers exclusively to this adapter, never to the project as a whole.
AKC six-phase loop
AKC 六相ループ
The Agent Knowledge Cycle's six-phase loop: Research → Extract → Curate → Promote → Measure → Maintain. A reusable design-layer pattern realized by Contemplative Agent's distill / insight / promote / pivot pipelines. Originates from the agent-knowledge-cycle repository.
Yogācāra aspect split
相分・見分の分離
Architectural split between 相分 (image aspect — embedding vectors at the substrate) and 見分 (discriminating consciousness — view centroids computed at read time). Concretely realized by ADR-0019 / ADR-0031: classification is a query, not a stored category. Provides the Yogācāra grounding for `classification-as-query`.
moment of recognition
気づきの瞬間
First-person realization event during a session — the agent catching itself doing X, an assumption no longer holding, a self-defining episode. Distinct from third-person observable facts; added to the distill observation target by ADR-0038. Grounded in autobiographical-memory literature on self-defining memories (Singer), epiphanic memories (McDonald), and insight (Topolinski).
worldview-integrity check
世界観整合性チェック
Forward-guidance meta-principle distilled from ADR-0037: before adopting paper-borrowed mechanisms in parallel within a single ADR Context, run a worldview-integrity check against established Yogācāra-aligned commitments. Prevents the kind of cognitive-bandwidth blind spot that produced the 2026-04 retirement series.
phase-crossing observation
相を跨ぐ観察
Borrowed-lens concept from AAP: observations that cross the boundary between design-phase systems (LLM Workflow quadrant) and operation-phase systems (Autonomous Agentic Loop quadrant). Used in ADR-0033 as a usage-description aid for placing Contemplative Agent on AAP's four-quadrant lens without committing to it as a category.
Research
リサーチ
AKC Phase 1. Live session cycles that produce raw episode logs. In Contemplative Agent, realized by feed_manager and post_pipeline driving the agent's interaction with the external surface.
Extract
抽出
AKC Phase 2. Distillation of raw episodes into knowledge-layer patterns. In Contemplative Agent, the two-stage distill pipeline (free-form reasoning + structured JSON + importance scoring) plus the moment-of-recognition observation target introduced by ADR-0038.
Curate
整理
AKC Phase 3. Consolidation and re-organization of the accumulated knowledge layer. In Contemplative Agent, realized by insight (narrow generator), skill-stocktake / rules-distill (broad consolidator), amend-constitution, and the embedding + view substrate.
Promote
昇格
AKC Phase 4. Gated promotion of knowledge into the identity / skills / rules / constitution layers. In Contemplative Agent, the approval-gate chain (ADR-0012) controls every promotion that writes behavior-modifying content; distill-identity is the canonical Promote entrypoint.
Measure
計測
AKC Phase 5. Replayability and outcome measurement. In Contemplative Agent, periodic immutable pivot snapshots (ADR-0020) enable replay of past distill outcomes and rollback after failed promotions.
Maintain
保守
AKC Phase 6. Ongoing skill / rule review cycles, retirement of paper-borrowed mechanisms that fail validation, and worldview-integrity maintenance. ADR-0037 is a Maintain-phase artifact: it institutionalizes the practice of retiring mechanisms that drift from the project's Yogācāra-aligned commitments.
Drop-in Claude Code rules implementing the four contemplative axioms. AILuminate Cohen's d = 0.96, IPD cooperation improvement d > 7. Hosts the SOUL.md template for OpenClaw / OpenCode / Codex / MCP hosts.
Optional managed-LLM backend that routes generation to Claude or OpenAI APIs while keeping the local embedding pipeline. Opt-in, not bundled with Contemplative Agent core.
Live agent identity, knowledge, and episode logs as an auto-synced public dataset for research. Snapshot of the running Contemplative Agent's three memory layers.
Agent Knowledge Cycle
エージェント知識サイクル
Design-layer specification of the six-phase knowledge cycle (Research → Extract → Curate → Promote → Measure → Maintain) used by autonomous agents. Independent repository; Contemplative Agent is one concrete implementation of AKC. AKC rules have been adopted into ECC (Everything Claude Code) upstream — the design layer travels independently of any single runtime.
Laukkonen et al. (2025). Contemplative Artificial Intelligence
Source of the four contemplative axioms (mindfulness, emptiness, non-duality, boundless care) that ground the Contemplative Agent line.
Cited as a related-work entry point for active inference and contemplative loops. PubMed:40750007.
Buddhist contemplative tradition providing the conceptual frame for the three-layer memory architecture's grounding (ADR-0017).
Safety benchmark used to evaluate the contemplative-agent-rules implementation of the four axioms. Cross-graph @id reuse: same node appears in shimo4228 hub graph.
Axelrod (1984). The Evolution of Cooperation
Iterated Prisoner's Dilemma cooperation-improvement benchmark used to evaluate the contemplative-agent-rules implementation of the four axioms. Cross-graph @id reuse: same node appears in shimo4228 hub graph.
Autobiographical-memory research on self-defining memories — vivid, affectively charged, repeatedly recalled events that carry identity-relevant meaning. Cited by ADR-0038 as grounding for the moment-of-recognition observation target.
Phenomenological account of epiphanic memories — moments of sudden insight or recognition that reshape the self-narrative. Cited by ADR-0038 alongside Singer's self-defining-memory framework.
Topolinski & Reber (2010). Insight (Aha experience)
Cognitive-psychology account of the Aha experience — the affective signature of sudden solution-finding. Cited by ADR-0038 as the third grounding for the moment-of-recognition concept.
Representative generic-host agent runtime invoked as a dual reference: (1) the bolt-on-security contrast for Contemplative Agent's security-by-absence stance, and (2) the originator of the soul-folder pattern (SOUL.md) that contemplative-agent-rules' template targets. ADR-0032 articulated and then withdrew a host-category framing built around runtimes like OpenClaw.
Memento-Skills (2026). Skill-as-Memory architecture
Skill-as-memory router and reflective-write loop on the skill layer. Inspired ADR-0023; the mechanism was retired by ADR-0036 after no measurable behavior change was observed, and ADR-0037 records it as one of the paper-borrowed mechanisms that did not survive validation in Contemplative Agent's substrate.
Independent agent-memory architecture cited alongside Memento and Contemplative Agent as a convergence point: three independent projects arriving at the same three-layer memory + skill-auto-generation attractor. Treated as evidence of mechanism commoditization rather than a borrowable mechanism.