Search scripts by meaning
semantic_searchSearch game code by what it does using local Ollama embeddings: index scripts, then query plain-language behavior to find matching chunks with paths and line numbers.
Instructions
Find code by what it does, not by exact words, with embeddings from a local Ollama (model embeddinggemma by default; nothing leaves the computer). Actions: index (read the scripts of the connected game and build the index; big games take several calls, repeat with offset set to the returned nextOffset until done is true), search (query, optional k, path_contains, place_id: returns the closest code chunks with their path and lines), status (what is indexed) and clear (delete the index of place_id, or all). Search and status do not need the game. Needs Ollama running with the model pulled (ollama pull embeddinggemma). For exact text use search_scripts instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | search: how many chunks to return (default 8). | |
| root | No | index: dotted path to index under (default game). | |
| query | No | search: what the code should do, in plain words. | |
| action | Yes | What to do. | |
| client | No | Client id from list_clients, for example c2. Defaults to the client that connected last. | |
| offset | No | index: script to continue from (default 0, which starts a new index). | |
| place_id | No | search, status, clear: the place to use (default: the most recently indexed one; clear without it deletes every index). | |
| class_name | No | index: only this kind of script. | |
| max_scripts | No | index: scripts to process in this call (default 400). | |
| path_contains | No | search: only chunks whose script path contains this. | |
| budget_seconds | No | index: stop after this many seconds (default 100). | |
| include_hidden | No | index: also scripts outside the tree (default false). |