How it works
After your LLM generates a response, you can pass that response back to MemWire withmemory.feedback(). The feedback processor:
- Embeds the response
- Looks up the last recall result for that user
- For each recalled memory path, computes alignment — the average cosine similarity between the response embedding and the node embeddings along the path
- Strengthens edges on paths that aligned well with the response
- Weakens edges on paths that did not align (or on conflicting paths that the response disagreed with)
Code example
What gets updated
Only graph edges are updated — memory content is never modified. This means:- The graph topology stays stable; only traversal weights shift
- Write volume is very low (only dirty edges are persisted)
- The effect is gradual and bounded by
edge_weight_min/edge_weight_max
Tension handling
Whenmemory.recall() returns conflicting paths (memories that contradict each other), memory.feedback() checks which side the response actually agreed with:
- If the response aligned with a conflicting path → that path is strengthened
- If the response did not align → that path is weakened

