Merge pull request #488 from naman06dev/main
feat: n8n + zapier integration page
|
|
@ -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
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npm install supermemory
|
||||
```
|
||||
|
||||
```bash pip
|
||||
pip install supermemory
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```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")
|
||||
)
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Quick Start
|
||||
|
||||
<CodeGroup>
|
||||
|
|
|
|||
|
|
@ -156,6 +156,13 @@
|
|||
"memory-router/with-memory-api"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Integrations with no-code tools",
|
||||
"pages": [
|
||||
"n8n",
|
||||
"zapier"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Migration Guides",
|
||||
"pages": ["migration/from-mem0"]
|
||||
|
|
|
|||
BIN
apps/docs/images/add-gmail-node-zapier.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
apps/docs/images/bearer-auth-add-n8n.png
Normal file
|
After Width: | Height: | Size: 228 KiB |
BIN
apps/docs/images/core-http-req.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
apps/docs/images/gmail-content.png
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
apps/docs/images/gmail-trigger.png
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
apps/docs/images/make-zap.png
Normal file
|
After Width: | Height: | Size: 570 KiB |
BIN
apps/docs/images/map-content-to-gmail.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
apps/docs/images/zapier-output.png
Normal file
|
After Width: | Height: | Size: 89 KiB |
|
|
@ -31,7 +31,8 @@ Monitor all documents currently being processed across your account.
|
|||
|
||||
<CodeGroup>
|
||||
|
||||
```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.
|
|||
|
||||
<CodeGroup>
|
||||
|
||||
```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 |
|
||||
|
||||
<Note>
|
||||
**Pro Tip**: Use the processing status endpoint to provide real-time feedback to users, especially for larger documents or batch uploads.
|
||||
</Note>
|
||||
```
|
||||
92
apps/docs/n8n.mdx
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
---
|
||||
title: "n8n Integration"
|
||||
description: "Automate knowledge management with Supermemory in n8n workflows"
|
||||
sidebarTitle: "n8n"
|
||||
---
|
||||
|
||||
Connect Supermemory to your n8n workflows to build intelligent automation workflows and agents that leverage your full knowledge base.
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- n8n instance (self-hosted or cloud)
|
||||
- Supermemory API key ([get one here](https://console.supermemory.com/settings))
|
||||
- Basic understanding of n8n workflows
|
||||
|
||||
### Setting Up the HTTP Request Node
|
||||
|
||||
The Supermemory integration in n8n uses the HTTP Request node to interact with the Supermemory API. Here's how to configure it:
|
||||
|
||||
1. Add an **HTTP Request** node to your workflow (Core > HTTP Request)
|
||||

|
||||
2. Set the **Method** to `POST`
|
||||
3. Set the **URL** to the appropriate Supermemory API endpoint:
|
||||
- Add memory: `https://api.supermemory.ai/v3/documents`
|
||||
- Search memories: `https://api.supermemory.ai/v4/search`
|
||||
4. For authentication, select **Generic Credential Type** and then **Bearer Auth**
|
||||
5. Click on **Create New Credential** and paste the Supermemory API Key in the Bearer Token field.
|
||||

|
||||
6. Check **Send Body** and select **JSON** as the Body Content Type. The fields depend on what API endpoint you're sending the request to. You can find detailed step-by-step examples below.
|
||||
|
||||
## Step-by-Step Tutorial
|
||||
|
||||
In this tutorial, we'll create a workflow that automatically adds every email from Gmail to your Supermemory knowledge base. We'll use the HTTP Request node to send email data to Supermemory's API, creating a searchable archive of all your communications.
|
||||
|
||||
### Adding Gmail Emails to Supermemory
|
||||
|
||||
Follow these steps to build a workflow that captures and stores your Gmail messages:
|
||||
|
||||
#### Step 1: Set Up Gmail Trigger
|
||||
|
||||

|
||||
|
||||
1. **Add a Gmail Trigger node** to your workflow
|
||||
2. Configure your Gmail credentials (OAuth2 recommended)
|
||||
3. Set the trigger to **Message Received**
|
||||
4. Optional: Add labels or filters to process specific emails only
|
||||
|
||||
#### Step 2: Configure HTTP Request Node
|
||||
|
||||
1. **Add an HTTP Request node** after the Gmail Trigger
|
||||
2. **Method**: `POST`
|
||||
3. **URL**: [`https://api.supermemory.ai/v3/documents`](/api-reference/manage-documents/add-document)
|
||||
4. Select your auth credentials you created with the Supermemory API Key.
|
||||
|
||||
#### Step 3: Format Email Data for Supermemory
|
||||
|
||||
In the HTTP Request node's **Body**, select **JSON** and **Using Fields Below**
|
||||
|
||||
And create 2 fields:
|
||||
|
||||
1. name: `content`, value: `{{ $json.snippet }}`
|
||||
2. name: `containerTag`, value: gmail
|
||||
|
||||
|
||||

|
||||
|
||||
#### Step 4: Handle Attachments (Optional)
|
||||
|
||||
If you want to process attachments:
|
||||
|
||||
1. **Add a Loop node** after the Gmail Trigger
|
||||
2. Loop through `{{$json.attachments}}`
|
||||
3. **Add a Gmail node** to download each attachment
|
||||
4. **Add another HTTP Request node** to store attachment metadata
|
||||
|
||||
|
||||
#### Step 5: Add Error Handling
|
||||
|
||||
1. **Add an Error Trigger node** connected to your workflow
|
||||
2. Configure it to catch errors from the HTTP Request node
|
||||
3. **Add a notification node** (Email, Slack, etc.) to alert you of failures
|
||||
4. Optional: Add a **Wait node** with retry logic
|
||||
|
||||
#### Step 6: Test Your Workflow
|
||||
|
||||
1. **Activate the workflow** in test mode
|
||||
2. Send a test email to your Gmail account
|
||||
3. Check the execution to ensure the email was captured
|
||||
4. Verify in Supermemory that the email appears in search results
|
||||
|
||||
Refer to the [API reference](/api-reference/manage-documents/add-document) to learn more about other supermemory API endpoints.
|
||||
|
|
@ -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
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npm install supermemory
|
||||
```
|
||||
|
||||
```bash pip
|
||||
pip install supermemory
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```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")
|
||||
)
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Search Endpoints Overview
|
||||
|
||||
|
|
|
|||
64
apps/docs/zapier.mdx
Normal file
|
|
@ -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.
|
||||
|
||||
<Steps>
|
||||
<Step title="Make a flow">
|
||||
Open your Zapier account and click on 'Zap' to make a new automation.
|
||||

|
||||
</Step>
|
||||
<Step title="Add Gmail node">
|
||||
Add a new Gmail node that gets triggered on every new email. Connect to your Google account.
|
||||

|
||||
</Step>
|
||||
<Step title="Add code block">
|
||||
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.
|
||||
|
||||

|
||||
</Step>
|
||||
<Step title="Integrate Supermemory">
|
||||
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.
|
||||
|
||||

|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Note>
|
||||
Sometimes Zapier might show an error on the first test run. It usually works right after. Weird bug, we know.
|
||||
</Note>
|
||||
|
||||
|
||||
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)
|
||||