pub async fn resolve_entity(
gm: &GraphMemory,
llm: &dyn LlmProvider,
candidate: &ExtractedEntity,
session_id: &str,
) -> Result<Resolution, GraphError>Expand description
Run the dedup pipeline for one extracted entity.
Three bands of raw cosine similarity, only one of which costs a model call:
- An existing entity of the same name and type — the same entity, resolved on an index lookup alone.
- Nearest neighbour at or above
certain_similarity— the same entity. - Nearest neighbour below
review_similarity— a new entity, CREATEd. - Anything left is genuinely ambiguous: the model sees at most
max_candidatesneighbours and returns skip / create / merge.
Merging into an immutable type falls back to CREATE on every path.