Semantic Search
search_semanticSemantic search — match by meaning, not exact words.
Uses vector similarity (cosine distance) over a fine-tuned multilingual embedding model. What is embedded is the segment's Pāli text alone — the model was fine-tuned on Pāli↔English aligned pairs (bilara-data), so an English query is compared directly against the Pāli text (cross-lingual), with no English/Thai translation mixed into the vector. A segment with no translation is represented by its Pāli exactly like any other segment.
🤔 In most cases you should use search_hybrid instead — it
combines this semantic search with keyword search and ranks better.
Use this tool only when you need:
Pure semantic results (no keyword influence)
Fine-grained
thresholdtuning (hybrid uses RRF which is harder to tune)To debug what semantic alone picks up vs keyword
⚠️ Known limitations:
The model was fine-tuned for English→Pāli cross-lingual retrieval, so English queries work best; Pāli→Pāli queries are less tested. For exact Pāli terms, prefer
search_by_keyword.English queries usually embed better than Thai (model is EN-primary)
For specific Pāli terms (
appamāda,dukkha), exact match is better — usesearch_by_keywordinsteadPāli stock phrases recur in many suttas → similarity scores cluster; read the top 10, don't trust rank 1 alone
📐 Reading distance. It is cosine distance between your query's
embedding and the segment's, so smaller is closer, and a row is returned
only at or under threshold (default 0.7) — an empty result means nothing
cleared that cut. Ordering is proximity of meaning in one model's space, not
doctrinal importance.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search_semantic"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results (default: 5, max: 20). | |
| query | Yes | Query text (English works best, then Pāli, Thai is weakest). | |
| language | No | Output language — "pali", "thai", "english", or "all" (Thai disabled → null). | pali |
| threshold | No | Maximum cosine distance (smaller = stricter match). Default 0.7; lower to 0.5 for tighter matches, raise to 0.9 for broader. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |