memvault 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # memvault
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/memvault?color=blue)](https://www.npmjs.com/package/memvault)
4
+ [![npm downloads](https://img.shields.io/npm/dm/memvault?color=blue)](https://www.npmjs.com/package/memvault)
4
5
  [![TypeScript](https://img.shields.io/badge/TypeScript-6.0-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
5
6
  [![Prisma](https://img.shields.io/badge/Prisma-7-2D3748?logo=prisma&logoColor=white)](https://www.prisma.io/)
6
7
  [![Tests](https://img.shields.io/badge/tests-58%20passing-brightgreen)](https://github.com/iamsaad640/memvault)
@@ -9,9 +10,9 @@
9
10
  [![OpenAI](https://img.shields.io/badge/OpenAI-supported-412991?logo=openai&logoColor=white)](https://platform.openai.com)
10
11
  [![Anthropic](https://img.shields.io/badge/Anthropic-supported-d4a574?logo=anthropic&logoColor=white)](https://docs.anthropic.com)
11
12
 
12
- > Persistent, tenant-isolated memory tools for AI agents. Prisma-powered. Drop-in tools for Vercel AI SDK, OpenAI, and Anthropic.
13
+ > Persistent, tenant-isolated memory tools for AI agents. Prisma-powered. Drop-in for Vercel AI SDK, OpenAI, and Anthropic.
13
14
 
14
- **No cloud. No Neo4j. No $249/mo paywall. Just your PostgreSQL.**
15
+ **No cloud. No $249/mo. Just your Postgres.**
15
16
 
16
17
  ## Install
17
18
 
@@ -21,18 +22,18 @@ npm install memvault
21
22
 
22
23
  ## Setup
23
24
 
24
- ### 1. Add the model to your Prisma schema
25
+ **1. Add to your Prisma schema:**
25
26
 
26
27
  ```prisma
27
28
  model MemvaultMemory {
28
- id String @id @default(cuid())
29
+ id String @id @default(cuid())
29
30
  tenantId String
30
- type String @default("general")
31
+ type String @default("general")
31
32
  content String
32
33
  metadata Json?
33
34
  tags String[]
34
- createdAt DateTime @default(now())
35
- updatedAt DateTime @updatedAt
35
+ createdAt DateTime @default(now())
36
+ updatedAt DateTime @updatedAt
36
37
  expiresAt DateTime?
37
38
 
38
39
  @@index([tenantId])
@@ -41,13 +42,13 @@ model MemvaultMemory {
41
42
  }
42
43
  ```
43
44
 
44
- ### 2. Run migration
45
+ **2. Migrate:**
45
46
 
46
47
  ```bash
47
48
  npx prisma migrate dev --name add-memvault
48
49
  ```
49
50
 
50
- ### 3. Create vault instance
51
+ **3. Create vault:**
51
52
 
52
53
  ```typescript
53
54
  import { MemVault } from "memvault"
@@ -55,7 +56,7 @@ import { MemVault } from "memvault"
55
56
  const vault = new MemVault({ db: prisma.memvaultMemory })
56
57
  ```
57
58
 
58
- ## Usage with AI SDKs
59
+ ## Usage
59
60
 
60
61
  ### Vercel AI SDK
61
62
 
@@ -68,135 +69,153 @@ const tools = createMemVaultTools({ vault, tenantId: user.id })
68
69
 
69
70
  const result = await generateText({
70
71
  model: anthropic("claude-sonnet-4-6"),
72
+ system: "Always recall user memories before responding. Save preferences with memvault_remember.",
71
73
  tools,
72
- prompt: "Help the user with their project"
74
+ messages,
75
+ maxSteps: 10,
73
76
  })
74
77
  ```
75
78
 
76
- ### OpenAI SDK
79
+ ### Anthropic SDK
77
80
 
78
81
  ```typescript
79
- import { createMemVaultTools } from "memvault/openai"
82
+ import { createMemVaultTools } from "memvault/anthropic"
80
83
 
81
84
  const { tools, handleToolCall } = createMemVaultTools({ vault, tenantId: user.id })
82
85
 
83
- const response = await openai.responses.create({
84
- model: "gpt-4o",
85
- tools,
86
- input: "Help the user..."
87
- })
88
-
89
- // Handle tool calls from the response
90
- for (const output of response.output) {
91
- if (output.type === "function_call") {
92
- const result = await handleToolCall(output.name, JSON.parse(output.arguments))
86
+ // Agentic loop keep calling until no more tool use
87
+ while (true) {
88
+ const response = await anthropic.messages.create({
89
+ model: "claude-sonnet-4-6",
90
+ max_tokens: 1024,
91
+ system: "Always recall user memories before responding. Save preferences with memvault_remember.",
92
+ tools,
93
+ messages,
94
+ })
95
+
96
+ messages.push({ role: "assistant", content: response.content })
97
+
98
+ const toolUses = response.content.filter((b) => b.type === "tool_use")
99
+ if (!toolUses.length) break
100
+
101
+ const results = []
102
+ for (const tu of toolUses) {
103
+ const result = await handleToolCall(tu.name, tu.input)
104
+ results.push({ type: "tool_result", tool_use_id: tu.id, content: result })
93
105
  }
106
+ messages.push({ role: "user", content: results })
94
107
  }
95
108
  ```
96
109
 
97
- ### Anthropic SDK
110
+ ### OpenAI SDK
98
111
 
99
112
  ```typescript
100
- import { createMemVaultTools } from "memvault/anthropic"
113
+ import { createMemVaultTools } from "memvault/openai"
101
114
 
102
115
  const { tools, handleToolCall } = createMemVaultTools({ vault, tenantId: user.id })
103
116
 
104
- const message = await anthropic.messages.create({
105
- model: "claude-sonnet-4-6",
106
- max_tokens: 1024,
107
- tools,
108
- messages: [{ role: "user", content: "Help me..." }]
109
- })
117
+ while (true) {
118
+ const response = await openai.chat.completions.create({
119
+ model: "gpt-4o",
120
+ tools,
121
+ messages,
122
+ })
123
+
124
+ const msg = response.choices[0].message
125
+ messages.push(msg)
126
+
127
+ if (!msg.tool_calls?.length) break
110
128
 
111
- // Handle tool calls from the response
112
- for (const block of message.content) {
113
- if (block.type === "tool_use") {
114
- const result = await handleToolCall(block.name, block.input)
129
+ for (const tc of msg.tool_calls) {
130
+ const result = await handleToolCall(tc.function.name, JSON.parse(tc.function.arguments))
131
+ messages.push({ role: "tool", tool_call_id: tc.id, content: result })
115
132
  }
116
133
  }
117
134
  ```
118
135
 
119
- ### Standalone (no LLM)
136
+ ## System Prompt
120
137
 
121
- ```typescript
122
- const tenant = vault.tenant("user-123")
123
-
124
- await tenant.remember({
125
- content: "Prefers dark mode",
126
- type: "preference",
127
- tags: ["ui", "theme"]
128
- })
138
+ Add this to your system prompt for consistent recall behavior across all models:
129
139
 
130
- const memories = await tenant.recall({ type: "preference" })
131
- await tenant.update(memoryId, { content: "Switched to light mode" })
132
- await tenant.forget(memoryId)
140
+ ```
141
+ Always call memvault_recall at the start of each conversation before responding.
142
+ Save anything the user tells you about their preferences or context with memvault_remember.
133
143
  ```
134
144
 
135
- ## Tools Provided
136
-
137
- Each SDK integration provides 4 tools:
145
+ Without this, some models (especially GPT-4o) may skip recall unless explicitly instructed.
138
146
 
139
- | Tool | Description |
140
- |------|-------------|
141
- | `memvault_remember` | Save information to persistent memory |
142
- | `memvault_recall` | Retrieve relevant memories with filters |
143
- | `memvault_update` | Update existing memories |
144
- | `memvault_forget` | Delete a specific memory |
147
+ ## Tools
145
148
 
146
- The LLM decides when to use each tool based on the built-in descriptions.
149
+ | Tool | When the model uses it |
150
+ |------|----------------------|
151
+ | `memvault_recall` | Start of conversation, or when user asks about preferences |
152
+ | `memvault_remember` | When user shares preferences, context, or feedback |
153
+ | `memvault_update` | When existing info changes |
154
+ | `memvault_forget` | When user asks to forget something |
147
155
 
148
156
  ## Tenant Isolation
149
157
 
150
- Every operation is scoped to a `tenantId`. No tenant can read, update, or delete another tenant's memories.
158
+ Every operation is scoped to a `tenantId`. No tenant can read or write another's memories — enforced at the query level, not the application level.
151
159
 
152
160
  ```typescript
153
161
  const alice = vault.tenant("alice")
154
162
  const bob = vault.tenant("bob")
155
163
 
156
- await alice.remember({ content: "Alice's secret" })
157
- await bob.recall() // Returns empty — Bob can't see Alice's memories
164
+ await alice.remember({ content: "Alice's preference" })
165
+ await bob.recall() // [] — Bob sees nothing
166
+ ```
167
+
168
+ ## Standalone API
169
+
170
+ ```typescript
171
+ const tenant = vault.tenant("user-123")
172
+
173
+ await tenant.remember({ content: "Prefers dark mode", type: "preference", tags: ["ui"] })
174
+ await tenant.recall({ type: "preference" })
175
+ await tenant.recall({ search: "dark" })
176
+ await tenant.update(id, { content: "Switched to light mode" })
177
+ await tenant.forget(id)
178
+ await tenant.forgetAll()
179
+ await tenant.count()
180
+
181
+ // TTL — auto-expires after N seconds
182
+ await tenant.remember({ content: "Temp session context", ttl: 3600 })
158
183
  ```
159
184
 
160
185
  ## Memory Types
161
186
 
162
- Organize memories by type:
187
+ Built-in: `preference`, `fact`, `feedback`, `project`, `reference`, `general`
163
188
 
164
- - `preference`User preferences and settings
165
- - `fact` — Facts about the user
166
- - `feedback` — User feedback on behavior
167
- - `project` — Project context and details
168
- - `reference` — Links and external references
169
- - `general` — Default catch-all
170
- - Any custom string
189
+ Any string works types are just a filter. Use whatever makes sense for your app.
171
190
 
172
- ## TTL (Time-to-Live)
191
+ ## API Reference
173
192
 
174
- Set temporary memories that auto-expire:
193
+ ### `MemVault`
175
194
 
176
195
  ```typescript
177
- await tenant.remember({
178
- content: "Currently debugging auth flow",
179
- type: "context",
180
- ttl: 3600 // expires in 1 hour
181
- })
196
+ new MemVault({ db: prisma.memvaultMemory })
197
+ vault.tenant(tenantId: string): TenantVault
182
198
  ```
183
199
 
184
- ## API
200
+ ### `TenantVault`
185
201
 
186
- ### `MemVault`
202
+ ```typescript
203
+ tenant.remember(input: MemoryInput): Promise<Memory>
204
+ tenant.recall(filter?: MemoryFilter): Promise<Memory[]>
205
+ tenant.get(id: string): Promise<Memory | null>
206
+ tenant.update(id: string, input: MemoryUpdate): Promise<Memory>
207
+ tenant.forget(id: string): Promise<void>
208
+ tenant.forgetAll(): Promise<number>
209
+ tenant.count(filter?: MemoryFilter): Promise<number>
210
+ ```
187
211
 
188
- - `new MemVault({ db })` — Create instance with Prisma delegate
189
- - `vault.tenant(tenantId)` — Get tenant-scoped vault
212
+ ### `createMemVaultTools(config)`
190
213
 
191
- ### `TenantVault`
214
+ ```typescript
215
+ { vault: MemVaultInstance, tenantId: string }
216
+ ```
192
217
 
193
- - `tenant.remember(input)` Save a memory
194
- - `tenant.recall(filter?)` — Query memories
195
- - `tenant.get(id)` — Get specific memory
196
- - `tenant.update(id, input)` — Update a memory
197
- - `tenant.forget(id)` — Delete a memory
198
- - `tenant.forgetAll()` — Delete all tenant memories
199
- - `tenant.count(filter?)` — Count memories
218
+ Returns `{ tools, handleToolCall }` for Anthropic/OpenAI, or a tools object for AI SDK.
200
219
 
201
220
  ## License
202
221
 
@@ -33,7 +33,7 @@ function createMemVaultTools(config) {
33
33
  }
34
34
  }),
35
35
  memvault_recall: tool({
36
- description: "Retrieve memories for this user. Use this BEFORE responding when you need context about the user's preferences, past conversations, project details, or any previously saved information. Always recall relevant memories to personalize your responses.",
36
+ description: "Retrieve memories for this user. Call this at the START of every conversation before responding \u2014 even if the user hasn't asked. Use it whenever you need context about preferences, past conversations, project details, or any previously saved information.",
37
37
  inputSchema: z.object({
38
38
  type: z.string().optional().describe("Filter by memory type, e.g. 'preference', 'project'"),
39
39
  tags: z.array(z.string()).optional().describe("Filter by tags \u2014 returns memories matching ANY of these tags"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/integrations/ai-sdk.ts"],"sourcesContent":["import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { MemVault } from \"../memvault.js\";\nimport type { ToolsConfig } from \"../types.js\";\n\n/**\n * Create drop-in memory tools for the Vercel AI SDK.\n *\n * Usage:\n * ```ts\n * import { createMemVaultTools } from \"memvault/ai-sdk\"\n *\n * const tools = createMemVaultTools({ vault, tenantId: user.id })\n *\n * const result = await generateText({\n * model: anthropic(\"claude-sonnet-4-6\"),\n * tools,\n * prompt: \"Help the user...\"\n * })\n * ```\n */\nexport function createMemVaultTools(config: ToolsConfig) {\n const tenant = config.vault.tenant(config.tenantId);\n\n return {\n memvault_remember: tool({\n description:\n \"Save important information to persistent memory for this user. \" +\n \"Use this when the user shares preferences, facts about themselves, \" +\n \"project context, feedback, or anything worth remembering across sessions. \" +\n \"Memories persist permanently unless given a TTL.\",\n inputSchema: z.object({\n content: z\n .string()\n .describe(\"The information to remember. Be specific and concise.\"),\n type: z\n .string()\n .optional()\n .describe(\n 'Category: \"preference\", \"fact\", \"feedback\", \"project\", \"reference\", or any custom type. Defaults to \"general\".',\n ),\n tags: z\n .array(z.string())\n .optional()\n .describe(\"Tags for categorization and filtering, e.g. ['ui', 'theme']\"),\n ttl: z\n .number()\n .optional()\n .describe(\n \"Time-to-live in seconds. Omit for permanent memory. Use for temporary/session info.\",\n ),\n }),\n execute: async (input) => {\n const memory = await tenant.remember({\n content: input.content,\n type: input.type,\n tags: input.tags,\n ttl: input.ttl,\n });\n return {\n success: true,\n id: memory.id,\n message: `Remembered: \"${memory.content}\" (type: ${memory.type})`,\n };\n },\n }),\n\n memvault_recall: tool({\n description:\n \"Retrieve memories for this user. Use this BEFORE responding when you need \" +\n \"context about the user's preferences, past conversations, project details, \" +\n \"or any previously saved information. Always recall relevant memories to \" +\n \"personalize your responses.\",\n inputSchema: z.object({\n type: z\n .string()\n .optional()\n .describe(\"Filter by memory type, e.g. 'preference', 'project'\"),\n tags: z\n .array(z.string())\n .optional()\n .describe(\"Filter by tags — returns memories matching ANY of these tags\"),\n search: z\n .string()\n .optional()\n .describe(\"Search memory content (case-insensitive substring match)\"),\n limit: z\n .number()\n .optional()\n .describe(\"Max number of memories to return. Defaults to all.\"),\n }),\n execute: async (input) => {\n const memories = await tenant.recall({\n type: input.type,\n tags: input.tags,\n search: input.search,\n limit: input.limit,\n });\n return {\n count: memories.length,\n memories: memories.map((m) => ({\n id: m.id,\n type: m.type,\n content: m.content,\n tags: m.tags,\n createdAt: m.createdAt.toISOString(),\n })),\n };\n },\n }),\n\n memvault_forget: tool({\n description:\n \"Delete a specific memory by ID. Use when the user asks to forget something \" +\n \"or when information is outdated and should be removed.\",\n inputSchema: z.object({\n id: z.string().describe(\"The memory ID to delete\"),\n }),\n execute: async (input) => {\n await tenant.forget(input.id);\n return { success: true, message: `Memory ${input.id} deleted.` };\n },\n }),\n\n memvault_update: tool({\n description:\n \"Update an existing memory. Use when information has changed and the old \" +\n \"memory should be corrected rather than deleted and re-created.\",\n inputSchema: z.object({\n id: z.string().describe(\"The memory ID to update\"),\n content: z\n .string()\n .optional()\n .describe(\"New content to replace the existing memory content\"),\n type: z.string().optional().describe(\"New type for the memory\"),\n tags: z\n .array(z.string())\n .optional()\n .describe(\"New tags (replaces existing tags)\"),\n }),\n execute: async (input) => {\n const { id, ...updates } = input;\n const memory = await tenant.update(id, updates);\n return {\n success: true,\n id: memory.id,\n message: `Updated memory: \"${memory.content}\"`,\n };\n },\n }),\n };\n}\n"],"mappings":";;;AAAA,SAAS,YAAY;AACrB,SAAS,SAAS;AAoBX,SAAS,oBAAoB,QAAqB;AACvD,QAAM,SAAS,OAAO,MAAM,OAAO,OAAO,QAAQ;AAElD,SAAO;AAAA,IACL,mBAAmB,KAAK;AAAA,MACtB,aACE;AAAA,MAIF,aAAa,EAAE,OAAO;AAAA,QACpB,SAAS,EACN,OAAO,EACP,SAAS,uDAAuD;AAAA,QACnE,MAAM,EACH,OAAO,EACP,SAAS,EACT;AAAA,UACC;AAAA,QACF;AAAA,QACF,MAAM,EACH,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,EACT,SAAS,6DAA6D;AAAA,QACzE,KAAK,EACF,OAAO,EACP,SAAS,EACT;AAAA,UACC;AAAA,QACF;AAAA,MACJ,CAAC;AAAA,MACD,SAAS,OAAO,UAAU;AACxB,cAAM,SAAS,MAAM,OAAO,SAAS;AAAA,UACnC,SAAS,MAAM;AAAA,UACf,MAAM,MAAM;AAAA,UACZ,MAAM,MAAM;AAAA,UACZ,KAAK,MAAM;AAAA,QACb,CAAC;AACD,eAAO;AAAA,UACL,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,gBAAgB,OAAO,OAAO,YAAY,OAAO,IAAI;AAAA,QAChE;AAAA,MACF;AAAA,IACF,CAAC;AAAA,IAED,iBAAiB,KAAK;AAAA,MACpB,aACE;AAAA,MAIF,aAAa,EAAE,OAAO;AAAA,QACpB,MAAM,EACH,OAAO,EACP,SAAS,EACT,SAAS,qDAAqD;AAAA,QACjE,MAAM,EACH,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,EACT,SAAS,mEAA8D;AAAA,QAC1E,QAAQ,EACL,OAAO,EACP,SAAS,EACT,SAAS,0DAA0D;AAAA,QACtE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AAS,MAAM,OAAO,OAAO,IAAI,OAAO;AAC9C,eAAO;AAAA,UACL,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,oBAAoB,OAAO,OAAO;AAAA,QAC7C;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/integrations/ai-sdk.ts"],"sourcesContent":["import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { MemVault } from \"../memvault.js\";\nimport type { ToolsConfig } from \"../types.js\";\n\n/**\n * Create drop-in memory tools for the Vercel AI SDK.\n *\n * Usage:\n * ```ts\n * import { createMemVaultTools } from \"memvault/ai-sdk\"\n *\n * const tools = createMemVaultTools({ vault, tenantId: user.id })\n *\n * const result = await generateText({\n * model: anthropic(\"claude-sonnet-4-6\"),\n * tools,\n * prompt: \"Help the user...\"\n * })\n * ```\n */\nexport function createMemVaultTools(config: ToolsConfig) {\n const tenant = config.vault.tenant(config.tenantId);\n\n return {\n memvault_remember: tool({\n description:\n \"Save important information to persistent memory for this user. \" +\n \"Use this when the user shares preferences, facts about themselves, \" +\n \"project context, feedback, or anything worth remembering across sessions. \" +\n \"Memories persist permanently unless given a TTL.\",\n inputSchema: z.object({\n content: z\n .string()\n .describe(\"The information to remember. Be specific and concise.\"),\n type: z\n .string()\n .optional()\n .describe(\n 'Category: \"preference\", \"fact\", \"feedback\", \"project\", \"reference\", or any custom type. Defaults to \"general\".',\n ),\n tags: z\n .array(z.string())\n .optional()\n .describe(\"Tags for categorization and filtering, e.g. ['ui', 'theme']\"),\n ttl: z\n .number()\n .optional()\n .describe(\n \"Time-to-live in seconds. Omit for permanent memory. Use for temporary/session info.\",\n ),\n }),\n execute: async (input) => {\n const memory = await tenant.remember({\n content: input.content,\n type: input.type,\n tags: input.tags,\n ttl: input.ttl,\n });\n return {\n success: true,\n id: memory.id,\n message: `Remembered: \"${memory.content}\" (type: ${memory.type})`,\n };\n },\n }),\n\n memvault_recall: tool({\n description:\n \"Retrieve memories for this user. Call this at the START of every conversation \" +\n \"before responding — even if the user hasn't asked. Use it whenever you need \" +\n \"context about preferences, past conversations, project details, or any \" +\n \"previously saved information.\",\n inputSchema: z.object({\n type: z\n .string()\n .optional()\n .describe(\"Filter by memory type, e.g. 'preference', 'project'\"),\n tags: z\n .array(z.string())\n .optional()\n .describe(\"Filter by tags — returns memories matching ANY of these tags\"),\n search: z\n .string()\n .optional()\n .describe(\"Search memory content (case-insensitive substring match)\"),\n limit: z\n .number()\n .optional()\n .describe(\"Max number of memories to return. Defaults to all.\"),\n }),\n execute: async (input) => {\n const memories = await tenant.recall({\n type: input.type,\n tags: input.tags,\n search: input.search,\n limit: input.limit,\n });\n return {\n count: memories.length,\n memories: memories.map((m) => ({\n id: m.id,\n type: m.type,\n content: m.content,\n tags: m.tags,\n createdAt: m.createdAt.toISOString(),\n })),\n };\n },\n }),\n\n memvault_forget: tool({\n description:\n \"Delete a specific memory by ID. Use when the user asks to forget something \" +\n \"or when information is outdated and should be removed.\",\n inputSchema: z.object({\n id: z.string().describe(\"The memory ID to delete\"),\n }),\n execute: async (input) => {\n await tenant.forget(input.id);\n return { success: true, message: `Memory ${input.id} deleted.` };\n },\n }),\n\n memvault_update: tool({\n description:\n \"Update an existing memory. Use when information has changed and the old \" +\n \"memory should be corrected rather than deleted and re-created.\",\n inputSchema: z.object({\n id: z.string().describe(\"The memory ID to update\"),\n content: z\n .string()\n .optional()\n .describe(\"New content to replace the existing memory content\"),\n type: z.string().optional().describe(\"New type for the memory\"),\n tags: z\n .array(z.string())\n .optional()\n .describe(\"New tags (replaces existing tags)\"),\n }),\n execute: async (input) => {\n const { id, ...updates } = input;\n const memory = await tenant.update(id, updates);\n return {\n success: true,\n id: memory.id,\n message: `Updated memory: \"${memory.content}\"`,\n };\n },\n }),\n };\n}\n"],"mappings":";;;AAAA,SAAS,YAAY;AACrB,SAAS,SAAS;AAoBX,SAAS,oBAAoB,QAAqB;AACvD,QAAM,SAAS,OAAO,MAAM,OAA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memvault_recall",
34
- description: "Retrieve memories for this user. Use this BEFORE responding when you need context about the user's preferences, past conversations, or project details.",
34
+ description: "Retrieve memories for this user. Call this at the START of every conversation before responding \u2014 even if the user hasn't asked. Use it whenever you need context about preferences, past conversations, or project details.",
35
35
  input_schema: {
36
36
  type: "object",
37
37
  properties: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/integrations/anthropic.ts"],"sourcesContent":["import type { ToolsConfig, TenantVaultInstance } from \"../types.js\";\n\n/**\n * Tool definitions for the Anthropic SDK.\n *\n * Usage:\n * ```ts\n * import { createMemVaultTools } from \"memvault/anthropic\"\n *\n * const { tools, handleToolCall } = createMemVaultTools({ vault, tenantId: user.id })\n *\n * const message = await anthropic.messages.create({\n * model: \"claude-sonnet-4-6\",\n * tools,\n * messages: [{ role: \"user\", content: \"Help me...\" }]\n * })\n * ```\n */\n\ninterface AnthropicTool {\n name: string;\n description: string;\n input_schema: {\n type: \"object\";\n properties: Record<string, unknown>;\n required?: string[];\n };\n}\n\nexport function createMemVaultTools(config: ToolsConfig) {\n const tenant = config.vault.tenant(config.tenantId);\n\n const tools: AnthropicTool[] = [\n {\n name: \"memvault_remember\",\n description:\n \"Save important information to persistent memory for this user. \" +\n \"Use this when the user shares preferences, facts about themselves, \" +\n \"project context, feedback, or anything worth remembering across sessions.\",\n input_schema: {\n type: \"object\",\n properties: {\n content: {\n type: \"string\",\n description:\n \"The information to remember. Be specific and concise.\",\n },\n type: {\n type: \"string\",\n description:\n 'Category: \"preference\", \"fact\", \"feedback\", \"project\", \"reference\", or any custom type. Defaults to \"general\".',\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Tags for categorization and filtering.\",\n },\n ttl: {\n type: \"number\",\n description:\n \"Time-to-live in seconds. Omit for permanent memory.\",\n },\n },\n required: [\"content\"],\n },\n },\n {\n name: \"memvault_recall\",\n description:\n \"Retrieve memories for this user. Use this BEFORE responding when you need \" +\n \"context about the user's preferences, past conversations, or project details.\",\n input_schema: {\n type: \"object\",\n properties: {\n type: {\n type: \"string\",\n description: \"Filter by memory type.\",\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Filter by tags.\",\n },\n search: {\n type: \"string\",\n description: \"Search memory content (case-insensitive).\",\n },\n limit: {\n type: \"number\",\n description: \"Max number of memories to return.\",\n },\n },\n },\n },\n {\n name: \"memvault_forget\",\n description:\n \"Delete a specific memory by ID. Use when the user asks to forget something.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to delete.\" },\n },\n required: [\"id\"],\n },\n },\n {\n name: \"memvault_update\",\n description:\n \"Update an existing memory. Use when information has changed.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to update.\" },\n content: { type: \"string\", description: \"New content.\" },\n type: { type: \"string\", description: \"New type.\" },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"New tags.\",\n },\n },\n required: [\"id\"],\n },\n },\n ];\n\n /**\n * Execute a tool call from the Anthropic API response.\n * Pass the tool name and input object from the tool_use content block.\n */\n async function handleToolCall(\n name: string,\n input: Record<string, unknown>,\n ): Promise<string> {\n switch (name) {\n case \"memvault_remember\": {\n const memory = await tenant.remember({\n content: input.content as string,\n type: input.type as string | undefined,\n tags: input.tags as string[] | undefined,\n ttl: input.ttl as number | undefined,\n });\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Remembered: \"${memory.content}\"`,\n });\n }\n case \"memvault_recall\": {\n const memories = await tenant.recall({\n type: input.type as string | undefined,\n tags: input.tags as string[] | undefined,\n search: input.search as string | undefined,\n limit: input.limit as number | undefined,\n });\n return JSON.stringify({\n count: memories.length,\n memories: memories.map((m) => ({\n id: m.id,\n type: m.type,\n content: m.content,\n tags: m.tags,\n createdAt: m.createdAt.toISOString(),\n })),\n });\n }\n case \"memvault_forget\": {\n await tenant.forget(input.id as string);\n return JSON.stringify({\n success: true,\n message: `Memory ${input.id} deleted.`,\n });\n }\n case \"memvault_update\": {\n const { id, ...updates } = input;\n const memory = await tenant.update(id as string, updates);\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Updated memory: \"${memory.content}\"`,\n });\n }\n default:\n return JSON.stringify({ error: `Unknown tool: ${name}` });\n }\n }\n\n return { tools, handleToolCall };\n}\n"],"mappings":";AA6BO,SAAS,oBAAoB,QAAqB;AACvD,QAAM,SAAS,OAAO,MAAM,OAAO,OAAO,QAAQ;AAElD,QAAM,QAAyB;AAAA,IAC7B;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,MAGF,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,YAAY;AAAA,UACV,SAAS;AAAA,YACP,MAAM;AAAA,YACN,aACE;AAAA,UACJ;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,aACE;AAAA,UACJ;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAS;AAAA,YACxB,aAAa;AAAA,UACf;AAAA,UACA,KAAK;AAAA,YACH,MAAM;AAAA,YACN,aACE;AAAA,UACJ;AAAA,QACF;AAAA,QACA,UAAU,CAAC,SAAS;AAAA,MACtB;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,MAEF,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,YAAY;AAAA,UACV,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAS;AAAA,YACxB,aAAa;AAAA,UACf;AAAA,UACA,QAAQ;AAAA,YACN,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,UACA,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,MACF,cAAc;AAAA,QACZ,MAAM;AAAA,QACN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,MAAM,EAAE;AAAA,YACR,WAAW,EAAE,UAAU,YAAY;AAAA,UACrC,EAAE;AAAA,QACJ,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,OAAO,OAAO,MAAM,EAAY;AACtC,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,SAAS,UAAU,MAAM,EAAE;AAAA,QAC7B,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,EAAE,IAAI,GAAG,QAAQ,IAAI;AAC3B,cAAM,SAAS,MAAM,OAAO,OAAO,IAAc,OAAO;AACxD,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,oBAAoB,OAAO,OAAO;AAAA,QAC7C,CAAC;AAAA,MACH;AAAA,MACA;AACE,eAAO,KAAK,UAAU,EAAE,OAAO,iBAAiB,IAAI,GAAG,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,eAAe;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../src/integrations/anthropic.ts"],"sourcesContent":["import type { ToolsConfig, TenantVaultInstance } from \"../types.js\";\n\n/**\n * Tool definitions for the Anthropic SDK.\n *\n * Usage:\n * ```ts\n * import { createMemVaultTools } from \"memvault/anthropic\"\n *\n * const { tools, handleToolCall } = createMemVaultTools({ vault, tenantId: user.id })\n *\n * const message = await anthropic.messages.create({\n * model: \"claude-sonnet-4-6\",\n * tools,\n * messages: [{ role: \"user\", content: \"Help me...\" }]\n * })\n * ```\n */\n\ninterface AnthropicTool {\n name: string;\n description: string;\n input_schema: {\n type: \"object\";\n properties: Record<string, unknown>;\n required?: string[];\n };\n}\n\nexport function createMemVaultTools(config: ToolsConfig) {\n const tenant = config.vault.tenant(config.tenantId);\n\n const tools: AnthropicTool[] = [\n {\n name: \"memvault_remember\",\n description:\n \"Save important information to persistent memory for this user. \" +\n \"Use this when the user shares preferences, facts about themselves, \" +\n \"project context, feedback, or anything worth remembering across sessions.\",\n input_schema: {\n type: \"object\",\n properties: {\n content: {\n type: \"string\",\n description:\n \"The information to remember. Be specific and concise.\",\n },\n type: {\n type: \"string\",\n description:\n 'Category: \"preference\", \"fact\", \"feedback\", \"project\", \"reference\", or any custom type. Defaults to \"general\".',\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Tags for categorization and filtering.\",\n },\n ttl: {\n type: \"number\",\n description:\n \"Time-to-live in seconds. Omit for permanent memory.\",\n },\n },\n required: [\"content\"],\n },\n },\n {\n name: \"memvault_recall\",\n description:\n \"Retrieve memories for this user. Call this at the START of every conversation \" +\n \"before responding even if the user hasn't asked. Use it whenever you need \" +\n \"context about preferences, past conversations, or project details.\",\n input_schema: {\n type: \"object\",\n properties: {\n type: {\n type: \"string\",\n description: \"Filter by memory type.\",\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Filter by tags.\",\n },\n search: {\n type: \"string\",\n description: \"Search memory content (case-insensitive).\",\n },\n limit: {\n type: \"number\",\n description: \"Max number of memories to return.\",\n },\n },\n },\n },\n {\n name: \"memvault_forget\",\n description:\n \"Delete a specific memory by ID. Use when the user asks to forget something.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to delete.\" },\n },\n required: [\"id\"],\n },\n },\n {\n name: \"memvault_update\",\n description:\n \"Update an existing memory. Use when information has changed.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to update.\" },\n content: { type: \"string\", description: \"New content.\" },\n type: { type: \"string\", description: \"New type.\" },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"New tags.\",\n },\n },\n required: [\"id\"],\n },\n },\n ];\n\n /**\n * Execute a tool call from the Anthropic API response.\n * Pass the tool name and input object from the tool_use content block.\n */\n async function handleToolCall(\n name: string,\n input: Record<string, unknown>,\n ): Promise<string> {\n switch (name) {\n case \"memvault_remember\": {\n const memory = await tenant.remember({\n content: input.content as string,\n type: input.type as string | undefined,\n tags: input.tags as string[] | undefined,\n ttl: input.ttl as number | undefined,\n });\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Remembered: \"${memory.content}\"`,\n });\n }\n case \"memvault_recall\": {\n const memories = await tenant.recall({\n type: input.type as string | undefined,\n tags: input.tags as string[] | undefined,\n search: input.search as string | undefined,\n limit: input.limit as number | undefined,\n });\n return JSON.stringify({\n count: memories.length,\n memories: memories.map((m) => ({\n id: m.id,\n type: m.type,\n content: m.content,\n tags: m.tags,\n createdAt: m.createdAt.toISOString(),\n })),\n });\n }\n case \"memvault_forget\": {\n await tenant.forget(input.id as string);\n return JSON.stringify({\n success: true,\n message: `Memory ${input.id} deleted.`,\n });\n }\n case \"memvault_update\": {\n const { id, ...updates } = input;\n const memory = await tenant.update(id as string, updates);\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Updated memory: \"${memory.content}\"`,\n });\n }\n default:\n return JSON.stringify({ error: `Unknown tool: ${name}` });\n }\n }\n\n return { tools, handleToolCall };\n}\n"],"mappings":";AA6BO,SAAS,oBAAoB,QAAqB;AACvD,QAAM,SAAS,OAAO,MAAM,OAAO,OAAO,QAAQ;AAElD,QAAM,QAAyB;AAAA,IAC7B;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,MAGF,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,YAAY;AAAA,UACV,SAAS;AAAA,YACP,MAAM;AAAA,YACN,aACE;AAAA,UACJ;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,aACE;AAAA,UACJ;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAS;AAAA,YACxB,aAAa;AAAA,UACf;AAAA,UACA,KAAK;AAAA,YACH,MAAM;AAAA,YACN,aACE;AAAA,UACJ;AAAA,QACF;AAAA,QACA,UAAU,CAAC,SAAS;AAAA,MACtB;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;A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ACD,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,gBAAgB,OAAO,OAAO;AAAA,QACzC,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,WAAW,MAAM,OAAO,OAAO;AAAA,UACnC,MAAM,MAAM;AAAA,UACZ,MAAM,MAAM;AAAA,UACZ,QAAQ,MAAM;AAAA,UACd,OAAO,MAAM;AAAA,QACf,CAAC;AACD,eAAO,KAAK,UAAU;AAAA,UACpB,OAAO,SAAS;AAAA,UAChB,UAAU,SAAS,IAAI,CAAC,OAAO;AAAA,YAC7B,IAAI,EAAE;AAAA,YACN,MAAM,EAAE;AAAA,YACR,SAAS,EAAE;AAAA,YACX,MAAM,EAAE;AAAA,YACR,WAAW,EAAE,UAAU,YAAY;AAAA,UACrC,EAAE;AAAA,QACJ,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,OAAO,OAAO,MAAM,EAAY;AACtC,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,SAAS,UAAU,MAAM,EAAE;AAAA,QAC7B,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,EAAE,IAAI,GAAG,QAAQ,IAAI;AAC3B,cAAM,SAAS,MAAM,OAAO,OAAO,IAAc,OAAO;AACxD,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,oBAAoB,OAAO,OAAO;AAAA,QAC7C,CAAC;AAAA,MACH;AAAA,MACA;AACE,eAAO,KAAK,UAAU,EAAE,OAAO,iBAAiB,IAAI,GAAG,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,eAAe;AACjC;","names":[]}
@@ -36,7 +36,7 @@ function createMemVaultTools(config) {
36
36
  type: "function",
37
37
  function: {
38
38
  name: "memvault_recall",
39
- description: "Retrieve memories for this user. Use this BEFORE responding when you need context about the user's preferences, past conversations, or project details.",
39
+ description: "Retrieve memories for this user. Call this at the START of every conversation before responding \u2014 even if the user hasn't asked. Use it whenever you need context about preferences, past conversations, or project details.",
40
40
  parameters: {
41
41
  type: "object",
42
42
  properties: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/integrations/openai.ts"],"sourcesContent":["import type { ToolsConfig, TenantVaultInstance } from \"../types.js\";\n\n/**\n * Tool definitions for the OpenAI SDK (Responses API & Chat Completions).\n *\n * Usage:\n * ```ts\n * import { createMemVaultTools, handleToolCall } from \"memvault/openai\"\n *\n * const { tools, handleToolCall } = createMemVaultTools({ vault, tenantId: user.id })\n *\n * const response = await openai.responses.create({\n * model: \"gpt-4o\",\n * tools,\n * input: \"Help the user...\"\n * })\n * ```\n */\n\ninterface OpenAIFunctionTool {\n type: \"function\";\n function: {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n };\n}\n\nexport function createMemVaultTools(config: ToolsConfig) {\n const tenant = config.vault.tenant(config.tenantId);\n\n const tools: OpenAIFunctionTool[] = [\n {\n type: \"function\",\n function: {\n name: \"memvault_remember\",\n description:\n \"Save important information to persistent memory for this user. \" +\n \"Use this when the user shares preferences, facts about themselves, \" +\n \"project context, feedback, or anything worth remembering across sessions.\",\n parameters: {\n type: \"object\",\n properties: {\n content: {\n type: \"string\",\n description:\n \"The information to remember. Be specific and concise.\",\n },\n type: {\n type: \"string\",\n description:\n 'Category: \"preference\", \"fact\", \"feedback\", \"project\", \"reference\", or any custom type. Defaults to \"general\".',\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Tags for categorization and filtering.\",\n },\n ttl: {\n type: \"number\",\n description:\n \"Time-to-live in seconds. Omit for permanent memory.\",\n },\n },\n required: [\"content\"],\n },\n },\n },\n {\n type: \"function\",\n function: {\n name: \"memvault_recall\",\n description:\n \"Retrieve memories for this user. Use this BEFORE responding when you need \" +\n \"context about the user's preferences, past conversations, or project details.\",\n parameters: {\n type: \"object\",\n properties: {\n type: {\n type: \"string\",\n description: \"Filter by memory type.\",\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Filter by tags.\",\n },\n search: {\n type: \"string\",\n description: \"Search memory content (case-insensitive).\",\n },\n limit: {\n type: \"number\",\n description: \"Max number of memories to return.\",\n },\n },\n required: [],\n },\n },\n },\n {\n type: \"function\",\n function: {\n name: \"memvault_forget\",\n description:\n \"Delete a specific memory by ID. Use when the user asks to forget something.\",\n parameters: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to delete.\" },\n },\n required: [\"id\"],\n },\n },\n },\n {\n type: \"function\",\n function: {\n name: \"memvault_update\",\n description:\n \"Update an existing memory. Use when information has changed.\",\n parameters: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to update.\" },\n content: { type: \"string\", description: \"New content.\" },\n type: { type: \"string\", description: \"New type.\" },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"New tags.\",\n },\n },\n required: [\"id\"],\n },\n },\n },\n ];\n\n /**\n * Execute a tool call returned by the OpenAI API.\n * Pass the function name and parsed arguments.\n */\n async function handleToolCall(\n name: string,\n args: Record<string, unknown>,\n ): Promise<string> {\n switch (name) {\n case \"memvault_remember\": {\n const memory = await tenant.remember({\n content: args.content as string,\n type: args.type as string | undefined,\n tags: args.tags as string[] | undefined,\n ttl: args.ttl as number | undefined,\n });\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Remembered: \"${memory.content}\"`,\n });\n }\n case \"memvault_recall\": {\n const memories = await tenant.recall({\n type: args.type as string | undefined,\n tags: args.tags as string[] | undefined,\n search: args.search as string | undefined,\n limit: args.limit as number | undefined,\n });\n return JSON.stringify({\n count: memories.length,\n memories: memories.map((m) => ({\n id: m.id,\n type: m.type,\n content: m.content,\n tags: m.tags,\n createdAt: m.createdAt.toISOString(),\n })),\n });\n }\n case \"memvault_forget\": {\n await tenant.forget(args.id as string);\n return JSON.stringify({\n success: true,\n message: `Memory ${args.id} deleted.`,\n });\n }\n case \"memvault_update\": {\n const { id, ...updates } = args;\n const memory = await tenant.update(id as string, updates);\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Updated memory: \"${memory.content}\"`,\n });\n }\n default:\n return JSON.stringify({ error: `Unknown tool: ${name}` });\n }\n }\n\n return { tools, handleToolCall };\n}\n"],"mappings":";AA4BO,SAAS,oBAAoB,QAAqB;AACvD,QAAM,SAAS,OAAO,MAAM,OAAO,OAAO,QAAQ;AAElD,QAAM,QAA8B;AAAA,IAClC;AAAA,MACE,MAAM;AAAA,MACN,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aACE;AAAA,QAGF,YAAY;AAAA,UACV,MAAM;AAAA,UACN,YAAY;AAAA,YACV,SAAS;AAAA,cACP,MAAM;AAAA,cACN,aACE;AAAA,YACJ;AAAA,YACA,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,aACE;AAAA,YACJ;AAAA,YACA,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,OAAO,EAAE,MAAM,SAAS;AAAA,cACxB,aAAa;AAAA,YACf;AAAA,YACA,KAAK;AAAA,cACH,MAAM;AAAA,cACN,aACE;AAAA,YACJ;AAAA,UACF;AAAA,UACA,UAAU,CAAC,SAAS;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aACE;AAAA,QAEF,YAAY;AAAA,UACV,MAAM;AAAA,UACN,YAAY;AAAA,YACV,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,YACA,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,OAAO,EAAE,MAAM,SAAS;AAAA,cACxB,aAAa;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,cACN,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,YACA,OAAO;AAAA,cACL,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,UACF;A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X,QAAQ,KAAK;AAAA,UACb,OAAO,KAAK;AAAA,QACd,CAAC;AACD,eAAO,KAAK,UAAU;AAAA,UACpB,OAAO,SAAS;AAAA,UAChB,UAAU,SAAS,IAAI,CAAC,OAAO;AAAA,YAC7B,IAAI,EAAE;AAAA,YACN,MAAM,EAAE;AAAA,YACR,SAAS,EAAE;AAAA,YACX,MAAM,EAAE;AAAA,YACR,WAAW,EAAE,UAAU,YAAY;AAAA,UACrC,EAAE;AAAA,QACJ,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,OAAO,OAAO,KAAK,EAAY;AACrC,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,SAAS,UAAU,KAAK,EAAE;AAAA,QAC5B,CAAC;AAAA,MACH;AAAA,MACA,KAAK,mBAAmB;AACtB,cAAM,EAAE,IAAI,GAAG,QAAQ,IAAI;AAC3B,cAAM,SAAS,MAAM,OAAO,OAAO,IAAc,OAAO;AACxD,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,oBAAoB,OAAO,OAAO;AAAA,QAC7C,CAAC;AAAA,MACH;AAAA,MACA;AACE,eAAO,KAAK,UAAU,EAAE,OAAO,iBAAiB,IAAI,GAAG,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,eAAe;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../src/integrations/openai.ts"],"sourcesContent":["import type { ToolsConfig, TenantVaultInstance } from \"../types.js\";\n\n/**\n * Tool definitions for the OpenAI SDK (Responses API & Chat Completions).\n *\n * Usage:\n * ```ts\n * import { createMemVaultTools, handleToolCall } from \"memvault/openai\"\n *\n * const { tools, handleToolCall } = createMemVaultTools({ vault, tenantId: user.id })\n *\n * const response = await openai.responses.create({\n * model: \"gpt-4o\",\n * tools,\n * input: \"Help the user...\"\n * })\n * ```\n */\n\ninterface OpenAIFunctionTool {\n type: \"function\";\n function: {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n };\n}\n\nexport function createMemVaultTools(config: ToolsConfig) {\n const tenant = config.vault.tenant(config.tenantId);\n\n const tools: OpenAIFunctionTool[] = [\n {\n type: \"function\",\n function: {\n name: \"memvault_remember\",\n description:\n \"Save important information to persistent memory for this user. \" +\n \"Use this when the user shares preferences, facts about themselves, \" +\n \"project context, feedback, or anything worth remembering across sessions.\",\n parameters: {\n type: \"object\",\n properties: {\n content: {\n type: \"string\",\n description:\n \"The information to remember. Be specific and concise.\",\n },\n type: {\n type: \"string\",\n description:\n 'Category: \"preference\", \"fact\", \"feedback\", \"project\", \"reference\", or any custom type. Defaults to \"general\".',\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Tags for categorization and filtering.\",\n },\n ttl: {\n type: \"number\",\n description:\n \"Time-to-live in seconds. Omit for permanent memory.\",\n },\n },\n required: [\"content\"],\n },\n },\n },\n {\n type: \"function\",\n function: {\n name: \"memvault_recall\",\n description:\n \"Retrieve memories for this user. Call this at the START of every conversation \" +\n \"before responding even if the user hasn't asked. Use it whenever you need \" +\n \"context about preferences, past conversations, or project details.\",\n parameters: {\n type: \"object\",\n properties: {\n type: {\n type: \"string\",\n description: \"Filter by memory type.\",\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Filter by tags.\",\n },\n search: {\n type: \"string\",\n description: \"Search memory content (case-insensitive).\",\n },\n limit: {\n type: \"number\",\n description: \"Max number of memories to return.\",\n },\n },\n required: [],\n },\n },\n },\n {\n type: \"function\",\n function: {\n name: \"memvault_forget\",\n description:\n \"Delete a specific memory by ID. Use when the user asks to forget something.\",\n parameters: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to delete.\" },\n },\n required: [\"id\"],\n },\n },\n },\n {\n type: \"function\",\n function: {\n name: \"memvault_update\",\n description:\n \"Update an existing memory. Use when information has changed.\",\n parameters: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"The memory ID to update.\" },\n content: { type: \"string\", description: \"New content.\" },\n type: { type: \"string\", description: \"New type.\" },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"New tags.\",\n },\n },\n required: [\"id\"],\n },\n },\n },\n ];\n\n /**\n * Execute a tool call returned by the OpenAI API.\n * Pass the function name and parsed arguments.\n */\n async function handleToolCall(\n name: string,\n args: Record<string, unknown>,\n ): Promise<string> {\n switch (name) {\n case \"memvault_remember\": {\n const memory = await tenant.remember({\n content: args.content as string,\n type: args.type as string | undefined,\n tags: args.tags as string[] | undefined,\n ttl: args.ttl as number | undefined,\n });\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Remembered: \"${memory.content}\"`,\n });\n }\n case \"memvault_recall\": {\n const memories = await tenant.recall({\n type: args.type as string | undefined,\n tags: args.tags as string[] | undefined,\n search: args.search as string | undefined,\n limit: args.limit as number | undefined,\n });\n return JSON.stringify({\n count: memories.length,\n memories: memories.map((m) => ({\n id: m.id,\n type: m.type,\n content: m.content,\n tags: m.tags,\n createdAt: m.createdAt.toISOString(),\n })),\n });\n }\n case \"memvault_forget\": {\n await tenant.forget(args.id as string);\n return JSON.stringify({\n success: true,\n message: `Memory ${args.id} deleted.`,\n });\n }\n case \"memvault_update\": {\n const { id, ...updates } = args;\n const memory = await tenant.update(id as string, updates);\n return JSON.stringify({\n success: true,\n id: memory.id,\n message: `Updated memory: \"${memory.content}\"`,\n });\n }\n default:\n return JSON.stringify({ error: `Unknown tool: ${name}` });\n }\n }\n\n return { tools, handleToolCall };\n}\n"],"mappings":";AA4BO,SAAS,oBAAoB,QAAqB;AACvD,QAAM,SAAS,OAAO,MAAM,OAAO,OAAO,QAAQ;AAElD,QAAM,QAA8B;AAAA,IAClC;AAAA,MACE,MAAM;AAAA,MACN,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aACE;AAAA,QAGF,YAAY;AAAA,UACV,MAAM;AAAA,UACN,YAAY;AAAA,YACV,SAAS;AAAA,cACP,MAAM;AAAA,cACN,aACE;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,KAAK,mBAAmB;AACtB,cAAM,EAAE,IAAI,GAAG,QAAQ,IAAI;AAC3B,cAAM,SAAS,MAAM,OAAO,OAAO,IAAc,OAAO;AACxD,eAAO,KAAK,UAAU;AAAA,UACpB,SAAS;AAAA,UACT,IAAI,OAAO;AAAA,UACX,SAAS,oBAAoB,OAAO,OAAO;AAAA,QAC7C,CAAC;AAAA,MACH;AAAA,MACA;AACE,eAAO,KAAK,UAAU,EAAE,OAAO,iBAAiB,IAAI,GAAG,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,eAAe;AACjC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memvault",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Persistent, tenant-isolated memory tools for AI agents. Drop-in tools for Vercel AI SDK, OpenAI, and Anthropic. Prisma-powered.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -77,14 +77,14 @@
77
77
  }
78
78
  },
79
79
  "devDependencies": {
80
+ "@anthropic-ai/sdk": "0.82.0",
80
81
  "@prisma/client": "7.6.0",
81
- "prisma": "7.6.0",
82
82
  "ai": "6.0.142",
83
- "zod": "4.3.6",
84
83
  "openai": "6.33.0",
85
- "@anthropic-ai/sdk": "0.82.0",
84
+ "prisma": "7.6.0",
86
85
  "tsup": "8.5.1",
87
86
  "typescript": "6.0.2",
88
- "vitest": "4.1.2"
87
+ "vitest": "4.1.2",
88
+ "zod": "4.3.6"
89
89
  }
90
90
  }