You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(storage): add libsql file-based storage with network volume support (#9)
* fix(docs): correct agent endpoint, model references, add experimental notice
- fix test-endpoint-agent.mjs to use /generate instead of /chat
- update README.md with correct model name (qwen3-32b-awq)
- update .runpod/README.md with experimental notice explaining:
- cold start time (20-40s) and flash boot coming for cpu
- load balancer is experimental for mastra api exposure
- recommend active workers = 1 to avoid cold start
- in-memory storage is file-based and lost when worker stops
* feat(storage): add libsql file-based storage with network volume support
- add libsql as storage backend when postgresql not configured
- detect /runpod-volume at runtime for persistent storage
- fallback to /tmp for ephemeral storage when no volume attached
- update documentation with three storage modes
This worker is **experimental** and designed to explore running AI agents on Runpod Serverless CPU endpoints.
14
+
15
+
### Current Limitations
16
+
17
+
**Cold Start Time:** CPU pods currently have a cold start time of 20-40 seconds. We are actively working on bringing **Flash Boot** to CPU pods (currently available for GPU pods) to enable instant startups.
18
+
19
+
**Load Balancer:** This worker uses the experimental Load Balancer endpoint type to expose Mastra's HTTP API directly, without requiring the Runpod Python SDK.
20
+
21
+
### Recommended Configuration
22
+
23
+
To avoid cold start delays, we recommend setting **Active Workers to 1** in your endpoint configuration. This keeps one worker always running and ready to handle requests immediately.
24
+
25
+
## Storage and Memory
26
+
27
+
The worker supports three storage modes for agent memory:
28
+
29
+
**Ephemeral (Default):** Without database credentials and no network volume, the worker uses LibSQL (SQLite) file storage at `/tmp/mastra-storage.db`. This data is **lost when the worker stops**.
30
+
31
+
**Network Volume (Persistent):** Attach a network volume to the endpoint. The worker automatically detects `/runpod-volume` and stores data at `/runpod-volume/mastra-storage.db`, surviving worker restarts.
32
+
33
+
**PostgreSQL (Persistent):** Configure a PostgreSQL database with the `pgvector` extension for full-featured persistent agent memory with vector embeddings.
34
+
11
35
## Endpoint Configuration
12
36
13
37
All behaviour is controlled through environment variables:
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Mastra production server running on Runpod Serverless CPU with Load Balancer sup
7
7
## Features
8
8
9
9
- Mastra Hono server with weather agent and tool (no API key required for weather)
10
-
- Runpod AI SDK provider with OpenAI GPT-OSS-120B support
10
+
- Runpod AI SDK provider with Qwen3-32B model support
11
11
-`/ping` health check endpoint for Runpod serverless load balancer
12
12
- PostgreSQL storage with PgVector for agent memory
13
13
- Observability and telemetry enabled (Mastra Cloud)
@@ -160,7 +160,7 @@ For local development and testing, you can run Mastra directly without building
160
160
- 🔌 **API Endpoints**: http://localhost:4111/api - REST API for agents
161
161
- 📚 **API Documentation**: http://localhost:4111/swagger-ui - Interactive API explorer
162
162
163
-
**Note:** Make sure the `runpod-mcp` project is built and available at `../runpod-mcp/build/index.js` for the RunPod Infra Management agent to work. If you haven't built it yet:
163
+
**Note:** Make sure the `runpod-mcp` project is built and available at `../runpod-mcp/build/index.js` for the Runpod Infra Management agent to work. If you haven't built it yet:
164
164
165
165
```bash
166
166
cd ../runpod-mcp
@@ -315,7 +315,7 @@ Once deployed, access at: `https://YOUR_ENDPOINT_ID.api.runpod.ai/`
@@ -18,7 +18,7 @@ This document outlines the key technical conventions and architectural decisions
18
18
- Agent memory: `PgVector` from `@mastra/pg` for embeddings (when DB credentials provided)
19
19
- Falls back to in-memory storage when no database credentials are configured
20
20
-**External Tool Integration:** MCP (Model Context Protocol) via `@mastra/mcp`
21
-
- MCP servers provide external tools to agents (e.g., RunPod API tools)
21
+
- MCP servers provide external tools to agents (e.g., Runpod API tools)
22
22
- MCP configuration in `src/mastra/mcp-config.ts` manages server connections
23
23
-**Project Structure:**
24
24
-`src/mastra/agents/` - Agent definitions
@@ -100,7 +100,7 @@ When all DB credentials are provided, PostgreSQL with PgVector is used. Otherwis
100
100
-**Memory Initialization:** Agents import `createAgentMemory()` from `utils/db.ts` - they do not handle database logic themselves.
101
101
-**Tool Integration:** Agents can use:
102
102
- Mastra Tools: Direct tool implementations (e.g., `weatherTool`)
103
-
- MCP Tools: External tools provided via MCP servers (e.g., RunPod API tools)
103
+
- MCP Tools: External tools provided via MCP servers (e.g., Runpod API tools)
104
104
-**MCP Integration:** MCP servers are configured in `src/mastra/mcp-config.ts`. Agents access MCP tools by importing the MCP client and filtering available tools as needed.
105
105
106
106
## Local Development
@@ -117,7 +117,7 @@ When all DB credentials are provided, PostgreSQL with PgVector is used. Otherwis
117
117
-**Docker Hub:** Images pushed to `runpod/worker-mastra:<version>`
118
118
-**Runpod Git Pipeline:** Configure to build and deploy on push to `main` branch
0 commit comments