Skip to main content

Similarite de Documents

Compares a document with others in the knowledge base and returns the most similar documents.

Parameters

ParameterTypeRequiredVariableDescription
documentIddynamic valueNoYesReference document identifier to find similar documents.
contentdynamic valueNoYesReference text to find similar documents (alternative to documentId).
limitnumberNoNoMaximum number of similar documents to return (1 to 50). (Default: 10, min 1, max 50)
minScorenumberNoNoMinimum similarity score (0 to 1). Documents below are excluded. (Default: 0.5, min 0, max 1)
includeChunksbooleanNoNoInclude matching chunks in each result. (Default: false)
outputVariabletextNoNoOutput variable name containing the similar documents.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : similarDocuments

{
"found": false,
"count": 0,
"similar": [],
"clusters": []
}

Example

Find documents similar to a report.

Input :

{"documentId": "doc-42"}

Output :

{"similar": [{"id": "doc-15", "title": "Rapport Q2", "similarity": 0.87}], "count": 1}
Tip

Useful for detecting duplicates or suggesting related reading. Similarity is a score between 0 and 1.