haive.agents.memory.neo4j_schema¶

Neo4j schema initialization and Cypher templates for the Memory KG.

Schema:

(:Entity {name, type, user_id, created_at}) (:Memory {content, importance, user_id, created_at}) (:Summary {content, token_count, user_id, created_at})

Relationships:

(Entity)-[:RELATES_TO {predicate}]->(Entity) (Entity)-[:MENTIONED_IN]->(Memory) (Memory)-[:SUMMARIZED_BY]->(Summary)

Compatible with the existing graph_db RAG agent’s Neo4j patterns. Uses same env vars: NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD, NEO4J_DATABASE.

Functions¶

init_schema(driver[, database])

Initialize the Neo4j schema with constraints and indexes.

Module Contents¶

haive.agents.memory.neo4j_schema.init_schema(driver, database='neo4j')¶

Initialize the Neo4j schema with constraints and indexes.

Parameters:
  • driver – Neo4j driver instance

  • database (str) – Database name

Return type:

None