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

from .base import VectorStore


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

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

    Returns:
        A VectorStore instance
    """
    if backend == "sqlite":
        from .sqlite import SQLiteVectorStore

        return SQLiteVectorStore(**kwargs)
    elif backend == "qdrant":
        from .qdrant import QdrantVectorStore

        return QdrantVectorStore(**kwargs)
    else:
        raise ValueError(f"Unknown vectorstore backend: {backend}")


__all__ = ["VectorStore", "create_vectorstore"]
