diff --git a/core/utils/maintenance/graph_data_operations.py b/core/utils/maintenance/graph_data_operations.py index 368ddb5f..ca2da0fa 100644 --- a/core/utils/maintenance/graph_data_operations.py +++ b/core/utils/maintenance/graph_data_operations.py @@ -13,17 +13,6 @@ async def build_indices_and_constraints(driver: AsyncDriver): - constraints: list[LiteralString] = [ - """ - CREATE CONSTRAINT entity_name IF NOT EXISTS - FOR (n:Entity) REQUIRE n.name IS UNIQUE - """, - """ - CREATE CONSTRAINT edge_facts IF NOT EXISTS - FOR ()-[e:RELATES_TO]-() REQUIRE e.fact IS UNIQUE - """, - ] - range_indices: list[LiteralString] = [ 'CREATE INDEX entity_uuid IF NOT EXISTS FOR (n:Entity) ON (n.uuid)', 'CREATE INDEX episode_uuid IF NOT EXISTS FOR (n:Episodic) ON (n.uuid)', @@ -64,7 +53,7 @@ async def build_indices_and_constraints(driver: AsyncDriver): """, ] index_queries: list[LiteralString] = ( - constraints + range_indices + fulltext_indices + vector_indices + range_indices + fulltext_indices + vector_indices ) await asyncio.gather(*[driver.execute_query(query) for query in index_queries]) diff --git a/examples/podcast/podcast_runner.py b/examples/podcast/podcast_runner.py index a279a0f5..cdb9fc9b 100644 --- a/examples/podcast/podcast_runner.py +++ b/examples/podcast/podcast_runner.py @@ -42,6 +42,7 @@ async def main(use_bulk: bool = True): setup_logging() client = Graphiti(neo4j_uri, neo4j_user, neo4j_password) await clear_data(client.driver) + await client.build_indices_and_constraints() messages = parse_podcast_messages() if not use_bulk: