How it works
Every memory is automatically classified into a category when it is stored. Instead of calling an LLM to categorize, MemWire uses cosine similarity to anchor embeddings:- Each category has one or more example sentences (anchors) that define its meaning
- At startup, anchor embeddings are computed as the centroid of all examples for that category
- When a new memory arrives, its embedding is compared to every anchor centroid
- The category with the highest cosine similarity wins — as long as it clears
classification_threshold
Default categories
Code example
Filtering search by category
Adding custom categories
Define domain-specific categories for your application:add_anchor with the same name accumulate examples — the centroid is recomputed each time, sharpening the category boundary.
Customising anchors at config level
Setting
default_anchors replaces the built-in set entirely. Include any categories you want to keep from the defaults.
