Replies: 1 comment 1 reply
-
|
To stop it being a breaking change you could actually just auto register the currently supported backends: class GraphStore:
_registered_backends = {}
@classmethod
def _register_core_backends(cls):
"""Auto-register core backends for backward compatibility."""
from .backends import Neo4jBackend, FalkorDBBackend
cls.register_backend("neo4j", Neo4jBackend)
cls.register_backend("falkordb", FalkorDBBackend)
def __init__(self, backend: str, **config):
if not self._registered_backends:
self._register_core_backends()
if backend not in self._registered_backends:
raise ValueError(
f"Backend '{backend}' not registered. "
f"Available: {list(self._registered_backends.keys())}. "
f"Register custom backends with GraphStore.register_backend()"
)You could then remove these for the next major release. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been working on adding the sqlite-vec vector store and while going through it theres a lot of bleed through in the different apis. There are times where I want to use a custom store or a store that would not be accepted into core (such as kuzudb, even with it being archived) and at the moment its not really possible to add a store without committing to core. For most of my stuff I don't mind committing it (other than it needs to be a bit more robust than I might need in prod 😬) but for some stuff it just doesnt make sense. Theres also a maintenance burden on semantica for accepting these contributions. People will expect these to be up to date and work if theyre in core.
If the store system moved to a plugin registry model, then someone could register their own store and just use it. You can still have a core set of support DBs but if theres more niche stuff then a user can use a third party lib or roll their own. Maybe a dev api something like this:
So if you wanted to implement the above api it would look something like below:
Currently, GraphStore has a hardcoded list of backends like neo4j and falkordb. So that would be replaced with the registry. Its the same for the VectorStore.
It wouldn't be a particularly complex change, but it would be a breaking change. You could do fancier things like auto plugin discovery but its overkill and comes with its own set of problems.
Anyway its just a bit of an idea I had while going through it and I thought it might be food for thought? In the mean time I'm still working away on the SQLite-vec store. Should have it in over the next few days. 👍
Beta Was this translation helpful? Give feedback.
All reactions