Supported
Tags and links¶
Behavior¶
Link source |
Strength |
Use |
|---|---|---|
Explicit document reference |
Highest |
Preserve authored relationships |
Managed tag overlay |
Policy-controlled |
Add vocabulary and preserve source metadata |
Similarity-derived link |
Scored and bounded |
Discovery. Review before treating as identity |
On LongMemEval, the measured A-MEM threshold produced link precision 0.436 and recall 0.944: useful for discovery, too noisy for automatic equivalence.
Example tag overlay example
Source tags |
Managed change |
Effective tags |
|---|---|---|
|
Add |
|
|
Add unknown tag |
Rejected before mutation |
Managed tags
TagDefinition, TagAssignments, assign_tags, normalize_tag, and
search_weight store curation in an overlay. A provider resync preserves that
overlay.
Derived links
extract_explicit_links finds explicit references. derive_links adds bounded similarity links and produces typed LinkCandidate values.
How it works¶
Tag keys are normalized before add/remove set operations. Definitions validate that assignments refer to known tags. Search weight combines assigned tag weights through deterministic policy and leaves source relevance intact. Explicit-link extraction recognizes source references first. Similarity linking scores caller-supplied candidate IDs, removes self-links, applies a threshold and limit, and sorts ties stably. Returned links are proposals. The application commits and interprets them.
from mari_kit.knowledge import (
TagAssignments, TagDefinition, assign_tags, derive_links, search_weight,
)
definitions = {"canonical": TagDefinition(key="canonical", label="Canonical",
kind="canonical", search_weight=2.0, behaviors=("Wins conflicts",))}
assignments = assign_tags(TagAssignments(), doc.document_id, definitions,
add=("canonical",))
weight = search_weight(doc.document_id, assignments, definitions)
links = derive_links(doc.document_id, candidate_ids,
score=lambda source, target: similarity_scores[source, target])
Function definitions and options¶
Function |
Required inputs |
Caller-controlled options |
|---|---|---|
|
Prior assignments, document ID, definitions |
Explicit add/remove keys |
|
One raw key |
Deterministic key normalization |
|
Document, assignments, definitions |
Weights live in caller-created definitions |
|
Source document and known IDs |
Recognized authored references |
|
Source ID, candidate IDs, score callback |
Threshold and result limit. Self-links are removed |
Research basis
Similarity measures for text processingA-MEM: dynamic linked-note organization
Mari’s managed-tag overlay and bounded link proposal rules are deterministic curation contracts.
Record managed tags as an explicit input when they affect a derived ranking or artifact. The shared dependency planner can invalidate those outputs independently of source-text embeddings.