Memgraph wrapper for graph operations.
Parameters: url (Optional[str]): The URL of the Memgraph database server. username (Optional[str]): The username for database authentication. password (Optional[str]): The password for database authentication. database (str): The name of the database to connect to. Default is 'memgraph'. refresh_schema (bool): A flag whether to refresh schema information at initialization. Default is True. driver_config (Dict): Configuration passed to Neo4j Driver.
Security note: Make sure that the database connection uses credentials that are narrowly-scoped to only include necessary permissions. Failure to do so may result in data corruption or loss, since the calling code may attempt commands that would result in deletion, mutation of data if appropriately prompted or reading sensitive data if such data is present in the database. The best way to guard against such negative outcomes is to (as appropriate) limit the permissions granted to the credentials used with this tool.
See https://python.langchain.com/docs/security for more information.
MemgraphGraph(
self,
url: Optional[str] = None,
username: Optional[str] = None,
password: Optional[str] = None,
database: Optional[str] = None,
refresh_schema: bool = True,
*,
driver_config: Optional[Dict] = None
)Query the graph.
Refreshes the Memgraph graph schema information.
Take GraphDocument as input as uses it to construct a graph in Memgraph.
Parameters:
id property from the source document metadata
if available; otherwise it calculates the MD5 hash of page_content
for merging process. Defaults to False.