Skip to content

feat(engine): experimental phase-aware resonance memory kernel - #39

Draft
zeekay wants to merge 3 commits into
mainfrom
feat/phase-aware-resonance-memory
Draft

zeekay wants to merge 3 commits into
mainfrom
feat/phase-aware-resonance-memory

Conversation

@zeekay

@zeekay zeekay commented Oct 25, 2026

Copy link
Copy Markdown
Member

Overview

Introduces a native, dependency-free Rust implementation of the published phase-aware resonance score as an experimental Engine API.

  • Public hanzo_engine::resonance module exposed from Engine
  • Validated real, polar and complex feature conversion
  • Explicit identity / negation / phase rotation operations
  • Normalized resonance score with energy-balance penalty
  • Optional dense cosine + resonance top-K reranker
  • Unit tests for self-match, orthogonality, anti-phase, amplitude imbalance, global-phase invariance, input validation and hybrid ranking
  • Integration/design notes in docs/RESONANCE_MEMORY.md

Correctness guardrails

No automatic negation detection. Conversion from a real embedding to a complex pattern gives the same ranking as cosine for equal-norm inputs. New semantic operator information must be grounded at ingest/query time. This is an experimental reranker, not a replacement for vector indexes.

Licensing

Independently written against the published equation in arXiv:2509.09691v1; no upstream ResonanceDB code copied. The upstream source-available license is not imported.

Rollout

Existing Engine RAG/search paths unchanged. Native kernel can be called by a future experimental memory adapter; add persistence, semantic operator extraction and explicit runtime flags only after benchmark gates.

Validation

Unit tests authored but not executed here because the current runtime has no Rust toolchain. Please run:

cargo test -p hanzo-engine resonance:: --lib

before merging. CI pending.

zeekay commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Cross-repo integration note: hanzoai/semantic PR #1 is the semantic-memory owner and adds the Go reference resonance scorer. Engine should stay an optional Rust scoring accelerator; do not introduce a parallel long-term memory DB here. Preserve Semantic's existing subject-scoped/vector/graph/triple retrieval and LoCoMo benchmark, use a future opt-in shortlist adapter with grounded proposition-level phase metadata, and require Go/Rust parity plus contrastive negation evaluation before production.

This branch has not been deployed

No deployments
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