Skip to content

chore: port storage-agnostic GREEN changes from upstream neural-memory (chat-heavy preset, MCP offload/situation, plugin+brain-config fixes)#31

Merged
acidkill merged 4 commits into
mainfrom
chore/upstream-port-2026-06
Jun 22, 2026
Merged

chore: port storage-agnostic GREEN changes from upstream neural-memory (chat-heavy preset, MCP offload/situation, plugin+brain-config fixes)#31
acidkill merged 4 commits into
mainfrom
chore/upstream-port-2026-06

Conversation

@acidkill

Copy link
Copy Markdown
Owner

Port: neural-memory storage-agnostic GREEN changes → SurrealDB fork

Ports the storage-agnostic GREEN changes pushed to upstream
nhadaututtheky/neural-memory since our last sync (after #158, 2026-05-03),
adapted to our SurrealDB-only fork (neural_memorysurreal_memory, nmemsmem).

Method

Upstream ships via direct pushes to main, not merged PRs — so PR-enumeration
finds nothing (last merged PR is #158). Classified every feat/fix commit on
main in the window 2026-05-04 → 2026-06-22 against our SurrealDB-only
architecture: 3 GREEN ported · 3 YELLOW (follow-up) · 1 ALREADY_HAVE · RED skipped.

GREEN — ported in this PR

c088eaf — agent operator ergonomics

  • chat-heavy config preset (conversational agents — fast decay, recent-biased, compact).
  • Concept-extraction observability: dropped_short / dropped_noise /
    dropped_duplicate_entity counters on PipelineContext, surfaced via
    EncodingResult.extraction_stats.
  • Opt-in smem_remember verbose_extraction flag.

289a7cd — plugin install + brain-config round-trip

  • _running_under_plugin() skips setup_hooks_claude() when the Claude Code plugin
    owns hooks.json — prevents double hook fires (#169).
  • BrainSettings.extras pass-through + _migrate_brain_runtime_config() so
    config.toml [brain] knobs reach BrainConfig without a parallel field each (#168).

d55172a — MCP agent ergonomics

  • smem_offload / smem_inflate: store large tool output as an ephemeral CONCEPT
    neuron (24h TTL), return compact ref+summary. Reuses the safety pipeline
    (sanitize_explicit_content + auto_redact_content).
  • smem_situation: one-shot session snapshot (active task, top-3 recent decisions,
    open blockers, gap detection).
  • recall prefer_recent: opt-in newest-first re-rank (+ context rebuild).
  • _check_session_gap: real 60s-delta gap detection (was a stub returning False).
  • MCP tool count: full/core 53→56, standard 9→10 (smem_situation).

All changes are additive / opt-in / default-unchanged — no behavior change unless
explicitly enabled. SurrealDB brain creation is untouched; _migrate only layers
config.toml extras over already-stored brains, with failures swallowed.

Test plan

  • ruff check src/ tests/ — clean.
  • Targeted unit tests for every touched area — green (config presets, concept
    noise filter, unified_config, response_compactor, remember handler, mcp,
    tool tiers).
  • Tool-count + tool-name assertions updated for the 3 new MCP tools.
  • Full make verify (mypy + complete suite) on CI.
  • Manual against live SurrealDB: smem config preset chat-heavy;
    smem_offloadsmem_inflate round-trip; smem_situation;
    recall with prefer_recent=true.

Follow-up (NOT in this PR)

  • Dashboard storage-tab → SurrealDB: dashboard/src/features/storage/* +
    api/hooks/useStorage.ts still call /api/dashboard/storage/{status,migrate,backend}
    (sqlite↔infinitydb) which the SurrealDB-only backend no longer exposes — dead tab.
    Adapt to SurrealDB (separate task; context-fresh to avoid regressions).
  • YELLOW (valuable, need adaptation — see BACKLOG.md):
    d073d16 case-insensitive tag matching · ac2a001 light hooks + SessionStart +
    Codex parity · 73507d9 TLLR retrieval (status/validity/BM25/provenance — depends
    on reflex_conflict.py / Neuron.with_reflex we lack).

Base: main · branch: chore/upstream-port-2026-06.

Toni Nowak added 4 commits June 22, 2026 16:49
…rain-config extras

Ports two storage-agnostic GREEN changes from upstream nhadaututtheky/neural-memory
(adapted to our SurrealDB-only fork):

- c088eaf: 'chat-heavy' config preset; concept-extraction observability counters
  (dropped_short/noise/duplicate_entity) on PipelineContext surfaced via
  EncodingResult.extraction_stats; opt-in smem_remember 'verbose_extraction' flag.
- 289a7cd: plugin hook dedup (_running_under_plugin skips setup_hooks_claude when
  the Claude Code plugin owns hooks.json, #169); BrainSettings.extras pass-through
  + _migrate_brain_runtime_config so config.toml [brain] knobs reach BrainConfig (#168).

All additive / opt-in; defaults unchanged. 152 targeted unit tests green.
Ports storage-agnostic GREEN change d55172a from upstream nhadaututtheky/neural-memory
(adapted to SurrealDB-only fork, nmem_ -> smem_):

- smem_offload/smem_inflate: store large tool output as an ephemeral CONCEPT
  neuron (24h TTL), return compact ref+summary; drill back via inflate. Reuses
  our safety pipeline (sanitize_explicit_content + auto_redact_content).
- smem_situation: one-shot session snapshot (active task, top-3 recent decisions,
  open blockers, gap detection) — replaces recap + multiple recall calls.
- recall prefer_recent: opt-in newest-first re-rank (by time_end/created_at) that
  also rebuilds result.context; default false (no behavior change).
- _check_session_gap: real 60s-delta gap detection (was a stub returning False).

New tool count: full/core 53->56, standard 9->10 (situation). Tool-count/name
assertions updated in test_mcp + test_tool_tiers. All additive/opt-in.
…g config.brain

- ruff format server.py (CI Lint runs 'ruff format --check', not just 'ruff check')
- _migrate_brain_runtime_config: move config.brain access inside try/except so a
  test-mock config (SimpleNamespace without .brain) or any malformed config no
  longer raises AttributeError during SurrealDB bootstrap — migration must never
  break brain init. Fixes test_surrealdb_bootstrap_reuses_brain_found_by_name.
Docs Freshness CI regenerates docs/api/mcp-tools.md from the live tool schemas;
adding smem_offload/smem_inflate/smem_situation made the checked-in doc stale.
@acidkill acidkill marked this pull request as ready for review June 22, 2026 18:35
@acidkill acidkill merged commit 4d424f3 into main Jun 22, 2026
7 checks passed
acidkill added a commit that referenced this pull request Jun 22, 2026
perf: light PostToolUse hook (perf subset of ac2a001) [follow-up #31]
acidkill added a commit that referenced this pull request Jun 22, 2026
feat: case-insensitive tag matching [follow-up #31]
acidkill added a commit that referenced this pull request Jun 22, 2026
…aldb

feat(dashboard): rebuild Storage tab for SurrealDB (replace dead multi-backend tab) [follow-up #31]
acidkill added a commit that referenced this pull request Jun 23, 2026
chore(release): 2.5.0 — upstream feature ports (#31–34) + docs sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant