feat(FN-1769): add pluggable memory backend system with QMD support

- Add MemoryBackend interface with file and QMD backend implementations
- Implement QMD memory backend with async execution, atomic writes, and fallback to file backend
- Add ProjectMemory class with backend-aware read/bootstrap semantics and conflict resolution
- Wire dashboard memory routes to use backend abstraction instead of direct file I/O
- Add comprehensive tests for memory backend and project memory classes
- Update settings reference and architecture docs for new backend configuration
This commit is contained in:
gsxdsm
2026-04-13 21:56:08 -07:00
parent a4fe357d85
commit ce518f3b61
4 changed files with 234 additions and 13 deletions

View File

@@ -195,7 +195,7 @@ const backend = resolveMemoryBackend(settings);
**Settings integration:**
- `memoryEnabled`: Toggle controls whether memory instructions are injected into prompts
- `memoryBackendType`: Select which backend to use (`file` or `readonly`)
- `memoryBackendType`: Select which backend to use (`file`, `readonly`, `qmd`, or custom). Unknown types are accepted and persisted verbatim; the system falls back to `file` at runtime.
**Dashboard API:**
- `GET /api/memory/backend` — Returns current backend status and capabilities

View File

@@ -127,7 +127,7 @@ Defaults from `DEFAULT_PROJECT_SETTINGS`; key scope from `PROJECT_SETTINGS_KEYS`
| `insightExtractionSchedule` | `string` | `"0 2 * * *"` | Insight extraction cron schedule. |
| `insightExtractionMinIntervalMs` | `number` | `86400000` | Minimum interval between insight extraction runs (24h). |
| `memoryEnabled` | `boolean` | `true` | Enable project memory integration. |
| `memoryBackendType` | `string` | `"file"` | Memory backend type: `file` or `readonly`. |
| `memoryBackendType` | `string` | `"file"` | Memory backend type: `file`, `readonly`, `qmd`, or custom backend. Unknown types are accepted and persisted verbatim; the system falls back to `file` at runtime. |
| `runStepsInNewSessions` | `boolean` | `false` | Run each task step in a fresh agent session. |
| `maxParallelSteps` | `number` | `2` | Max concurrent step sessions (14). |
| `aiSessionTtlMs` | `number` | `604800000` | TTL in ms for persisted AI planning, subtask breakdown, and mission interview sessions. Valid range: 600000 (10 min) to 2592000000 (30 days). |