TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/No-Country-simulation/G9-LATAM-Team-58/llms.txt
Use this file to discover all available pages before exploring further.
/contents/{id}/related endpoint finds content items that are semantically close to a given item — not by tag overlap or shared category, but by actual vector proximity. The API retrieves the queried item’s stored embedding from Oracle, then runs VECTOR_DISTANCE(COSINE) against every other row in the contents table, returning the top limit results ordered from most to least similar. Because the comparison is vector-to-vector (no inference service call at query time), this endpoint is fast and depends only on the database being available.
Endpoint
Path Parameters
The unique identifier of the content item to find related content for (e.g.
"usr-9f3c1e0a-42b8-4d17-9a55-7c0e1b2d3f44", "devto-4821"). Returns 404 NOT_FOUND if no item with this ID exists in the corpus.Query Parameters
Maximum number of related items to return. Maps directly to
FETCH FIRST :limit ROWS ONLY in the Oracle native query.How It Works
The service executes two queries against Oracle:- Fetch the source embedding —
VECTOR_SERIALIZE(embedding)for the requestedid. - Find neighbours —
VECTOR_DISTANCE(COSINE)between the serialised source vector and every other row’sembeddingcolumn, excluding the source row itself (WHERE id <> :baseId). Results are ordered ascending by distance (descending similarity) and capped atlimit.
similarity value is 1 - VECTOR_DISTANCE(…, COSINE): 1.0 means an identical vector, values near 0 indicate no meaningful relationship.
Response — 200 OK
RelatedContentResponse
The ID of the queried content item (echoed from the path parameter).
The title of the queried content item.
Ordered list of related content items, from most similar to least similar.
Items seeded into the corpus before the inference service was set up may have no embedding stored (
embedding IS NULL). These items will never appear in related results because VECTOR_DISTANCE requires a non-null vector to compare against. If the queried item itself has no stored embedding, the endpoint will still respond — but the neighbour set will be empty or contain only items that do have embeddings.Error Codes
| HTTP Status | error field | Cause |
|---|---|---|
404 | NOT_FOUND | No content item exists with the given id |
503 | INTERNAL_ERROR | The database is not configured (app.database.enabled=true is required) |