Conceptsv3 featuresHypergraph relations

Hypergraph relations

Beta in docs/STATUS.md. Mnemosyne is alpha, on the 3.6.x line, and the API can still change within 3.x.

Why pairs are not enough

A relation joins two memories. Some knowledge joins more:

When a firmware release (A) fails its docking smoke test (B) and the rollback image (C) is out of date, the manual recovery runbook (D) applies.

Six pairwise edges can connect those four, but they lose the joint condition: any two of them look related on their own. A hyperedge keeps the four together.

The model

A hyperedge (MnemoHyperedge in packages/types/src/primitives.ts) has:

FieldMeaning
memberIdsThe ids of the members, 3 to 50
labelA short name, optional
descriptionA longer explanation, optional
contextQueryThe situation in which the group matters, optional
activationCountHow many times it was served with a hit
worthIts usefulness, starting at 0.5
validFrom, validToThe same validity window that facts have

Creating and reading

curl -X POST http://localhost:3939/hyperedges \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "memberIds": ["FACT_A", "FACT_B", "FACT_C", "FACT_D"],
    "label": "failed-release-recovery",
    "description": "When a release fails docking and the rollback image is stale, use the manual runbook."
  }'
GET    /hyperedges            List; filter with memberId, label, includeClosed
GET    /hyperedges/{id}
PATCH  /hyperedges/{id}       Change label, description or contextQuery
DELETE /hyperedges/{id}       Close it

From MCP, memory_hyperedge takes action (create, get, list, patch or archive). An agent can also form one with memory_self_edit and the link action.

How hyperedges form

  • Explicitly, with the calls above.
  • On session collapse. After the new facts are stored, the collapse asks the LLM for groups of three or more that belong together and stores each group as a hyperedge. A failure here does not fail the collapse.

Recalling facts together does not create a hyperedge. Co-recall strengthens the pairwise relation between the two facts.

In recall

Stage 3 of the cold tier looks up the hyperedges of the served hits and attaches them as context. Members of a hyperedge are not added to the result as hits. Serving a hit that belongs to a hyperedge raises that hyperedge’s activation count.

See also