Problem
DevAIFlow's hierarchical context system (ENTERPRISE.md, ORGANIZATION.md, TEAM.md, USER.md) is read in full every session start. This causes:
- Token waste — full file reads every session, even when only a fraction is relevant
- No persistence — knowledge derived mid-session is lost when the session ends
- No search — agent must read entire files to find relevant context
- No conflict resolution — if enterprise and team contexts contradict, no detection or priority mechanism beyond read order
- No cross-repo sharing — context is local to the DevAIFlow config directory
context_files.py is already deprecated in favor of skills, but skills have the same read-everything problem
Proposed Solution
Integrate Lore as the knowledge backend for DevAIFlow's hierarchical context.
Lore is an MCP server providing persistent, cross-team memory for AI coding agents with:
- N-level hierarchy with priority resolution (maps to enterprise/org/team/user)
- SQLite + FTS5 persistent store with cheap LLM synthesis for retrieval
- Git-backed shared knowledge with PR review for writes
- Conflict detection with bidirectional links and lock mechanism
- Auto-capture from session transcripts at session end
- Cross-repo knowledge spanning repositories
What Lore replaces
| Component |
Replace with Lore? |
Notes |
| Context files (ENTERPRISE.md etc) |
Yes |
Lore levels 1-4 replace these — query instead of full file read |
| Config hierarchy (enterprise.json etc) |
No |
Structured config (JSON) for field defaults, JIRA mappings, model provider enforcement — not knowledge |
| Skills hierarchy (01-enterprise/ etc) |
No |
Executable instructions, not knowledge entries |
| Session knowledge re-derivation |
Yes |
Core Lore value — persistent store eliminates re-reading |
Integration points
- Session start —
daf-workflow skill calls query_knowledge() instead of reading 4 markdown files
- Mid-session — agent stores discoveries via Lore MCP tools at appropriate hierarchy level
- Session end —
daf complete triggers Lore auto-capture from session transcript
- Config — DevAIFlow maps its hierarchy levels to Lore levels:
- Level 1 → Enterprise (git repo, PR-reviewed)
- Level 2 → Organization (git repo, PR-reviewed)
- Level 3 → Team (git repo, PR-reviewed)
- Level 4 → User (local SQLite, immediate writes)
Migration path
- Phase 1: Add Lore as optional MCP dependency — if available, use it; if not, fall back to current
.md files
- Phase 2: Migrate existing context files to Lore entries via
daf config import-to-lore
- Phase 3: Deprecate
.md context files, Lore becomes primary knowledge backend
- Phase 4: Enable auto-capture from session transcripts in
daf complete
Out of Scope
- Replacing DevAIFlow's JSON config hierarchy (enterprise.json, organization.json, team.json, config.json)
- Replacing the skills system
- Lore development itself (tracked in itdove/lore repo)
Acceptance Criteria
References
- Lore repo: https://github.com/itdove/lore
- Current context_files.py:
devflow/utils/context_files.py (already deprecated)
- Current hierarchy skills:
~/.config/devaiflow/.claude/skills/01-enterprise/ through 04-user/
- Config hierarchy:
devflow/config/loader.py
Problem
DevAIFlow's hierarchical context system (ENTERPRISE.md, ORGANIZATION.md, TEAM.md, USER.md) is read in full every session start. This causes:
context_files.pyis already deprecated in favor of skills, but skills have the same read-everything problemProposed Solution
Integrate Lore as the knowledge backend for DevAIFlow's hierarchical context.
Lore is an MCP server providing persistent, cross-team memory for AI coding agents with:
What Lore replaces
Integration points
daf-workflowskill callsquery_knowledge()instead of reading 4 markdown filesdaf completetriggers Lore auto-capture from session transcriptMigration path
.mdfilesdaf config import-to-lore.mdcontext files, Lore becomes primary knowledge backenddaf completeOut of Scope
Acceptance Criteria
query_knowledge()instead of reading context filesReferences
devflow/utils/context_files.py(already deprecated)~/.config/devaiflow/.claude/skills/01-enterprise/through04-user/devflow/config/loader.py