mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-10 03:28:14 +00:00
Merge 3844c1480c into ac21804982
This commit is contained in:
commit
f6e183ed6d
4 changed files with 7 additions and 3 deletions
|
|
@ -48,7 +48,7 @@ Your assistant chooses these tools automatically. Use this table when you need t
|
|||
| --- | --- | --- | --- |
|
||||
| `search_memory` | Semantic recall from one space | `query` (required), `containerTag` | Matching memories |
|
||||
| `get_profile` | Stable and recent profile context for one space | `containerTag` | Profile facts |
|
||||
| `add_memory` | Save information or forget outdated information | `content` (required), `action` (`save` or `forget`), `containerTag` | Save or forget confirmation |
|
||||
| `add_memory` | Save information or forget outdated information | `content` (required), `action` (`save` or `forget`), `containerTag`, optional `metadata` | Save or forget confirmation |
|
||||
| `list_documents` | Browse stored source documents and their summaries | `page`, `limit`, `containerTag` | Document IDs, titles, types, status, dates, and summaries |
|
||||
| `get_document` | Read the available content of one document | `documentId` (required) | Document metadata, summary, and available content |
|
||||
| `list_memories` | Browse recent extracted memory entries and their source document IDs | `page`, `limit`, `containerTag` | Memory IDs, text, versions, and source document IDs |
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@ describeWithAuth("MCP - space scoping", () => {
|
|||
const plainTools = (await plain.client.listTools()).tools
|
||||
|
||||
expect(propsOf(plainTools, "add_memory")).toHaveProperty("containerTag")
|
||||
expect(propsOf(plainTools, "add_memory")).toHaveProperty("metadata")
|
||||
expect(propsOf(plainTools, "search_memory")).toHaveProperty(
|
||||
"containerTag",
|
||||
)
|
||||
expect(propsOf(plainTools, "get_profile")).toHaveProperty("containerTag")
|
||||
|
||||
expect(propsOf(scopedTools, "add_memory")).toHaveProperty("containerTag")
|
||||
expect(propsOf(scopedTools, "add_memory")).toHaveProperty("metadata")
|
||||
expect(propsOf(scopedTools, "search_memory")).toHaveProperty(
|
||||
"containerTag",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -161,12 +161,13 @@ export class SupermemoryClient {
|
|||
|
||||
async createMemory(
|
||||
content: string,
|
||||
metadata?: Record<string, unknown>,
|
||||
): Promise<{ id: string; status: string; containerTag: string }> {
|
||||
try {
|
||||
const result = await this.client.add({
|
||||
content,
|
||||
containerTag: this.containerTag,
|
||||
metadata: { sm_source: MCP_SOURCE },
|
||||
metadata: { ...metadata, sm_source: MCP_SOURCE },
|
||||
})
|
||||
return {
|
||||
id: result.id,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export function register(deps: ToolDeps) {
|
|||
.describe("The memory content to save or forget"),
|
||||
action: z.enum(["save", "forget"]).optional().default("save"),
|
||||
containerTag: optionalContainerTagSchema,
|
||||
metadata: z.record(z.string(), z.unknown()).optional().describe("Optional metadata to attach to the saved memory"),
|
||||
})
|
||||
|
||||
deps.server.registerTool(
|
||||
|
|
@ -42,7 +43,7 @@ export function register(deps: ToolDeps) {
|
|||
}
|
||||
}
|
||||
|
||||
const result = await client.createMemory(args.content)
|
||||
const result = await client.createMemory(args.content, args.metadata)
|
||||
const message = `Memory saved (ID: ${result.id}, space: ${result.containerTag})`
|
||||
const structuredContent: AddMemoryOutput = {
|
||||
action: "save",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue