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
Docs: Update v2 GET ALL endpoint (#2267)
Dev Khant308e79bb6892
diff --git a/docs/openapi.json b/docs/openapi.jsonindex 68e3fb1dc..12b6ddada 100644--- a/docs/openapi.json+++ b/docs/openapi.json@@ -1091,6 +1091,7 @@"created_at": {"type": "string", "format": "date-time"},"updated_at": {"type": "string", "format": "date-time"},"categories": {"type": "array", "items": {"type": "string"}},+ "metadata": {"type": "object"},"keywords": {"type": "string"}},"additionalProperties": {diff --git a/docs/platform/quickstart.mdx b/docs/platform/quickstart.mdxindex dafb819f2..69ac4c7ce 100644--- a/docs/platform/quickstart.mdx+++ b/docs/platform/quickstart.mdx@@ -1183,7 +1183,7 @@ Our advanced retrieval allows you to set custom filters when fetching memories.Here you need to define `version` as `v2` in the get_all method.-Example: Get all memories using user_id and date filters+Example 1. Get all memories using user_id and date filters<CodeGroup>@@ -1336,6 +1336,124 @@ curl -X GET "https://api.mem0.ai/v1/memories/?version=v2&page=1&page_size=50" \</CodeGroup>+Example 2: Search using metadata and categories Filters+<CodeGroup>+```python Python+filters = {+ "AND": [+ {"metadata": {"food": "vegan"}},+ {+ "categories":{+ "contains": "food_preferences"+ }+ }+ ]+}+# Default (No Pagination)+client.get_all(version="v2", filters=filters)++# Pagination (You can also use the page and page_size parameters)+client.get_all(version="v2", filters=filters, page=1, page_size=50)+```++```javascript JavaScript+const filters = {+ "AND": [+ {"metadata": {"food": "vegan"}},+ {+ "categories": {+ "contains": "food_preferences"+ }+ }+ ]+};++// Default (No Pagination)+client.getAll({ version: "v2", filters })+ .then(memories => console.log(memories))+ .catch(error => console.error(error));++// Pagination (You can also use the page and page_size parameters)+client.getAll({ version: "v2", filters, page: 1, page_size: 50 })+ .then(memories => console.log(memories))+ .catch(error => console.error(error));+```++```bash cURL+# Default (No Pagination)+curl -X GET "https://api.mem0.ai/v1/memories/?version=v2" \+ -H "Authorization: Token your-api-key" \+ -H "Content-Type: application/json" \+ -d '{+ "filters": {+ "AND": [+ {"metadata": {"food": "vegan"}},+ {+ "categories": {+ "contains": "food_preferences"+ }+ }+ ]+ }+ }'++# Pagination (You can also use the page and page_size parameters)+curl -X GET "https://api.mem0.ai/v1/memories/?version=v2&page=1&page_size=50" \+ -H "Authorization: Token your-api-key" \+ -H "Content-Type: application/json" \+ -d '{+ "filters": {+ "AND": [+ {"metadata": {"food": "vegan"}},+ {+ "categories": {+ "contains": "food_preferences"+ }+ }+ ]+ }+ }'+```++```json Output (Default)+[+ {+ "id":"f38b689d-6b24-45b7-bced-17fbb4d8bac7",+ "memory":"Name: Alex. Vegetarian. Allergic to nuts.",+ "user_id":"alex",+ "hash":"62bc074f56d1f909f1b4c2b639f56f6a",+ "metadata":{"food":"vegan"},+ "immutable": false,+ "created_at":"2024-07-25T23:57:00.108347-07:00",+ "updated_at":"2024-07-25T23:57:00.108367-07:00",+ "categories": ["food_preferences"]+ }+]+```++```json Output (Paginated)+{+ "count": 1,+ "next": null,+ "previous": null,+ "results": [+ {+ "id":"f38b689d-6b24-45b7-bced-17fbb4d8bac7",+ "memory":"Name: Alex. Vegetarian. Allergic to nuts.",+ "user_id":"alex",+ "hash":"62bc074f56d1f909f1b4c2b639f56f6a",+ "metadata":{"food":"vegan"},+ "immutable": false,+ "created_at":"2024-07-25T23:57:00.108347-07:00",+ "updated_at":"2024-07-25T23:57:00.108367-07:00",+ "categories": ["food_preferences"]+ }+ ]+}+```++</CodeGroup>+### 4.5 Memory HistoryGet history of how a memory has changed over time.