The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
Doc: Add Org/Proj Id to API reference (#2095)
Dev Khant9032e68917c9
diff --git a/docs/openapi.json b/docs/openapi.jsonindex 948199363..d515c490c 100644--- a/docs/openapi.json+++ b/docs/openapi.json@@ -101,7 +101,7 @@"schema": {"type": "string"},- "description": "Filter entities by organization name"+ "description": "Filter entities by organization name. Will be deprecated soon, use `org_id` instead."},{"name": "project_name",@@ -109,7 +109,23 @@"schema": {"type": "string"},- "description": "Filter entities by project name"+ "description": "Filter entities by project name. Will be deprecated soon, use `project_id` instead."+ },+ {+ "name": "org_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter entities by organization ID."+ },+ {+ "name": "project_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter entities by project ID."}],"responses": {@@ -443,7 +459,7 @@"schema": {"type": "string"},- "description": "Filter memories by organization name"+ "description": "Filter memories by organization name. Will be deprecated soon, use `org_id` instead."},{"name": "project_name",@@ -451,7 +467,23 @@"schema": {"type": "string"},- "description": "Filter memories by project name"+ "description": "Filter memories by project name. Will be deprecated soon, use `project_id` instead."+ },+ {+ "name": "org_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter memories by organization ID."+ },+ {+ "name": "project_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter memories by project ID."},{"name":"keywords",@@ -668,19 +700,19 @@},{"lang": "cURL",- "source": "curl --request POST \\\n --url https://api.mem0.ai/v1/memories/ \\\n --header 'Authorization: <api-key>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"messages\": [\n {}\n ],\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"app_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"metadata\": {},\n \"includes\": \"<string>\",\n \"excludes\": \"<string>\",\n \"infer\": true,\n \"custom_categories\": {},\n \"org_name\": \"<string>\",\n \"project_name\": \"<string>\"\n}'"+ "source": "curl --request POST \\\n --url https://api.mem0.ai/v1/memories/ \\\n --header 'Authorization: <api-key>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"messages\": [\n {}\n ],\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"app_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"metadata\": {},\n \"includes\": \"<string>\",\n \"excludes\": \"<string>\",\n \"infer\": true,\n \"custom_categories\": {},\n \"org_name\": \"<string>\",\n \"project_name\": \"<string>\", \n \"org_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}'"},{"lang": "Go",- "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.mem0.ai/v1/memories/\"\n\n\tpayload := strings.NewReader(\"{\n \\\"messages\\\": [\n {}\n ],\n \\\"agent_id\\\": \\\"<string>\\\",\n \\\"user_id\\\": \\\"<string>\\\",\n \\\"app_id\\\": \\\"<string>\\\",\n \\\"run_id\\\": \\\"<string>\\\",\n \\\"metadata\\\": {},\n \\\"includes\\\": \\\"<string>\\\",\n \\\"excludes\\\": \\\"<string>\\\",\n \\\"infer\\\": true,\n \\\"custom_categories\\\": {},\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"<api-key>\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"+ "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.mem0.ai/v1/memories/\"\n\n\tpayload := strings.NewReader(\"{\n \\\"messages\\\": [\n {}\n ],\n \\\"agent_id\\\": \\\"<string>\\\",\n \\\"user_id\\\": \\\"<string>\\\",\n \\\"app_id\\\": \\\"<string>\\\",\n \\\"run_id\\\": \\\"<string>\\\",\n \\\"metadata\\\": {},\n \\\"includes\\\": \\\"<string>\\\",\n \\\"excludes\\\": \\\"<string>\\\",\n \\\"infer\\\": true,\n \\\"custom_categories\\\": {},\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\", \n \\\"org_id\\\": \\\"<string>\\\",\n \\\"project_id\\\": \\\"<string>\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"<api-key>\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang": "PHP",- "source": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n CURLOPT_URL => \"https://api.mem0.ai/v1/memories/\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"{\n \\\"messages\\\": [\n {}\n ],\n \\\"agent_id\\\": \\\"<string>\\\",\n \\\"user_id\\\": \\\"<string>\\\",\n \\\"app_id\\\": \\\"<string>\\\",\n \\\"run_id\\\": \\\"<string>\\\",\n \\\"metadata\\\": {},\n \\\"includes\\\": \\\"<string>\\\",\n \\\"excludes\\\": \\\"<string>\\\",\n \\\"infer\\\": true,\n \\\"custom_categories\\\": {},\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: <api-key>\",\n \"Content-Type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"+ "source": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n CURLOPT_URL => \"https://api.mem0.ai/v1/memories/\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"{\n \\\"messages\\\": [\n {}\n ],\n \\\"agent_id\\\": \\\"<string>\\\",\n \\\"user_id\\\": \\\"<string>\\\",\n \\\"app_id\\\": \\\"<string>\\\",\n \\\"run_id\\\": \\\"<string>\\\",\n \\\"metadata\\\": {},\n \\\"includes\\\": \\\"<string>\\\",\n \\\"excludes\\\": \\\"<string>\\\",\n \\\"infer\\\": true,\n \\\"custom_categories\\\": {},\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\", \n \\\"org_id\\\": \\\"<string>\\\",\n \\\"project_id\\\": \\\"<string>\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: <api-key>\",\n \"Content-Type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"},{"lang": "Java",- "source": "HttpResponse<String> response = Unirest.post(\"https://api.mem0.ai/v1/memories/\")\n .header(\"Authorization\", \"<api-key>\")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"messages\\\": [\n {}\n ],\n \\\"agent_id\\\": \\\"<string>\\\",\n \\\"user_id\\\": \\\"<string>\\\",\n \\\"app_id\\\": \\\"<string>\\\",\n \\\"run_id\\\": \\\"<string>\\\",\n \\\"metadata\\\": {},\n \\\"includes\\\": \\\"<string>\\\",\n \\\"excludes\\\": \\\"<string>\\\",\n \\\"infer\\\": true,\n \\\"custom_categories\\\": {},\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\"\n}\")\n .asString();"+ "source": "HttpResponse<String> response = Unirest.post(\"https://api.mem0.ai/v1/memories/\")\n .header(\"Authorization\", \"<api-key>\")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"messages\\\": [\n {}\n ],\n \\\"agent_id\\\": \\\"<string>\\\",\n \\\"user_id\\\": \\\"<string>\\\",\n \\\"app_id\\\": \\\"<string>\\\",\n \\\"run_id\\\": \\\"<string>\\\",\n \\\"metadata\\\": {},\n \\\"includes\\\": \\\"<string>\\\",\n \\\"excludes\\\": \\\"<string>\\\",\n \\\"infer\\\": true,\n \\\"custom_categories\\\": {},\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\", \n \\\"org_id\\\": \\\"<string>\\\",\n \\\"project_id\\\": \\\"<string>\"\n}\")\n .asString();"}],"x-codegen-request-body-name": "data"@@ -740,7 +772,7 @@"schema": {"type": "string"},- "description": "Filter memories by organization name"+ "description": "Filter memories by organization name. Will be deprecated soon, use `org_id` instead."},{"name": "project_name",@@ -748,7 +780,23 @@"schema": {"type": "string"},- "description": "Filter memories by project name"+ "description": "Filter memories by project name. Will be deprecated soon, use `project_id` instead."+ },+ {+ "name": "org_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter memories by organization ID."+ },+ {+ "name": "project_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter memories by project ID."}],"responses": {@@ -822,7 +870,7 @@"schema": {"type": "string"},- "description": "Filter memories by organization name"+ "description": "Filter memories by organization name. Will be deprecated soon, use `org_id` instead."},{"name": "project_name",@@ -830,7 +878,23 @@"schema": {"type": "string"},- "description": "Filter memories by project name"+ "description": "Filter memories by project name. Will be deprecated soon, use `project_id` instead."+ },+ {+ "name": "org_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter memories by organization ID."+ },+ {+ "name": "project_id",+ "in": "query",+ "schema": {+ "type": "string"+ },+ "description": "Filter memories by project ID."},{"name": "page",@@ -1094,7 +1158,7 @@},{"lang": "cURL",- "source": "curl --request POST \\\n --url https://api.mem0.ai/v1/memories/search/ \\\n --header 'Authorization: <api-key>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"query\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"app_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"metadata\": {},\n \"top_k\": 123,\n \"fields\": [\n \"<string>\"\n ],\n \"rerank\": true,\n \"org_name\": \"<string>\",\n \"project_name\": \"<string>\"\n}'"+ "source": "curl --request POST \\\n --url https://api.mem0.ai/v1/memories/search/ \\\n --header 'Authorization: <api-key>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"query\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"app_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"metadata\": {},\n \"top_k\": 123,\n \"fields\": [\n \"<string>\"\n ],\n \"rerank\": true,\n \"org_name\": \"<string>\",\n \"project_name\": \"<string>\", \n \"org_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}'"},{"lang": "Go",@@ -1223,19 +1287,19 @@},{"lang": "cURL",- "source": "curl --request POST \\\n --url https://api.mem0.ai/v2/memories/search/ \\\n --header 'Authorization: <api-key>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"query\": \"<string>\",\n \"filters\": {},\n \"top_k\": 123,\n \"fields\": [\n \"<string>\"\n ],\n \"rerank\": true,\n \"org_name\": \"<string>\",\n \"project_name\": \"<string>\"\n}'"+ "source": "curl --request POST \\\n --url https://api.mem0.ai/v2/memories/search/ \\\n --header 'Authorization: <api-key>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"query\": \"<string>\",\n \"filters\": {},\n \"top_k\": 123,\n \"fields\": [\n \"<string>\"\n ],\n \"rerank\": true,\n \"org_name\": \"<string>\",\n \"project_name\": \"<string>\",\n \"org_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}'"},{"lang": "Go",- "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.mem0.ai/v2/memories/search/\"\n\n\tpayload := strings.NewReader(\"{\n \\\"query\\\": \\\"<string>\\\",\n \\\"filters\\\": {},\n \\\"top_k\\\": 123,\n \\\"fields\\\": [\n \\\"<string>\\\"\n ],\n \\\"rerank\\\": true,\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"<api-key>\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"+ "source": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.mem0.ai/v2/memories/search/\"\n\n\tpayload := strings.NewReader(\"{\n \\\"query\\\": \\\"<string>\\\",\n \\\"filters\\\": {},\n \\\"top_k\\\": 123,\n \\\"fields\\\": [\n \\\"<string>\\\"\n ],\n \\\"rerank\\\": true,\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\",\n \\\"org_id\\\": \\\"<string>\\\",\n \\\"project_id\\\": \\\"<string>\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"<api-key>\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang": "PHP",- "source": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n CURLOPT_URL => \"https://api.mem0.ai/v2/memories/search/\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"{\n \\\"query\\\": \\\"<string>\\\",\n \\\"filters\\\": {},\n \\\"top_k\\\": 123,\n \\\"fields\\\": [\n \\\"<string>\\\"\n ],\n \\\"rerank\\\": true,\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: <api-key>\",\n \"Content-Type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"+ "source": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n CURLOPT_URL => \"https://api.mem0.ai/v2/memories/search/\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"{\n \\\"query\\\": \\\"<string>\\\",\n \\\"filters\\\": {},\n \\\"top_k\\\": 123,\n \\\"fields\\\": [\n \\\"<string>\\\"\n ],\n \\\"rerank\\\": true,\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\",\n \\\"org_id\\\": \\\"<string>\\\",\n \\\"project_id\\\": \\\"<string>\\\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: <api-key>\",\n \"Content-Type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"},{"lang": "Java",- "source": "HttpResponse<String> response = Unirest.post(\"https://api.mem0.ai/v2/memories/search/\")\n .header(\"Authorization\", \"<api-key>\")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"query\\\": \\\"<string>\\\",\n \\\"filters\\\": {},\n \\\"top_k\\\": 123,\n \\\"fields\\\": [\n \\\"<string>\\\"\n ],\n \\\"rerank\\\": true,\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\"\n}\")\n .asString();"+ "source": "HttpResponse<String> response = Unirest.post(\"https://api.mem0.ai/v2/memories/search/\")\n .header(\"Authorization\", \"<api-key>\")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"query\\\": \\\"<string>\\\",\n \\\"filters\\\": {},\n \\\"top_k\\\": 123,\n \\\"fields\\\": [\n \\\"<string>\\\"\n ],\n \\\"rerank\\\": true,\n \\\"org_name\\\": \\\"<string>\\\",\n \\\"project_name\\\": \\\"<string>\\\",\n \\\"org_id\\\": \\\"<string>\\\",\n \\\"project_id\\\": \\\"<string>\\\"\n}\")\n .asString();"}],"x-codegen-request-body-name": "data"@@ -3888,16 +3952,28 @@"nullable": true},"org_name": {- "description": "The name of the organization associated with this memory.",+ "description": "The name of the organization associated with this memory. Will be deprecated soon use `org_id` instead.","title": "Organization name","type": "string","nullable": true},"project_name": {- "description": "The name of the project associated with this memory.",+ "description": "The name of the project associated with this memory. Will be deprecated soon use project_id instead.","title": "Project name","type": "string","nullable": true+ },+ "org_id": {+ "description": "The unique identifier of the organization associated with this memory.",+ "title": "Organization id",+ "type": "string",+ "nullable": true+ },+ "project_id": {+ "description": "The unique identifier of the project associated with this memory.",+ "title": "Project id",+ "type": "string",+ "nullable": true}}},@@ -3976,13 +4052,25 @@"title": "Organization Name","type": "string","nullable": true,- "description": "The name of the organization associated with the memory."+ "description": "The name of the organization associated with the memory. Will be deprecated soon use `org_id` instead."},"project_name": {"title": "Project Name","type": "string","nullable": true,- "description": "The name of the project associated with the memory."+ "description": "The name of the project associated with the memory. Will be deprecated soon use project_id instead."+ },+ "org_id": {+ "title": "Organization id",+ "type": "string",+ "nullable": true,+ "description": "The unique identifier of the organization associated with the memory."+ },+ "project_id": {+ "title": "Project id",+ "type": "string",+ "nullable": true,+ "description": "The unique identifier of the project associated with the memory."}}},@@ -4030,13 +4118,25 @@"title": "Organization Name","type": "string","nullable": true,- "description": "The name of the organization associated with the memory."+ "description": "The name of the organization associated with the memory. Will be deprecated soon use `org_id` instead."},"project_name": {"title": "Project Name","type": "string","nullable": true,- "description": "The name of the project associated with the memory."+ "description": "The name of the project associated with the memory. Will be deprecated soon use `project_id` instead."+ },+ "org_id": {+ "title": "Organization id",+ "type": "string",+ "nullable": true,+ "description": "The unique identifier of the organization associated with the memory."+ },+ "project_id": {+ "title": "Project id",+ "type": "string",+ "nullable": true,+ "description": "The unique identifier of the project associated with the memory."}}},