Skip to content

feat(basic-memory): persistent knowledge base integration with research-informed operations#4

Closed
wpfleger96 wants to merge 2 commits intomainfrom
recall-basic-memory
Closed

feat(basic-memory): persistent knowledge base integration with research-informed operations#4
wpfleger96 wants to merge 2 commits intomainfrom
recall-basic-memory

Conversation

@wpfleger96
Copy link
Copy Markdown
Owner

@wpfleger96 wpfleger96 commented Apr 17, 2026

Summary

Integrates basic-memory as a persistent, git-synced markdown knowledge base for AI coding agents. Knowledge persists across sessions, repos, and machines via git sync, and is browsable in Obsidian.

This PR has two layers:

Infrastructure — wires basic-memory into the ai-rules CLI and profile system:

  • MCP server definition in personal and work profile mcp_overrides (not default)
  • PostToolUse hook auto-commits and pushes after basic-memory write operations
  • Runner script with background git sync (won't block MCP startup on slow networks)
  • Idempotent setup script handles git init, GitHub remote creation, and directory scaffolding
  • ToolSpec with is_enabled gating so upgrade skips basic-memory for profiles that don't use it
  • CLI version, install, status, and upgrade all surface basic-memory

Operations — the /kb skill encodes proven patterns from Karpathy's llm-wiki, Block's world model ADR-182, and production case studies:

  • Write-back loop — agents persist useful synthesized answers as notes, creating a compounding knowledge artifact
  • GAP annotations ([GAP: ...]) — mark uncertain/unverified claims so agents surface uncertainty rather than hiding it (from squareup/world)
  • Misconception tags ([misconception]) — document what is NOT true to prevent confident false assertions (from squareup/world "Counterfactual Warnings")
  • Eval-first methodology — don't pre-populate speculatively; collect real agent failures, write targeted notes, verify improvement (from Block P2P world model +76% result)
  • KB Lint — periodic health-check for stale GAPs, orphan notes, contradictions, version drift
  • Schema promotion[promote] tag flags patterns worth distilling into AGENTS.md rules

Files changed

Profilespersonal.yaml, work.yaml get basic-memory mcp_overrides
Hooksbasic-memory-runner.sh (background git sync), basic-memory-setup.sh (init order fix, remove --force), basic-memory-post-write.sh (unchanged, wired via settings.json)
CLIcli.py gates status on config, respects is_enabled in upgrade loop
Installerinstaller.py calls setup on upgrade, surfaces output on first install
Configsettings.json adds PostToolUse hook entry
SkillSKILL.md adds GAP, misconception, write-back, eval-first, lint sections; note-templates.md adds misconception template
Docsconfig/AGENTS.md expanded basic-memory section; repo AGENTS.md adds kb to skill list
Tests — 10 new tests for _is_basic_memory_configured, ensure_basic_memory_installed, is_enabled filtering

@wpfleger96 wpfleger96 force-pushed the recall-basic-memory branch 3 times, most recently from d4644c6 to 2406651 Compare April 23, 2026 21:19
@wpfleger96 wpfleger96 changed the title WIP: basic memory/recall feat(basic-memory): persistent knowledge base integration with research-informed operations Apr 24, 2026
wpfleger96 and others added 2 commits April 24, 2026 17:45
… KB operations

The basic-memory MCP integration was partially implemented but non-functional:
mcps.json was empty (so _is_basic_memory_configured always returned False),
the PostToolUse hook was never wired, git ops in the runner script blocked
MCP startup, and the upgrade loop ignored is_enabled. This fixes all of that
and adds operational patterns from Karpathy's llm-wiki and Block's world
model (ADR-182) research.

Infrastructure: add MCP definition to personal/work profile mcp_overrides,
fix git-init-before-config ordering in setup.sh, remove dangerous --force
push fallback, background git ops in runner.sh, gate status/upgrade on
profile config, call setup on upgrade path, add PostToolUse hook to
settings.json.

Operations: add GAP annotations, [misconception] tags, write-back loop
guidance, eval-first methodology, and KB lint health-check to /kb skill.

Tests: 10 new tests covering _is_basic_memory_configured, ensure_basic_
memory_installed, and is_enabled filtering in upgrade loop.
@wpfleger96 wpfleger96 force-pushed the recall-basic-memory branch from 00512e4 to 898eeb3 Compare April 24, 2026 21:47
@wpfleger96 wpfleger96 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant