Collections in Tallyfy Answers group similar objects together, like database tables. They…
Find similar objects
How do you find similar objects in Tallyfy Answers?
Section titled “How do you find similar objects in Tallyfy Answers?”The recommendation endpoint lets you find objects similar to a specified reference object.
This similarity search uses vector embeddings to find objects with related characteristics. It’s useful for recommendation systems, content discovery, and finding related items.
How does similarity search work in Tallyfy Answers?
Section titled “How does similarity search work in Tallyfy Answers?”Here’s how Tallyfy Answers uses semantic similarity to find related objects:
- Tallyfy converts each object’s text content into vector embeddings (numerical representations)
- When searching for similar objects, Tallyfy compares vector distances
- Objects with closer vector distances are more similar
- Tallyfy ranks results by similarity score from most to least similar
API endpoint
Section titled “API endpoint”GET /collections/{collection_name}/recommend/{object_id}Path parameters
Section titled “Path parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
collection_name | string | Yes | Name of the collection to search in |
object_id | string | Yes | ID of the reference object to find similar objects to |
Query parameters
Section titled “Query parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 4 | Maximum number of similar objects to return (1-20) |
Response
Section titled “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
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
results | array | List of similar objects with similarity scores |
results[].id | string | Unique identifier of the similar object |
results[].score | float | Similarity score (0.0-1.0)1 where higher is more similar |
results[].document | object | Full content of the similar object |
meta.limit | integer | Maximum number of results requested |
meta.found | integer | Total number of similar objects found |
Error scenarios
Section titled “Error scenarios”| Status | Description |
|---|---|
| 404 | Collection or reference object not found |
| 400 | Invalid parameters or filter syntax |
Example request
Section titled “Example request”# Find objects similar to article-123, limit to 5 resultscurl -X GET "https://answers.tallyfy.com/collections/docs/recommend/article-123?limit=5" \ -H "Authorization: Bearer your_api_key"What are common use cases for similarity search?
Section titled “What are common use cases for similarity search?”- 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
What are best practices for similarity search?
Section titled “What are best practices for similarity search?”- Start with a lower
min_scorethreshold and adjust based on result quality - Use the
filterparameter to combine similarity with business rules - You’ll get better recommendations if your objects contain rich, descriptive text
- Include diverse object attributes to improve similarity matching accuracy
Related articles
Section titled “Related articles” Retrieve a specific object from a Tallyfy Answers collection using its unique identifier…
Objects are JSON data records in Tallyfy Answers that belong to collections. They can be…
Tallyfy Answers search combines AI semantic understanding with traditional keyword matching to…
Footnotes
Section titled “Footnotes”-
Cosine similarity scoring where perfect match equals 1.0, high similarity above 0.8, low below 0.5 ↩
Was this helpful?
About Tallyfy
- 2026 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks