SemanticAssetIndex๏
Inherits: Object
Lexical semantic index for tagged project assets.
Description๏
Builds and queries a lightweight token index from asset tags and metadata. Used by JustAMCP semantic search tools.
Methods๏
void |
|
void |
clear() |
void |
|
find_similar(path: String, limit: int = 10) const |
|
find_similar_with_filters(path: String, limit: int = 10, path_regex: String = "", class_filter: String = "") const |
|
get_asset_entry(path: String) const |
|
get_stats() const |
|
load() |
|
remove_entry(path: String) |
|
void |
remove_paths(paths: PackedStringArray) |
save() |
|
search_filtered(query: String, limit: int = 20, tags: PackedStringArray = PackedStringArray(), require_all: bool = false) const |
|
search_with_filters(query: String, limit: int = 20, tags: PackedStringArray = PackedStringArray(), require_all: bool = false, path_regex: String = "", class_filter: String = "") const |
|
upsert_entry(path: String) |
|
void |
upsert_paths(paths: PackedStringArray) |
Method Descriptions๏
void begin_batch() ๐
Starts a nested index batch so multiple upserts or removals can be saved together.
void clear() ๐
Clears the in-memory index.
void commit_batch() ๐
Ends one batch level and schedules a deferred save when the outermost batch closes.
Array find_similar(path: String, limit: int = 10) const ๐
Finds assets similar to the indexed asset at path.
Array find_similar_with_filters(path: String, limit: int = 10, path_regex: String = "", class_filter: String = "") const ๐
Finds assets similar to path, optionally filtered by path_regex and class_filter.
Dictionary get_asset_entry(path: String) const ๐
Returns index entry details for an asset path.
Dictionary get_stats() const ๐
Returns index statistics.
Loads the persisted index from disk.
Rebuilds the index from asset tags.
Error remove_entry(path: String) ๐
Removes one asset from the index.
void remove_paths(paths: PackedStringArray) ๐
Removes each path in paths from the index inside a batch.
Persists the index to disk.
Array search(query: String, limit: int = 20) const ๐
Searches indexed assets by lexical query.
Array search_filtered(query: String, limit: int = 20, tags: PackedStringArray = PackedStringArray(), require_all: bool = false) const ๐
Searches indexed assets for query, optionally requiring matches against tags.
Array search_with_filters(query: String, limit: int = 20, tags: PackedStringArray = PackedStringArray(), require_all: bool = false, path_regex: String = "", class_filter: String = "") const ๐
Searches indexed assets with tag, path regex, and class filters applied to the results.
Error upsert_entry(path: String) ๐
Upserts one asset into the index.
void upsert_paths(paths: PackedStringArray) ๐
Upserts each path in paths into the index inside a batch.