| name | add-memory |
| description | Scaffold a new memory storage backend for spaceduck |
Add Memory Backend
Scaffolds a new memory storage backend under packages/memory/<name>/.
Steps
- Ask for the backend name (e.g., "pinecone", "pgvector", "milvus", "turbopuffer")
- Determine if the backend needs an
EmbeddingProvider (vector DBs do, text-search backends don't)
- Create the directory structure:
packages/memory/<name>/
package.json # @spaceduck/memory-<name>, depends on @spaceduck/core
src/
store.ts # <Name>ConversationStore implements ConversationStore
long-term.ts # <Name>LongTermMemory implements LongTermMemory
index.ts # barrel export
__tests__/
store.test.ts
long-term.test.ts
- Implement the
ConversationStore interface:
import type { ConversationStore, Conversation, Message, Result, MemoryError, Lifecycle } from "@spaceduck/core";
export class <Name>ConversationStore implements ConversationStore, Lifecycle {
}
- Implement the
LongTermMemory interface:
import type { LongTermMemory, Fact, Lifecycle } from "@spaceduck/core";
export class <Name>LongTermMemory implements LongTermMemory, Lifecycle {
}
- Wire the backend in
@spaceduck/gateway as an alternative to the default SQLite backend
- Write integration tests using real DB connections (or in-memory variants)