Interface TreeNavigator


public interface TreeNavigator
Service provider interface for model-driven traversal of a document tree.

Vectorless retrieval descends a document's structure instead of scoring its fragments: given the node it is standing on and that node's children, a model decides which branch is worth opening for this query. There is no embedding and no similarity score anywhere on the path, which is the point — the passage that answers a question often shares no vocabulary with it.

Providers advertise the model identifiers they serve through supports(String) and are discovered with ServiceLoader. TnsAI does not bundle or impersonate an LLM: provider modules own inference, credentials, transport, lifecycle — and the cost of a traversal, which is the reason this is an SPI rather than something tnsai-intelligence calls directly. A traversal spends one model call per level, so pricing belongs where the pricing is known.

The runtime keeps what a provider cannot be trusted to keep. It bounds the traversal through TreeNavigator.Request.remainingVisits(), validates every returned id against the index before moving, and tracks visited nodes so a provider that loops terminates anyway. A navigator is asked for a judgement, not given control of the walk.

Since:
0.14.0
See Also: