Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ Each PR ships independently green (`ruff` + `mypy minx_mcp` + `pytest`), with mi

- One spec doc under `docs/superpowers/specs/YYYY-MM-DD-slice6X-*.md` (adversarially reviewed before implementation).
- One plan doc under `docs/superpowers/plans/YYYY-MM-DD-slice6X-*.md` (step-by-step execution checklist).
- Sequentially numbered migration (next filename: `025_*.sql`). Slice 9 investigations should claim the next available migration.
- Sequentially numbered migration (next filename: `027_*.sql` after `026_memory_capture_fts.sql`). Slice 9 investigations should claim the next available migration.
- Implemented-slices row appended to the table above, with LOC / date / verification block.
- Operator post-upgrade step added under "Post-Upgrade Operator Steps" if the migration is not fully reversible from application-level data (6g needed a backfill; 6i will need a one-shot FTS5 rebuild; 6l will need a one-shot embedding backfill and a cost-ceiling env var).
- After deploying `026_memory_capture_fts.sql`, run `python -m scripts.rebuild_memory_fts /path/to/minx.db` so any pre-existing `captured_thought` rows are indexed by `payload.text` and `payload.capture_type`.

### Open questions (to resolve in each slice's spec pass)

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ Set the `core/llm_config` preference to a payload like:

Memory embeddings are offline-safe by default. `memory_hybrid_search` always works through SQLite FTS5; it reranks FTS candidates with stored embeddings only when OpenRouter is configured and compatible candidate embeddings exist.

## Quick Capture Vs Structured Create

Use `memory_capture` for fast, review-first notes. It stores `captured_thought` memories with default `confidence=0.5`, so rows are candidates until `memory_confirm` promotes them. Use `memory_create` when the caller already has a structured memory payload and intentionally wants the normal confidence/status behavior, including active rows at high confidence.

`memory_search` defaults to `status="active"`, so reviewers looking for captures should pass `status="candidate"` or `status=null`. Capture acknowledgements expose `response_template` / `response_slots`; Hermes or another harness owns the final user-facing wording.

Set `MINX_OPENROUTER_API_KEY` to enable `memory_embedding_enqueue` and `enrichment_sweep` processing for `memory.embedding` jobs. Optional knobs are `MINX_EMBEDDING_MODEL` (default `openai/text-embedding-3-small`), `MINX_EMBEDDING_DIMENSIONS`, `MINX_EMBEDDING_REQUEST_TIMEOUT_S`, and `MINX_EMBEDDING_MAX_COST_MICROUSD`. API keys are read from the environment only and are not returned in MCP responses.

For existing databases, run `python -m scripts.rebuild_memory_fts` after pulling Slice 6i and `python -m scripts.backfill_memory_fingerprints` for rows that pre-date Slice 6g fingerprints.
Expand Down
44 changes: 14 additions & 30 deletions docs/superpowers/plans/2026-04-27-generic-memory-capture.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ COALESCE(json_extract(new.payload_json, '$.text'), '') || ' ' ||
COALESCE(json_extract(new.payload_json, '$.capture_type'), '')
```

This key-based extraction intentionally applies to any future memory type that stores canonical `payload.text` or `payload.capture_type`, not only `captured_thought`.

Use `new.payload_json` in `INSERT` trigger and `new.payload_json` in `UPDATE` trigger (mirror `025` exactly). Header comment should mention capture FTS and that existing DBs should run `python -m scripts.rebuild_memory_fts <db>` after upgrade.

- [ ] **Step 2: Sanity check migration is picked up**
Expand All @@ -65,12 +67,9 @@ Run: `python -c "from pathlib import Path; import tempfile; from minx_mcp.db imp

Expected: no exception (all migrations including `026` apply).

- [ ] **Step 4: Commit**
- [ ] **Step 4: Review checkpoint**

```bash
git add minx_mcp/schema/migrations/026_memory_capture_fts.sql
git commit -m "feat(memory): migration 026 extends FTS payload_text for capture fields"
```
Pause for review. Do not commit unless the user explicitly asks for a commit in the current session.

---

Expand Down Expand Up @@ -123,12 +122,9 @@ Run: `pytest tests/test_rebuild_memory_fts.py::test_rebuild_memory_fts_indexes_c

Expected: **PASS**

- [ ] **Step 5: Commit**
- [ ] **Step 5: Review checkpoint**

```bash
git add scripts/rebuild_memory_fts.py tests/test_rebuild_memory_fts.py
git commit -m "feat(memory): rebuild FTS includes captured_thought text and capture_type"
```
Pause for review. Do not commit unless the user explicitly asks for a commit in the current session.

---

Expand Down Expand Up @@ -299,12 +295,9 @@ Run: `pytest tests/test_memory_service.py -k "normalize_capture_type or derive_c

Expected: **PASS**

- [ ] **Step 5: Commit**
- [ ] **Step 5: Review checkpoint**

```bash
git add minx_mcp/core/memory_capture.py tests/test_memory_service.py
git commit -m "feat(memory): deterministic capture normalization and metadata validation"
```
Pause for review. Do not commit unless the user explicitly asks for a commit in the current session.

---

Expand Down Expand Up @@ -472,12 +465,9 @@ Run: `pytest tests/test_core_memory_tools.py -k "memory_capture" -v`

Expected: **PASS**

- [ ] **Step 5: Commit**
- [ ] **Step 5: Review checkpoint**

```bash
git add minx_mcp/core/tools/memory.py tests/test_core_memory_tools.py
git commit -m "feat(mcp): add memory_capture tool for captured_thought"
```
Pause for review. Do not commit unless the user explicitly asks for a commit in the current session.

---

Expand Down Expand Up @@ -518,12 +508,9 @@ Run: `pytest tests/test_memory_service.py::test_captured_thought_round_trip_list

Expected: **PASS** (FTS may already index via triggers once migration exists).

- [ ] **Step 4: Commit**
- [ ] **Step 4: Review checkpoint**

```bash
git add minx_mcp/core/memory_payloads.py tests/test_memory_service.py
git commit -m "docs(memory): note captured_thought uses permissive payload validation"
```
Pause for review. Do not commit unless the user explicitly asks for a commit in the current session.

---

Expand Down Expand Up @@ -562,12 +549,9 @@ Add **"Quick capture vs structured create"** under the README memory section nea
- After deploy, run migrations (automatic on `get_connection` fresh apply; existing servers need app restart / migrate path per your ops).
- Run `python -m scripts.rebuild_memory_fts /path/to/minx.db` so pre-existing `captured_thought` rows pick up new FTS columns.

- [ ] **Step 3: Commit**
- [ ] **Step 3: Review checkpoint**

```bash
git add README.md HANDOFF.md
git commit -m "docs: document memory_capture and FTS rebuild for rollout"
```
Pause for review. Do not commit unless the user explicitly asks for a commit in the current session.

---

Expand Down
Loading
Loading