---
title: nexyron.semantic.mmrNodes
url: https://nexyron.tech/docs/cypher/procedures/semantic/nexyron-semantic-mmrnodes
description: Diversity reranked debug retrieval of nodes.
---

# nexyron.semantic.mmrNodes

## Generic Description

Diversity-reranked debug retrieval of nodes.

Normal semantic search should use one query:

```cypher
CALL nexyron.semantic.search({query: 'fraud cluster', k: 5})
YIELD result_kind, item_id, node_id, edge_id, source, name, score, text, metadata_json
RETURN result_kind, item_id, node_id, edge_id, source, name, score, text, metadata_json
ORDER BY score DESC
```

Semantic search procedures expose vector and semantic retrieval surfaces through Cypher.

## Consumer-Level Explanation

Use `nexyron.semantic.search` for normal semantic retrieval. `nexyron.semantic.mmrNodes` is retained only when you specifically need diversity-reranked debugging of the node slice of the unified semantic index without graph-edge, abstraction, or artifact results.

## Conceptual Explanation

`nexyron.semantic.mmrNodes` should be read as one named procedure contract in the broader Nexyron Cypher surface. The procedure call is not only a syntax hook: it defines what runtime state, projection, registry entry, or graph algorithm is being asked to operate, and it determines which output columns downstream `YIELD`, `WITH`, and `RETURN` stages can safely use.

## More Detailed Explanation

This differs from plain semantic node-index retrieval by intentionally preferring a set that balances relevance and diversity rather than only near-duplicates of the top hit. It is not the product search surface.

The returned `score` is the hit's query relevance as a cosine-similarity score, where higher is better. The procedure's row order reflects MMR selection; if you sort later, use `ORDER BY score DESC` for relevance ordering.

## Advanced Example

This debug-only example isolates diversity behavior in the node slice of the unified semantic index. Use the unified procedure for normal search.

```cypher
CALL nexyron.semantic.mmrSearch({query: 'identity fraud cluster', k: 10, fetch_k: 25, lambda: 0.7, ef: 200})
YIELD result_kind, item_id, node_id, edge_id, source, name, score, text, metadata_json
WITH result_kind, node_id, score, text
WHERE result_kind = 'node'
MATCH (u:User)-[e:INTERACTED_WITH]->(d:Document)
WHERE id(u) = node_id
TIME e.ts BETWEEN datetime('2025-01-01T00:00:00Z') AND datetime('2025-03-01T00:00:00Z')
WITH node_id, score, date_trunc('day', e.ts) AS day_bucket, properties(d) AS doc_map, unpivot(properties(d.metadata)) AS metadata_rows
RETURN node_id, score, day_bucket, keys(doc_map) AS doc_keys, metadata_rows
LIMIT 10
```

## Real Use Cases

-   verifying node-index diversity behavior
-   diagnosing redundant node embedding results
-   comparing MMR node-index behavior against unified search
-   compose the procedure output with `YIELD`, `WITH`, and `RETURN` rather than hiding follow-up logic outside Cypher

## Real Limitations And Tradeoffs

-   too much diversity can weaken focus; too little collapses into redundancy
-   procedure calls are explicit contracts; missing state, unsupported parameters, or absent artifacts should fail rather than silently falling back
