Package com.tnsai.intelligence.rag.graph


package com.tnsai.intelligence.rag.graph
Vendor-neutral graph retrieval data access SPI.

Adapters implement GraphStoreProvider and register it through ServiceLoader. The provider exposes query seeds and outgoing neighbors through GraphStore; it does not implement traversal or ranking.

InMemoryGraphStoreProvider is the bundled FILE-corpus adapter. It claims Roles that have FILE knowledge sources, extracts entities and relations with chunk provenance, and is a framework default so an explicit consumer adapter wins.

Neo4jGraphStoreProvider is optional: it claims a Role only when tnsai.graph.neo4j.uri is set and org.neo4j.driver is on the runtime classpath. The driver is never a tnsai-core or required intelligence dependency.

When tnsai-tools is on the classpath, KnowledgeToolsGraphStoreProvider claims Roles that have no FILE sources (or whose fence names knowledge-tools) and serves live KnowledgeTools triples. That bag is not the FILE knowledge graph. Without the tools artifact the provider leaves the Role unclaimed. When any other non-default provider also claims the Role, bundled defaults are dropped.

Provider selection is annotation configuration, not request data: a Role annotated @Search(strategy = GRAPH) with no registered provider, or with more than one provider claiming it, fails at action dispatch through GraphCapabilityException. That error is raised before the @Search.onFailure guard, so no policy can downgrade it to an empty result or a stale cache entry. Only failures a provider raises while traversing are routed through onFailure.

Since:
0.13.0