Repository navigation
Closed
Description
Problem
Learnings stored via store_learning exist only in graph.db (SQLite). If the database is deleted, corrupted, or the user moves to a new machine, all learnings are permanently lost. There is no export, backup, or version-controllable representation of stored learnings.
This is especially risky because learnings are the append-only event log that dewey compile uses to produce knowledge articles. Losing the learnings means losing the source of truth — compiled articles can be rebuilt, but only if the learnings exist.
Proposal
Persist each learning as a markdown file alongside the database entry. When store_learning is called, write a .md file to .uf/dewey/learnings/ with the learning content and metadata as YAML frontmatter:
.uf/dewey/learnings/
authentication-1.md
authentication-2.md
vault-walker-1.md
deployment-1.md
Each file:
---
tag: authentication
category: decision
created_at: 2026-04-19T15:04:26Z
identity: authentication-1
---
Team decided to switch from API keys to OAuth2.
Reason: API keys don't support scoping.
Timeout: 30 seconds.Benefits
- Backup: Learnings survive
graph.dbdeletion —dewey indexcan re-ingest them from the markdown files - Version control: Learnings can be committed to git alongside
sources.yamlandconfig.yaml(the.gitignorepatterns only excludegraph.db,dewey.log, anddewey.lock— thelearnings/directory would be trackable) - Portability: Copy
.uf/dewey/to a new machine and all learnings come along - Human-readable audit trail: Developers can browse learnings without querying the database
- Team sharing: Committed learnings are shared via git — team members get each other's learnings automatically
Design Considerations
- Dual-write:
store_learningwrites to both SQLite (for search/embedding) and markdown (for persistence/backup). The database is the primary store; markdown is the backup. - Re-ingestion: On
dewey servestartup ordewey index, if learnings exist as.mdfiles but not in the database (e.g., aftergraph.dbdeletion or on a new machine), they should be re-ingested automatically. - Filename:
{tag}-{sequence}.mdmatches the learning identity scheme. - Idempotent: Writing the same learning twice produces the same file (no duplicates).
.gitignorecompatibility: The existing granular patterns don't exclude.uf/dewey/learnings/— learnings are trackable by default.
Related
- Spec 013 (knowledge compilation) — learnings are the event log that compilation reads from
- Spec 008 (store_learning tool) — the tool that creates learnings
- Issue bug: .gitignore blanket-ignores .dewey/ directory, preventing sources.yaml and config.yaml from being version-controlled #23 (granular gitignore) — established the pattern of trackable config files in
.uf/dewey/
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
jflowers commentedon Apr 23, 2026
Completed in PR #51 (spec 015-curated-knowledge-stores). File-backed learning persistence implemented as User Story 1:
store_learningdual-writes to SQLite +.uf/dewey/learnings/{tag}-{seq}.mddewey servestartup when graph.db is missing