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

begin_batch()

void

clear()

void

commit_batch()

Array

find_similar(path: String, limit: int = 10) const

Array

find_similar_with_filters(path: String, limit: int = 10, path_regex: String = "", class_filter: String = "") const

Dictionary

get_asset_entry(path: String) const

Dictionary

get_stats() const

Error

load()

Error

rebuild_index()

Error

remove_entry(path: String)

void

remove_paths(paths: PackedStringArray)

Error

save()

Array

search(query: String, limit: int = 20) const

Array

search_filtered(query: String, limit: int = 20, tags: PackedStringArray = PackedStringArray(), require_all: bool = false) const

Array

search_with_filters(query: String, limit: int = 20, tags: PackedStringArray = PackedStringArray(), require_all: bool = false, path_regex: String = "", class_filter: String = "") const

Error

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.


Error load() ๐Ÿ”—

Loads the persisted index from disk.


Error rebuild_index() ๐Ÿ”—

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.


Error save() ๐Ÿ”—

Persists the index to disk.


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.