From 8b09866bb7c51296cdcf514752e5585e6dd73b0f Mon Sep 17 00:00:00 2001
From: Dhravya <63950637+Dhravya@users.noreply.github.com>
Date: Mon, 27 Apr 2026 19:40:46 +0000
Subject: [PATCH] docs: fix Python examples to use real APIs, remove fabricated
imports
- E2B/Daytona: Python tabs now show mount pattern (not @supermemory/bash
which is TypeScript-only)
- E2B/Daytona: section intros updated to explain per-language approach
- Daytona: removed redundant 'Alternative: Mount' section (Python tab
already covers the mount pattern with TLS warning)
- E2B/Daytona: Python install commands no longer list supermemory package
---
apps/docs/smfs/providers/daytona.mdx | 98 +++++++++-------------------
apps/docs/smfs/providers/e2b.mdx | 59 +++++++++++------
2 files changed, 68 insertions(+), 89 deletions(-)
diff --git a/apps/docs/smfs/providers/daytona.mdx b/apps/docs/smfs/providers/daytona.mdx
index b393a748..4d1d71ce 100644
--- a/apps/docs/smfs/providers/daytona.mdx
+++ b/apps/docs/smfs/providers/daytona.mdx
@@ -60,17 +60,17 @@ Daytona sandboxes run full Linux with shell access, filesystem, and network. The
```bash
- pip install supermemory daytona-sdk
+ pip install daytona-sdk
```
## 3. Build an agent with memory + code execution
-The recommended pattern: your agent code uses `@supermemory/bash` for memory and the Daytona SDK for code execution. The LLM gets both as tools.
-
+ The recommended TypeScript pattern: use `@supermemory/bash` for memory in your orchestrating code and the Daytona SDK for code execution. The LLM gets both as tools.
+
```typescript agent.ts
import { createBash } from "@supermemory/bash";
import { Daytona } from "@daytonaio/sdk";
@@ -123,18 +123,17 @@ The recommended pattern: your agent code uses `@supermemory/bash` for memory and
```
+ In Python, install and mount SMFS inside the Daytona sandbox. The agent reads and writes memory via standard shell commands.
+
+
+ This requires unrestricted outbound HTTPS from the sandbox. If `smfs login` fails with a connection error, see the note at the top of this page.
+
+
```python agent.py
import os
- from supermemory import create_bash
from daytona_sdk import Daytona, DaytonaConfig
- # 1. Set up memory (SMFS bash tool — runs in your code, not the sandbox)
- bash = create_bash(
- api_key=os.environ["SUPERMEMORY_API_KEY"],
- container_tag="agent_memory",
- )
-
- # 2. Set up code execution (Daytona sandbox)
+ # 1. Set up code execution (Daytona sandbox)
config = DaytonaConfig(
api_key=os.environ["DAYTONA_API_KEY"],
api_url="https://app.daytona.io/api",
@@ -142,73 +141,36 @@ The recommended pattern: your agent code uses `@supermemory/bash` for memory and
daytona = Daytona(config)
sandbox = daytona.create()
- # 3. Read memory from your orchestrating code
- profile = bash.exec("cat /profile.md")
- print(profile.stdout)
+ # 2. Install SMFS inside the sandbox
+ sandbox.process.exec(
+ "curl -fsSL https://smfs.ai/install | sh"
+ )
- # 4. Execute code in the sandbox
- response = sandbox.process.exec("python3 -c 'print(\"Hello from Daytona!\")'")
+ # 3. Log in and mount
+ sandbox.process.exec(
+ f"~/.local/bin/smfs login --key {os.environ['SUPERMEMORY_API_KEY']}"
+ )
+ sandbox.process.exec(
+ "~/.local/bin/smfs mount agent_memory --ephemeral"
+ )
+
+ # 4. Read the auto-generated profile
+ response = sandbox.process.exec("cat agent_memory/profile.md")
print(response.result)
- # 5. Semantic search across memory
- results = bash.exec("sgrep 'preferred language'")
- print(results.stdout)
+ # 5. Semantic search
+ response = sandbox.process.exec(
+ "~/.local/bin/smfs grep 'preferred language'"
+ )
+ print(response.result)
# 6. Clean up
+ sandbox.process.exec("~/.local/bin/smfs unmount agent_memory")
daytona.delete(sandbox)
```
-## Alternative: Mount SMFS inside the sandbox
-
-If your Daytona sandbox has unrestricted network access, you can install and mount SMFS directly inside it. This gives the agent a real filesystem it can navigate with standard Unix commands.
-
-
- Some Daytona datacenter IPs are blocked by upstream firewalls. If `smfs login` or `smfs mount` fails with a TLS connection error from inside the sandbox, switch to the **Bash Tool** pattern above — it runs in your orchestrating code where network access is unrestricted.
-
-
-```python
-from daytona_sdk import Daytona, DaytonaConfig
-import os
-
-config = DaytonaConfig(
- api_key=os.environ["DAYTONA_API_KEY"],
- api_url="https://app.daytona.io/api",
-)
-daytona = Daytona(config)
-sandbox = daytona.create()
-
-# Install SMFS
-sandbox.process.exec("curl -fsSL https://smfs.ai/install | sh")
-
-# Log in
-sandbox.process.exec(
- f"~/.local/bin/smfs login --key {os.environ['SUPERMEMORY_API_KEY']}"
-)
-
-# Mount with ephemeral mode (recommended for sandboxes)
-sandbox.process.exec(
- "~/.local/bin/smfs mount agent_memory --ephemeral --path /memory"
-)
-
-# Now the agent can use standard Unix commands
-result = sandbox.process.exec("cat /memory/profile.md")
-print(result.result)
-
-# Semantic grep works inside the mount
-result = sandbox.process.exec("cd /memory && grep 'standup'")
-print(result.result)
-
-# Clean up
-sandbox.process.exec("~/.local/bin/smfs unmount agent_memory")
-daytona.delete(sandbox)
-```
-
-
- Use `--ephemeral` when mounting inside sandboxes. It keeps the cache in memory only — nothing persists locally after unmount, but writes still push to Supermemory.
-
-
## Tips
- **Use `--ephemeral` for sandboxes.** Sandbox filesystems are temporary. Ephemeral mode avoids writing a local SQLite cache that will be thrown away.
diff --git a/apps/docs/smfs/providers/e2b.mdx b/apps/docs/smfs/providers/e2b.mdx
index f86490e4..7b2042b0 100644
--- a/apps/docs/smfs/providers/e2b.mdx
+++ b/apps/docs/smfs/providers/e2b.mdx
@@ -51,17 +51,17 @@ E2B sandboxes are ephemeral Linux microVMs with full shell access and unrestrict
```bash
- pip install supermemory e2b-code-interpreter
+ pip install e2b-code-interpreter
```
## 3. Build an agent with memory + code execution
-The recommended pattern: your agent code uses `@supermemory/bash` for memory and the E2B SDK for code execution. The LLM gets both as tools.
-
+ The recommended TypeScript pattern: use `@supermemory/bash` for memory in your orchestrating code and the E2B SDK for code execution. The LLM gets both as tools.
+
```typescript agent.ts
import { createBash } from "@supermemory/bash";
import { Sandbox } from "@e2b/code-interpreter";
@@ -110,33 +110,50 @@ The recommended pattern: your agent code uses `@supermemory/bash` for memory and
```
+ In Python, mount SMFS inside the E2B sandbox. The agent reads and writes memory via standard shell commands.
+
```python agent.py
import os
- from supermemory import create_bash
from e2b_code_interpreter import Sandbox
- # 1. Set up memory (SMFS bash tool — runs in your code, not the sandbox)
- bash = create_bash(
- api_key=os.environ["SUPERMEMORY_API_KEY"],
- container_tag="agent_memory",
- )
-
- # 2. Set up code execution (E2B sandbox)
+ # 1. Create an E2B sandbox
sandbox = Sandbox.create(timeout=300)
- # 3. Read memory from your orchestrating code
- profile = bash.exec("cat /profile.md")
- print(profile.stdout)
+ # 2. Fix FUSE permissions (required in E2B sandboxes)
+ sandbox.commands.run("sudo chmod 666 /dev/fuse")
+ sandbox.commands.run(
+ "echo 'user_allow_other' | sudo tee -a /etc/fuse.conf > /dev/null"
+ )
- # 4. Execute code in the sandbox
- execution = sandbox.run_code("print('Hello from E2B!')")
- print(execution.text)
+ # 3. Install SMFS and log in
+ sandbox.commands.run("curl -fsSL https://smfs.ai/install | sh")
+ sandbox.commands.run(
+ f"~/.local/bin/smfs login --key {os.environ['SUPERMEMORY_API_KEY']}"
+ )
- # 5. Semantic search across memory
- results = bash.exec("sgrep 'preferred language'")
- print(results.stdout)
+ # 4. Mount memory
+ sandbox.commands.run(
+ "bash -c '~/.local/bin/smfs mount agent_memory --ephemeral"
+ " --path /home/user/memory --foreground > /tmp/smfs.log 2>&1"
+ " & sleep 5 && echo MOUNTED'",
+ timeout=15,
+ )
- # 6. Clean up
+ # 5. Read the auto-generated profile
+ result = sandbox.commands.run("cat /home/user/memory/profile.md")
+ print(result.stdout)
+
+ # 6. Semantic search
+ result = sandbox.commands.run(
+ "~/.local/bin/smfs grep 'preferred language'"
+ )
+ print(result.stdout)
+
+ # 7. Clean up
+ sandbox.commands.run(
+ "~/.local/bin/smfs unmount agent_memory 2>/dev/null",
+ timeout=10,
+ )
sandbox.kill()
```