mem0-dynamic-graph-memory
Skill5 starsChanged 34 days agoMITView on GitHub
Use when extracting entities and relationships from text, when building dynamic knowledge graphs, when wanting to upgrade from static OKF to entity-aware memory, or when analyzing papers/discussions for concepts. Triggers when ingesting new papers, processing Kaggle writeups, or when existing skills can't capture connections between concepts.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-validation-kaggleSkill
- agent-nurture-frameworkSkill
- agent-session-memory-protocolSkill
- arxiv-paper-searchSkill
- autogluon-firstSkill
- autogluon-preset-strategySkill
- autogluon-timeseries-strategySkill
- catboost-first-tabularSkill
- claudeceptionSkill
- code-competition-artifact-pipelineSkill
- competition-orchestration-multimodelSkill
- context-engineeringSkill
- controlled-submission-experimentSkill
- cross-competition-feature-transferSkill
- cv-lb-gap-acknowledgmentSkill
- domain-knowledge-constraints-trapSkill
- ensemble-model-correlation-trapSkill
- feature-engineering-saturation-detectionSkill
- gpu-readiness-assessmentSkill
- gsd-loop-engineeringSkill
- kaggle-cognitive-cost-optimizationSkill
- kaggle-competition-best-practicesSkill
- kaggle-competition-type-strategySkill
- kaggle-data-format-firstSkill
- kaggle-discussion-searchSkill
- kaggle-experiment-sopSkill
- kaggle-oof-lb-validation-protocolSkill
- kaggle-optimal-blendingSkill
- kaggle-submission-format-by-metricSkill
- kaggle-top-performer-replicationSkill
- knowledge-crystallization-feedback-loopSkill
- ladder-drift-and-meta-aware-regressionSkill
- learned-value-beats-heuristic-augmentationSkill
- llm-competition-pipelineSkill
- mcts-pipeline-searchSkill
- memory-hierarchy-managementSkill
- ml-sweet-spot-principleSkill
- model-ensemble-negative-weight-effectSkill
- multi-agent-rolesSkill
- multi-level-aggregation-overfittingSkill
- okf-visualize-knowledgeSkill
- onnx-minimal-network-designSkill
- per-category-modeling-backfireSkill
- progressive-verification-debuggingSkill
- ptcg-2ply-bounded-searchSkill
- ptcg-bc-large-model-submissionSkill
- retail-eda-frameworkSkill
- rmsle-zero-threshold-asymmetrySkill
- runtime-reflexionSkill
- sc-tir-mathematical-reasoningSkill
- self-evolving-skillsSkill
- skill-governance-and-automationSkill
- spatiotemporal-graph-feature-engineeringSkill
- store-sales-darts-chronos-blendSkill
- tabular-polynomial-features-breakthroughSkill
- three-layer-wisdom-extractionSkill
- time-series-walk-forward-validationSkill
- trueskill-simulation-competition-strategySkill
- ts-day-specific-forecastingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 91
When OKF misses connections you see in papers
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mem0 Dynamic Graph Memory (Entity-Relation Extraction)
Context
Static OKF stores predefined edges. Mem0/Letta (2025) extract entities + relations dynamically from text. agy suggested upgrading our existing EntityRelationExtractor as P2: enables automatic concept discovery instead of manual OKF curation.
The core insight: knowledge graphs are useful only if they reflect real relationships, and those relationships must be extracted, not hardcoded.
Guidance
Extract from Paper/Discussion
from framework.src.memory.entity_extraction import EntityRelationExtractor
ext = EntityRelationExtractor()
text = """
LightGBM uses histogram-based gradient boosting.
XGBoost improves LightGBM with second-order gradients.
CatBoost handles categorical features natively, unlike LightGBM.
We evaluated F1 score on Spaceship Titanic.
Walk-forward validation prevents data leakage in time series.
"""
entities, relations = ext.extract(text)
# → 8 entities (techniques, metrics, competitions, concepts)
# → relations: "XGBoost improves LightGBM", etc.
for e in entities:
print(f"{e.type}: {e.name} ({e.mentions} mentions)")
for r in relations:
print(f"{r.source} --{r.relation}--> {r.target}")With LLM Enhancement
def my_llm(prompt: str) -> str:
return openai_client.chat.completions.create(...).choices[0].message.content
ext = EntityRelationExtractor(llm_call=my_llm)
entities, relations = ext.extract(text)
# → 规则抽取 + LLM 抽取合并去重Integrate with OKF Index
# 已存在 OKFIndex,可叠加 entity edges
from framework.src.memory.okf_index import OKFIndex
from framework.src.memory.entity_extraction import EntityRelationExtractor
okf = OKFIndex(okf_dir="docs/ml-agent-memory")
okf.build()
ext = EntityRelationExtractor()
entities, relations = ext.extract(paper_abstract)
# 把 entity edges 添加到 OKF 图
for e in entities:
okf.items[f"entity:{e.name.lower()}"] = MemoryItem(
id=f"entity:{e.name.lower()}",
content=f"{e.type}: {e.name}",
type="entity",
importance=0.6,
)Why This Matters
| Static OKF | Dynamic Entity-Relation |
| Edges hardcoded in markdown | Edges extracted from text |
| Stale (doesn't reflect new content) | Always current |
| Misses implicit connections | Finds "X improves Y" relations |
| Manual curation required | Auto-scaling |
agy: "Mem0 dynamic graph memory enables cross-Competition knowledge transfer at scale."
When to Apply
When to Use
- Ingesting new paper or discussion
- Building knowledge graph from corpus
- Analyzing relationships between techniques
- When OKF misses connections you see in papers
When NOT to Use
- Short texts (LLM overhead not worth it)
- Highly specialized domain (entity patterns need extension)
- Real-time scenarios (extraction takes seconds)
Notes
- Pattern-based fallback: works without LLM, slightly lower recall
- Type coverage: technique / tool / metric / competition / concept
- Dedup is critical: same entity mentioned multiple times = single node
- Confidence scoring: relation extraction includes evidence snippet
- See also:
memory-hierarchy-management,time-series-walk-forward-validation
References
- Implementation:
framework/src/memory/entity_extraction.py - Inspired by: Mem0 (2024), Letta/MemGPT (2023), GLiNER (NER model)
- Pairing:
framework/src/memory/okf_index.py(existing static OKF)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

