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
Configuration reference
| Parameter | Default | Description |
|---|---|---|
feedback_strengthen_rate | 0.1 | Base amount added to edge weights on aligned paths, scaled by alignment score. |
feedback_weaken_rate | 0.05 | Amount subtracted from edge weights on misaligned paths. |
feedback_align_strengthen | 0.5 | Alignment score above which a path is strengthened. |
feedback_align_weaken | 0.2 | Alignment score below which a path is weakened. |
edge_weight_min | 0.01 | Floor for edge weights after decay. |
edge_weight_max | 1.0 | Ceiling for edge weights after reinforcement. |

