Downloads · 30 days
16
20% of all-time downloads
kurcontko/mnemotree-root-v1
mnemotree-root-v1 is a text classification model from kurcontko. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Fast memory type classifier for mnemotree — a local-first memory system for LLM agents.
Downloads · 30 days
16
20% of all-time downloads
All-time downloads
79
Public
Parameters
150M
299 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors299 MB · 99%
From the Hugging Face model README
Fast memory type classifier for mnemotree — a local-first memory system for LLM agents.
Classifies conversation turns into memory types: episodic, semantic, or procedural. Runs in ~5ms on GPU, ~15ms on CPU.
| Base model | ModernBERT-base (149M params) |
| Task | Multi-label sequence classification (3 labels) |
| Training | Full fine-tune, Focal Loss (gamma=2.0) |
| Precision | bfloat16 |
| Max seq length | 256 tokens |
| Size | 289 MB |
| Metric | Score |
|---|---|
| Macro F1 | 0.674 |
| Micro F1 | 0.703 |
| Optimal threshold | 0.55 |
| Class | Precision | Recall | F1 |
|---|---|---|---|
| Episodic | 0.627 | 0.668 | 0.647 |
| Semantic | 0.810 | 0.690 | 0.745 |
| Procedural | 0.552 | 0.737 | 0.631 |
0 → episodic (events, experiences, conversations)
1 → semantic (facts, knowledge, definitions)
2 → procedural (how-to, workflows, instructions)
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("kurcontko/mnemotree-root-v1")
tokenizer = AutoTokenizer.from_pretrained("kurcontko/mnemotree-root-v1")
text = "Python uses the GIL for thread safety in CPython."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits)[0]
labels = ["episodic", "semantic", "procedural"]
for label, prob in zip(labels, probs):
print(f"{label}: {prob:.3f}")
# episodic: 0.12, semantic: 0.94, procedural: 0.08
from mnemotree import MemoryCoreBuilder
memory = (
MemoryCoreBuilder(store)
.with_local_models(device="cuda") # auto-downloads root + leaf
.build()
)
await memory.remember("Python uses the GIL for thread safety")
# → classified as semantic, importance=0.94
Pair with mnemotree-leaf-v1 (SmolLM2-1.7B extractor) for structured memory extraction.
root (5ms) → classify type → leaf (1s) → extract structured JSON
@misc{mnemotree2025,
title={mnemotree: Local-first memory for LLM agents},
author={kurcontko},
year={2025},
url={https://github.com/kurcontko/mnemotree}
}