torch_geometric.llm.utils.NeighborSamplingRAGGraphStore
- class NeighborSamplingRAGGraphStore(feature_store: Optional[FeatureStore] = None, **kwargs)[source]
Bases:
LocalGraphStore
Neighbor sampling based graph-store to store & retrieve graph data.
- register_feature_store(feature_store: FeatureStore) None [source]
Registers a feature store with the graph store.
- Parameters:
feature_store (
FeatureStore
) – The feature store to register.- Return type:
- put_edge_index(edge_index: Union[Tensor, Tuple[Tensor, Tensor]], *args, **kwargs) bool [source]
Stores an edge index in the graph store.
- sample_subgraph(seed_nodes: Tensor) SamplerOutput [source]
Sample the graph starting from the given nodes using the in-built NeighborSampler.
- Parameters:
seed_nodes (InputNodes) – Seed nodes to start sampling from.
num_neighbors (Optional[NumNeighborsType], optional) – Parameters to determine how many hops and number of neighbors per hop. Defaults to None.
- Returns:
- NeighborSamplerOutput
for the input.
- Return type:
Union[SamplerOutput, HeteroSamplerOutput]