Skip to content

Find similar objects

Finding similar objects through recommendations

The recommendation endpoint allows you to discover objects similar to a specified reference object. This similarity search uses vector embeddings to find objects with related characteristics, which is useful for recommendation systems, content discovery, and finding related items.

How similarity search works

Tallyfy Answers uses semantic similarity to find related objects:

  1. Each object’s text content is converted into vector embeddings (numerical representations)
  2. When searching for similar objects, the system compares vector distances
  3. Objects with closer vector distances are considered more similar
  4. Results are ranked by similarity score from most to least similar

API endpoint

GET /v1/collections/{collection_name}/objects/{object_id}/similar

Path parameters

ParameterTypeRequiredDescription
collection_namestringYesName of the collection to search in
object_idstringYesID of the reference object to find similar objects to

Query parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo10Maximum number of similar objects to return (1-100)
min_scorefloatNo0.0Minimum similarity score threshold (0.0-1.0)
filterstringNonullFilter expression to narrow down results

Response

A successful request returns a 200 OK status code and a JSON response containing:

{
"results": [
{
"id": "product-456",
"score": 0.89,
"document": {
"name": "Bluetooth Speaker",
"description": "Portable waterproof speaker with 20-hour battery life",
"price": 129.99,
"categories": ["electronics", "audio"]
}
},
{
"id": "product-789",
"score": 0.72,
"document": {
"name": "Wireless Earbuds",
"description": "Premium noise-canceling earbuds with charging case",
"price": 99.99,
"categories": ["electronics", "audio"]
}
}
],
"meta": {
"limit": 10,
"found": 2
}
}

Response fields

FieldTypeDescription
resultsarrayList of similar objects with similarity scores
results[].idstringUnique identifier of the similar object
results[].scorefloatSimilarity score (0.0-1.0) where higher is more similar
results[].documentobjectFull content of the similar object
meta.limitintegerMaximum number of results requested
meta.foundintegerTotal number of similar objects found

Error scenarios

StatusDescription
404Collection or reference object not found
400Invalid parameters or filter syntax

Example request

Terminal window
# Find objects similar to product-123 with at least 0.7 similarity
curl -X GET "https://go.tallyfy.com/api/v1/collections/products/objects/product-123/similar?limit=5&min_score=0.7" \
-H "X-Answers-API-Key: <your_api_key>"

Common use cases

  • Product recommendations: “Customers who viewed this also viewed…”
  • Content discovery: Finding related articles or documentation
  • Similarity matching: Identifying near-duplicate content
  • Alternative suggestions: Offering similar options when an item is unavailable

Best practices

  • Start with a lower min_score threshold and adjust based on result quality
  • Use the filter parameter to combine similarity with business rules
  • For better recommendations, ensure your objects contain rich, descriptive text
  • Include diverse object attributes to improve similarity matching

Answers > Collections

Collections in Tallyfy Answers serve as organizational containers that group similar objects together while enabling operations like searching filtering and managing data through dynamic schemas and efficient organization methods.

Collections > Create a collection

The process of creating collections in Tallyfy Answers involves specifying a unique name through a POST request which automatically detects data types and returns collection details upon successful creation.

Overview

Tallyfy Answers is a next-generation search solution that combines vector database indexing user-friendly interface and LLM-powered responses to provide enhanced search capabilities beyond traditional search engines at competitive pricing.

Answers > Objects

Objects in Tallyfy Answers serve as JSON-formatted data records with unique identifiers that can be flexibly structured indexed and searched within collections while supporting both custom and auto-generated IDs for efficient data management.