"""GraphStore plugin system for TrustMem."""
from __future__ import annotations

from .base import GraphStore


def create_graphstore(backend: str = "sqlite", **kwargs) -> GraphStore:
    """Factory function to create a GraphStore instance.

    Args:
        backend: One of "sqlite", "neo4j"
        **kwargs: Backend-specific configuration

    Returns:
        A GraphStore instance
    """
    if backend == "sqlite":
        from .sqlite import SQLiteGraphStore

        return SQLiteGraphStore(**kwargs)
    elif backend == "neo4j":
        from .neo4j import Neo4jGraphStore

        return Neo4jGraphStore(**kwargs)
    else:
        raise ValueError(f"Unknown graphstore backend: {backend}")


__all__ = ["GraphStore", "create_graphstore"]
