diff --git a/apps/docs/add-memories/overview.mdx b/apps/docs/add-memories/overview.mdx index 6294147e..5b1ecaf0 100644 --- a/apps/docs/add-memories/overview.mdx +++ b/apps/docs/add-memories/overview.mdx @@ -6,6 +6,47 @@ sidebarTitle: "Overview" Add any type of content to Supermemory - text, files, URLs, images, videos, and more. Everything is automatically processed into searchable memories that form part of your intelligent knowledge graph. +## Prerequisites + +Before adding memories, you need to set up the Supermemory client: + +- **Install the SDK** for your language +- **Get your API key** from [Supermemory Console](https://console.supermemory.ai) +- **Initialize the client** with your API key + + + +```bash npm +npm install supermemory +``` + +```bash pip +pip install supermemory +``` + + + + + +```typescript TypeScript +import Supermemory from 'supermemory'; + +const client = new Supermemory({ + apiKey: process.env.SUPERMEMORY_API_KEY! +}); +``` + +```python Python +from supermemory import Supermemory +import os + +client = Supermemory( + api_key=os.environ.get("SUPERMEMORY_API_KEY") +) +``` + + + ## Quick Start diff --git a/apps/docs/docs.json b/apps/docs/docs.json index 207f2224..9ccea103 100644 --- a/apps/docs/docs.json +++ b/apps/docs/docs.json @@ -159,7 +159,8 @@ { "group": "Integrations with no-code tools", "pages": [ - "n8n" + "n8n", + "zapier" ] }, { diff --git a/apps/docs/images/add-gmail-node-zapier.png b/apps/docs/images/add-gmail-node-zapier.png new file mode 100644 index 00000000..c06b7a4c Binary files /dev/null and b/apps/docs/images/add-gmail-node-zapier.png differ diff --git a/apps/docs/images/make-zap.png b/apps/docs/images/make-zap.png new file mode 100644 index 00000000..17974a86 Binary files /dev/null and b/apps/docs/images/make-zap.png differ diff --git a/apps/docs/images/map-content-to-gmail.png b/apps/docs/images/map-content-to-gmail.png new file mode 100644 index 00000000..b0924a5a Binary files /dev/null and b/apps/docs/images/map-content-to-gmail.png differ diff --git a/apps/docs/images/zapier-output.png b/apps/docs/images/zapier-output.png new file mode 100644 index 00000000..8f9687f2 Binary files /dev/null and b/apps/docs/images/zapier-output.png differ diff --git a/apps/docs/memory-api/track-progress.mdx b/apps/docs/memory-api/track-progress.mdx index 60126dab..97a7f5bc 100644 --- a/apps/docs/memory-api/track-progress.mdx +++ b/apps/docs/memory-api/track-progress.mdx @@ -31,7 +31,8 @@ Monitor all documents currently being processed across your account. -```typescript +```typescript Typescript + // Direct API call (not in SDK) const response = await fetch('https://api.supermemory.ai/v3/documents/processing', { headers: { @@ -43,7 +44,7 @@ const processing = await response.json(); console.log(`${processing.documents.length} documents processing`); ``` -```python +```python Python # Direct API call (not in SDK) import requests @@ -56,7 +57,7 @@ processing = response.json() print(f"{len(processing['documents'])} documents processing") ``` -```bash +```bash cURL curl -X GET "https://api.supermemory.ai/v3/documents/processing" \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` @@ -103,7 +104,7 @@ Track specific document processing status. -```typescript +```typescript Typescript const memory = await client.memories.get("doc_abc123"); console.log(`Status: ${memory.status}`); @@ -116,7 +117,7 @@ while (memory.status !== 'done') { } ``` -```python +```python Python memory = client.memories.get("doc_abc123") print(f"Status: {memory['status']}") @@ -129,7 +130,7 @@ while memory['status'] != 'done': print(f"Status: {memory['status']}") ``` -```bash +```bash cURL curl -X GET "https://api.supermemory.ai/v3/documents/doc_abc123" \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` @@ -250,25 +251,4 @@ async function addWithRetry(content: string, maxRetries = 3) { } } } -``` - -## Processing Times by Content Type - -Documents: Created near instantly (200-500ms) - -Memories: Supermemory creates a memory graph understanding based on semantic analysis and contextual understanding. - -| Content Type | Memory Processing Time | Notes | -|--------------|------------------------|-------| -| Plain Text | 5-10 seconds | Fastest processing | -| Markdown | 5-10 seconds | Similar to plain text | -| PDF (< 10 pages) | 15-30 seconds | OCR if needed | -| PDF (> 100 pages) | 1-3 minutes | Depends on complexity | -| Images | 10-20 seconds | OCR processing | -| YouTube Videos | 1-2 min per 10 min video | Transcription required | -| Web Pages | 10-20 seconds | Content extraction | -| Google Docs | 10-15 seconds | API extraction | - - -**Pro Tip**: Use the processing status endpoint to provide real-time feedback to users, especially for larger documents or batch uploads. - +``` \ No newline at end of file diff --git a/apps/docs/n8n.mdx b/apps/docs/n8n.mdx index 352a088c..d3f50bd5 100644 --- a/apps/docs/n8n.mdx +++ b/apps/docs/n8n.mdx @@ -1,7 +1,6 @@ --- title: "n8n Integration" description: "Automate knowledge management with Supermemory in n8n workflows" -icon: "workflow" sidebarTitle: "n8n" --- diff --git a/apps/docs/search/overview.mdx b/apps/docs/search/overview.mdx index f1d65e2a..d95b611d 100644 --- a/apps/docs/search/overview.mdx +++ b/apps/docs/search/overview.mdx @@ -4,6 +4,46 @@ description: "Semantic and hybrid search with metadata filters, scoring, and pre sidebarTitle : "Overview" --- +## Prerequisites + +Before searching memories, you need to set up the Supermemory client: + +- **Install the SDK** for your language +- **Get your API key** from [Supermemory Console](https://console.supermemory.ai) +- **Initialize the client** with your API key + + + +```bash npm +npm install supermemory +``` + +```bash pip +pip install supermemory +``` + + + + + +```typescript TypeScript +import Supermemory from 'supermemory'; + +const client = new Supermemory({ + apiKey: process.env.SUPERMEMORY_API_KEY! +}); +``` + +```python Python +from supermemory import Supermemory +import os + +client = Supermemory( + api_key=os.environ.get("SUPERMEMORY_API_KEY") +) +``` + + ## Search Endpoints Overview diff --git a/apps/docs/zapier.mdx b/apps/docs/zapier.mdx new file mode 100644 index 00000000..d1e48b40 --- /dev/null +++ b/apps/docs/zapier.mdx @@ -0,0 +1,64 @@ +--- +title: "Integrate supermemory in your Zapier workflows" +sidebarTitle: "Zapier" +description: "Learn how to use the code block to integrate supermemory with Zapier and add memory to your automations." +--- + +With Supermemory you can now easily add memory to your Zapier workflow steps. Here's how: + +## Prerequisites +- A Supermemory API Key. Get yours [here](console.supermemory.ai) + +## Step-by-step tutorial + +For this tutorial, we're building a simple flow that adds incoming emails in Gmail to Supermemory. + + + + Open your Zapier account and click on 'Zap' to make a new automation. + ![make a zap - annotated](/images/make-zap.png) + + + Add a new Gmail node that gets triggered on every new email. Connect to your Google account. + ![add gmail](/images/add-gmail-node-zapier.png) + + + Now, add a new 'Code by Zapier' block. Set it up to run Python. + + In the **Input Data** section, map the content field to the Gmail raw snippet. + + ![](/images/map-content-to-gmail.png) + + + Since we're ingesting data here, we'll use the [add documents endpoint.](/api-reference/manage-documents/add-document) + + Add the following code block: + + ```python + import requests + + url = "https://api.supermemory.ai/v3/documents" + + payload = { "content": inputData['content'], "containerTag": "gmail" } + headers = { + "Authorization": "Bearer YOUR_SM_API_KEY", + "Content-Type": "application/json" + } + + response = requests.post(url, json=payload, headers=headers) + + print(response.json()) + ``` + + The `inputData['content']` field maps to the Gmail content fetched from Zapier. + + ![](/images/zapier-output.png) + + + + + Sometimes Zapier might show an error on the first test run. It usually works right after. Weird bug, we know. + + + +You can perform other operations like search, filtering, user profiles, etc., by using other Supermemory API endpoints which can be found in our [API Reference.](api-reference/search/search-memory-entries) \ No newline at end of file