Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

Fix failing tests (#3304)

Parshva Daftaric89dc72f795f
diff --git a/examples/graph-db-demo/neptune-example.ipynb b/examples/graph-db-demo/neptune-example.ipynb
index acbbbdc44..e10f970e4 100644
--- a/examples/graph-db-demo/neptune-example.ipynb
+++ b/examples/graph-db-demo/neptune-example.ipynb
@@ -88,14 +88,16 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"from mem0 import Memory\n",
"import os\n",
"import logging\n",
"import sys\n",
"import boto3\n",
- "from opensearchpy import OpenSearch, RequestsHttpConnection, AWSV4SignerAuth\n",
+ "from opensearchpy import RequestsHttpConnection, AWSV4SignerAuth\n",
"from dotenv import load_dotenv\n",
"\n",
"load_dotenv()\n",
@@ -110,9 +112,7 @@
" datefmt=\"%Y-%m-%d %H:%M:%S\",\n",
" stream=sys.stdout, # Explicitly set output to stdout\n",
")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
@@ -126,7 +126,9 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"bedrock_embedder_model = \"amazon.titan-embed-text-v2:0\"\n",
"bedrock_llm_model = \"us.anthropic.claude-3-7-sonnet-20250219-v1:0\"\n",
@@ -176,9 +178,7 @@
" },\n",
" },\n",
"}"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
@@ -191,7 +191,9 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"m = Memory.from_config(config_dict=config)\n",
"\n",
@@ -199,9 +201,7 @@
"user_id = \"alice\"\n",
"\n",
"m.delete_all(user_id=user_id)"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
@@ -214,7 +214,9 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"messages = [\n",
" {\n",
@@ -232,13 +234,11 @@
"\n",
"for e in all_results[\"relations\"]:\n",
" print(f\"edge \\\"{e['source']}\\\" --{e['relationship']}--> \\\"{e['target']}\\\"\")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"## Graph Explorer Visualization\n",
"\n",
@@ -262,7 +262,9 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"messages = [\n",
" {\n",
@@ -280,13 +282,11 @@
"\n",
"for e in all_results[\"relations\"]:\n",
" print(f\"edge \\\"{e['source']}\\\" --{e['relationship']}--> \\\"{e['target']}\\\"\")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"### Graph Explorer Visualization Example\n",
"\n",
@@ -304,7 +304,9 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"messages = [\n",
" {\n",
@@ -322,13 +324,11 @@
"\n",
"for e in all_results[\"relations\"]:\n",
" print(f\"edge \\\"{e['source']}\\\" --{e['relationship']}--> \\\"{e['target']}\\\"\")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"### Graph Explorer Visualization Example\n",
"\n",
@@ -348,7 +348,9 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"messages = [\n",
" {\n",
@@ -366,13 +368,11 @@
"\n",
"for e in all_results[\"relations\"]:\n",
" print(f\"edge \\\"{e['source']}\\\" --{e['relationship']}--> \\\"{e['target']}\\\"\")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"### Graph Explorer Visualization Example\n",
"\n",
@@ -404,30 +404,30 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"search_results = m.search(\"what does alice love?\", user_id=user_id)\n",
"for result in search_results[\"results\"]:\n",
" print(f\"\\\"{result['memory']}\\\" [score: {result['score']}]\")\n",
"for relation in search_results[\"relations\"]:\n",
" print(f\"{relation}\")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"metadata": {},
+ "outputs": [],
"source": [
"m.delete_all(user_id)\n",
"m.reset()"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"## Conclusion\n",
"\n",