feat(synthesize): observation -> learning synthesis CLI - #106
Merged
Conversation
- neurostack synthesize: greedy cosine clustering of aged observations (min-age 7d, anchor + >=3 siblings, threshold 0.35), one LLM-consolidated learning per cluster, originals tagged superseded_by:<id> (never deleted). Dry-run default, --run opt-in, cap 5 clusters per pass, per-cluster failure isolation. Report carries observation:learning ratio before/after. - harvest: auto-captured observations get a 720h TTL (harvest save path only; agent-written memories keep caller-chosen TTL). - memory-management skill: promote-observations guidance.
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #36 — the remaining part 1 (parts 2/3/5 shipped via #85; tool-layer TTL default stays deliberately skipped as a data-safety landmine, see the 2026-07-06 scoping).
What
neurostack synthesize(newsrc/neurostack/synthesize.py): consolidates aged observation heaps into singlelearningmemories.--min-age-days(default 7).--threshold0.35, anchor +--min-siblings3). The issue's FTS5-sibling wording predates Bug: memory embeddings silently dropped on failure; no backfill path #29's full embedding coverage; stored-embedding clustering is cheaper (no embedder round-trips) and stronger. Candidates without embeddings are counted and reported, never silently dropped.llm_urlpath as Consolidation replay: nightly promotion of episodic memories into semantic notes #96 consolidation); originals taggedsuperseded_by:<learning_id>— tagged, never deleted or archived.--runopt-in,--cap5 clusters per pass, per-cluster failure isolation. NOT wired into session_end auto_harvest (deliberate — manual/timer-driven for now).contextmemories, so it stays skipped.memory-managementskill: promote-observations guidance + the new command.Gate
ruff clean; 768 tests pass (18 new: candidate selection incl. NULL-tags regression, clustering/min-siblings/missing-embedding accounting, dry-run/cap, supersede tagging, per-cluster failure isolation, the #36 acceptance ratio scenario 3.5:1 -> <=2:1, harvest per-type TTL e2e).
Live verify
Dry run against the local DB exercises the CLI end-to-end (0 clusters — live data is on LXC 122; a live dry run follows the deploy).