Search
SearchService finds catalog items, vendors and expenses by what they mean as well as how they are spelled. See docs/adr/0057-semantic-search.md.
Every record's words are turned into a vector by the embeddings provider (Voyage AI) in the background; a search embeds the query and takes the nearest records, the closest by spelling (trigrams), and an exact SKU or barcode, merged by rank. With no provider, or AI off for the business, it is spelling alone. Customers are never sent to the provider.
Search#
Request body
querystringtypesstring[]item, vendor or expense; empty for all the caller may see. Vendors need inventory.manage or finance.manage, expenses finance.manage.
limitintegerAt most this many results; 0 for 20, at most 50.
Response
resultsSearchResult[]byMeaningbooleanby_meaningWhether meaning was searched, or spelling alone; note says why not.
notestringcurl https://api.buziin.tech/holygrail.search.v1.SearchService/Search \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"types": [
""
]
}'{
"results": [
{
"type": "",
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"title": "",
"subtitle": "",
"match": "",
"variantId": "",
"amount": "150000"
}
],
"byMeaning": false,
"note": ""
}Types
The messages and enums these methods use. Field names are lowerCamelCase in JSON; the snake_case names work too. Enum values are sent as their names.
SearchRequest
holygrail.search.v1.SearchRequest
querystringtypesstring[]item, vendor or expense; empty for all the caller may see. Vendors need inventory.manage or finance.manage, expenses finance.manage.
limitintegerAt most this many results; 0 for 20, at most 50.
SearchResponse
holygrail.search.v1.SearchResponse
resultsSearchResult[]byMeaningbooleanby_meaningWhether meaning was searched, or spelling alone; note says why not.
notestringSearchResult
holygrail.search.v1.SearchResult
typestringitem, vendor or expense.
idstringtitlestringsubtitlestringmatchstringexact (SKU or barcode), meaning, or words.
variantIdstringvariant_idFor an item, its first variant.
amountint64 stringFor an item, its lowest price; for an expense, its amount.
Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.