@supermemory/eve 0.1.0
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 +176 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/lib/add-document.d.ts +14 -0
- package/dist/lib/add-document.js +11 -0
- package/dist/lib/auto-search.d.ts +8 -0
- package/dist/lib/auto-search.js +73 -0
- package/dist/lib/capture-conversation.d.ts +4 -0
- package/dist/lib/capture-conversation.js +63 -0
- package/dist/lib/client.d.ts +2 -0
- package/dist/lib/client.js +4 -0
- package/dist/lib/container-tags.d.ts +5 -0
- package/dist/lib/container-tags.js +14 -0
- package/dist/lib/dependencies.d.ts +6 -0
- package/dist/lib/dependencies.js +1 -0
- package/dist/lib/documents.d.ts +49 -0
- package/dist/lib/documents.js +64 -0
- package/dist/lib/extract-source.d.ts +11 -0
- package/dist/lib/extract-source.js +65 -0
- package/dist/lib/forget-matching.d.ts +31 -0
- package/dist/lib/forget-matching.js +43 -0
- package/dist/lib/forget-memory.d.ts +7 -0
- package/dist/lib/forget-memory.js +7 -0
- package/dist/lib/messages.d.ts +7 -0
- package/dist/lib/messages.js +40 -0
- package/dist/lib/profile-context.d.ts +9 -0
- package/dist/lib/profile-context.js +198 -0
- package/dist/lib/remember.d.ts +11 -0
- package/dist/lib/remember.js +35 -0
- package/dist/lib/search-context.d.ts +11 -0
- package/dist/lib/search-context.js +24 -0
- package/dist/options.d.ts +36 -0
- package/dist/options.js +51 -0
- package/dist/provider.d.ts +3 -0
- package/dist/provider.js +73 -0
- package/dist/tools/extract.d.ts +18 -0
- package/dist/tools/extract.js +27 -0
- package/dist/tools/forget-matching.d.ts +58 -0
- package/dist/tools/forget-matching.js +47 -0
- package/dist/tools/forget.d.ts +10 -0
- package/dist/tools/forget.js +25 -0
- package/dist/tools/index.d.ts +302 -0
- package/dist/tools/index.js +18 -0
- package/dist/tools/read-document.d.ts +96 -0
- package/dist/tools/read-document.js +28 -0
- package/dist/tools/read-session.d.ts +94 -0
- package/dist/tools/read-session.js +25 -0
- package/dist/tools/remember.d.ts +18 -0
- package/dist/tools/remember.js +26 -0
- package/dist/tools/search.d.ts +12 -0
- package/dist/tools/search.js +29 -0
- package/package.json +50 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { SupermemoryDependencies } from "../lib/dependencies.js";
|
|
2
|
+
export declare function createReadSessionTool(dependencies: SupermemoryDependencies): import("eve/tools").ToolDefinition<{
|
|
3
|
+
documentId: string;
|
|
4
|
+
offset: number;
|
|
5
|
+
}, {
|
|
6
|
+
id: string;
|
|
7
|
+
customId: string | null;
|
|
8
|
+
connectionId: string | null;
|
|
9
|
+
title: string | null;
|
|
10
|
+
type: "audio" | "github_markdown" | "google_doc" | "google_sheet" | "google_slide" | "image" | "notion_doc" | "onedrive" | "pdf" | "text" | "tweet" | "video" | "webpage";
|
|
11
|
+
status: "chunking" | "done" | "embedding" | "extracting" | "failed" | "indexing" | "queued" | "unknown";
|
|
12
|
+
taskType: "memory" | "superrag";
|
|
13
|
+
metadata: string | number | boolean | unknown[] | {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
} | null;
|
|
16
|
+
summary: string | null;
|
|
17
|
+
source: string | null;
|
|
18
|
+
url: string | null | undefined;
|
|
19
|
+
filepath: string | null;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
content: null;
|
|
23
|
+
offset: number;
|
|
24
|
+
nextOffset: null;
|
|
25
|
+
totalCharacters: number | null;
|
|
26
|
+
} | {
|
|
27
|
+
content: string;
|
|
28
|
+
offset: number;
|
|
29
|
+
nextOffset: number | null;
|
|
30
|
+
totalCharacters: number;
|
|
31
|
+
id: string;
|
|
32
|
+
customId: string | null;
|
|
33
|
+
connectionId: string | null;
|
|
34
|
+
title: string | null;
|
|
35
|
+
type: "audio" | "github_markdown" | "google_doc" | "google_sheet" | "google_slide" | "image" | "notion_doc" | "onedrive" | "pdf" | "text" | "tweet" | "video" | "webpage";
|
|
36
|
+
status: "chunking" | "done" | "embedding" | "extracting" | "failed" | "indexing" | "queued" | "unknown";
|
|
37
|
+
taskType: "memory" | "superrag";
|
|
38
|
+
metadata: string | number | boolean | unknown[] | {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
} | null;
|
|
41
|
+
summary: string | null;
|
|
42
|
+
source: string | null;
|
|
43
|
+
url: string | null | undefined;
|
|
44
|
+
filepath: string | null;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
}> & {
|
|
48
|
+
execute(input: {
|
|
49
|
+
documentId: string;
|
|
50
|
+
offset: number;
|
|
51
|
+
}, ctx: import("eve/tools").ToolContext): Promise<{
|
|
52
|
+
id: string;
|
|
53
|
+
customId: string | null;
|
|
54
|
+
connectionId: string | null;
|
|
55
|
+
title: string | null;
|
|
56
|
+
type: "audio" | "github_markdown" | "google_doc" | "google_sheet" | "google_slide" | "image" | "notion_doc" | "onedrive" | "pdf" | "text" | "tweet" | "video" | "webpage";
|
|
57
|
+
status: "chunking" | "done" | "embedding" | "extracting" | "failed" | "indexing" | "queued" | "unknown";
|
|
58
|
+
taskType: "memory" | "superrag";
|
|
59
|
+
metadata: string | number | boolean | unknown[] | {
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
} | null;
|
|
62
|
+
summary: string | null;
|
|
63
|
+
source: string | null;
|
|
64
|
+
url: string | null | undefined;
|
|
65
|
+
filepath: string | null;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
content: null;
|
|
69
|
+
offset: number;
|
|
70
|
+
nextOffset: null;
|
|
71
|
+
totalCharacters: number | null;
|
|
72
|
+
} | {
|
|
73
|
+
content: string;
|
|
74
|
+
offset: number;
|
|
75
|
+
nextOffset: number | null;
|
|
76
|
+
totalCharacters: number;
|
|
77
|
+
id: string;
|
|
78
|
+
customId: string | null;
|
|
79
|
+
connectionId: string | null;
|
|
80
|
+
title: string | null;
|
|
81
|
+
type: "audio" | "github_markdown" | "google_doc" | "google_sheet" | "google_slide" | "image" | "notion_doc" | "onedrive" | "pdf" | "text" | "tweet" | "video" | "webpage";
|
|
82
|
+
status: "chunking" | "done" | "embedding" | "extracting" | "failed" | "indexing" | "queued" | "unknown";
|
|
83
|
+
taskType: "memory" | "superrag";
|
|
84
|
+
metadata: string | number | boolean | unknown[] | {
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
} | null;
|
|
87
|
+
summary: string | null;
|
|
88
|
+
source: string | null;
|
|
89
|
+
url: string | null | undefined;
|
|
90
|
+
filepath: string | null;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
}>;
|
|
94
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineTool } from "eve/tools";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { readStoredDocument } from "../lib/documents.js";
|
|
4
|
+
export function createReadSessionTool(dependencies) {
|
|
5
|
+
return defineTool({
|
|
6
|
+
description: "Read a previous agent conversation/session. Use after search returns a conversation result whenever answering the user requires the surrounding exchange, what the user or assistant actually said, the sequence of decisions, or exact earlier wording. Pass the exact results[].documents[].id whose metadata.source_type is conversation and start with offset 0. Continue with the returned nextOffset whenever more of that session is needed.",
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
documentId: z
|
|
9
|
+
.string()
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(200)
|
|
13
|
+
.describe("The exact results[].documents[].id for a source whose metadata.source_type is conversation."),
|
|
14
|
+
offset: z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.nonnegative()
|
|
18
|
+
.default(0)
|
|
19
|
+
.describe("The exact nextOffset returned by the previous read, or zero."),
|
|
20
|
+
}),
|
|
21
|
+
execute({ documentId, offset }, ctx) {
|
|
22
|
+
return readStoredDocument(documentId, offset, "agent_context", ctx, dependencies);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SupermemoryDependencies } from "../lib/dependencies.js";
|
|
2
|
+
export declare function createRememberTool(dependencies: SupermemoryDependencies): import("eve/tools").ToolDefinition<{
|
|
3
|
+
memory: string;
|
|
4
|
+
sourceDocumentId?: string | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
documentId: string;
|
|
7
|
+
status: string;
|
|
8
|
+
sourceDocumentId: string | null;
|
|
9
|
+
}> & {
|
|
10
|
+
execute(input: {
|
|
11
|
+
memory: string;
|
|
12
|
+
sourceDocumentId?: string | undefined;
|
|
13
|
+
}, ctx: import("eve/tools").ToolContext): Promise<{
|
|
14
|
+
documentId: string;
|
|
15
|
+
status: string;
|
|
16
|
+
sourceDocumentId: string | null;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineTool } from "eve/tools";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { rememberContext } from "../lib/remember.js";
|
|
4
|
+
export function createRememberTool(dependencies) {
|
|
5
|
+
return defineTool({
|
|
6
|
+
description: "Decide whether the current conversation contains context worth carrying into future sessions, and save it when appropriate. Use when the user says remember this, save this, keep this for later, don't forget, from now on, always, never, stop doing this, or next time; corrects behavior they expect changed in future interactions; expresses frustration such as why do you keep doing this when the surrounding conversation reveals a reusable correction; or shares or corrects durable personal information, identity, relationships, preferences, boundaries, goals, commitments, decisions, or ongoing project context. Compose one concise standalone memory grounded in what the user said or confirmed. For identity or relationships, preserve the entity, relationship, and stable detail. For a preference, constraint, or correction, preserve the desired behavior, its scope or trigger, and any boundary. For a decision or commitment, preserve the context, settled choice, and relevant condition. For project state, preserve the objective, current state, decisions, constraints or blockers, and concrete next actions. When frustration reveals the instruction, save the reusable behavior change rather than the temporary emotion. When the memory comes from an extracted source, include its exact sourceDocumentId.",
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
memory: z
|
|
9
|
+
.string()
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(3_000)
|
|
13
|
+
.refine((memory) => memory.split(/\s+/u).length <= 180, "Memory must be 180 words or fewer.")
|
|
14
|
+
.describe("One dense standalone memory. Include the relevant subject and scope: a short identity fact, a scoped preference or correction, a decision with its condition, or project state with constraints and next actions."),
|
|
15
|
+
sourceDocumentId: z
|
|
16
|
+
.string()
|
|
17
|
+
.trim()
|
|
18
|
+
.max(200)
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Only when the memory was synthesized from an extracted source: its exact extraction document ID. Omit for ordinary conversation memories."),
|
|
21
|
+
}),
|
|
22
|
+
execute(input, ctx) {
|
|
23
|
+
return rememberContext(input, ctx, dependencies);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SupermemoryDependencies } from "../lib/dependencies.js";
|
|
2
|
+
export declare function createSearchTool(dependencies: SupermemoryDependencies): import("eve/tools").ToolDefinition<{
|
|
3
|
+
query: string;
|
|
4
|
+
scope: "all" | "conversations" | "documents" | "memories";
|
|
5
|
+
customId?: string | undefined;
|
|
6
|
+
}, import("supermemory/resources/search.mjs").SearchMemoriesResponse> & {
|
|
7
|
+
execute(input: {
|
|
8
|
+
query: string;
|
|
9
|
+
scope: "all" | "conversations" | "documents" | "memories";
|
|
10
|
+
customId?: string | undefined;
|
|
11
|
+
}, ctx: import("eve/tools").ToolContext): Promise<import("supermemory/resources/search.mjs").SearchMemoriesResponse>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineTool } from "eve/tools";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SEARCH_SCOPES, searchStoredContext } from "../lib/search-context.js";
|
|
4
|
+
export function createSearchTool(dependencies) {
|
|
5
|
+
return defineTool({
|
|
6
|
+
description: "Search saved memory/context and previous user conversation/session. Use whenever answering the user or carrying out their request could benefit from something they shared, preferred, decided, discussed, or worked on before. For example, before ordering food, search for what they like; before doing a task, search for relevant preferences, decisions, or prior work. Also use when the user asks what you know about them, about a memory or earlier conversation, or about a stored document. Results are summaries; use read_session or read_document when the underlying context is needed.",
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
query: z
|
|
9
|
+
.string()
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(2_000)
|
|
13
|
+
.describe("A standalone natural-language retrieval query with one retrieval intent."),
|
|
14
|
+
scope: z
|
|
15
|
+
.enum(SEARCH_SCOPES)
|
|
16
|
+
.default("all")
|
|
17
|
+
.describe("Use memories for durable facts and decisions, conversations for previous agent sessions, documents for stored source wording, or all when the storage form is mixed or unclear."),
|
|
18
|
+
customId: z
|
|
19
|
+
.string()
|
|
20
|
+
.trim()
|
|
21
|
+
.max(200)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Only for a follow-up within a known source: the exact results[].documents[].metadata.source_id from an earlier search result."),
|
|
24
|
+
}),
|
|
25
|
+
execute(input, ctx) {
|
|
26
|
+
return searchStoredContext(input, { signal: ctx.abortSignal }, dependencies);
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@supermemory/eve",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Durable user context, retrieval, extraction, remembering, and forgetting for Eve agents.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"keywords": [
|
|
10
|
+
"agents",
|
|
11
|
+
"eve",
|
|
12
|
+
"memory",
|
|
13
|
+
"supermemory"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
24
|
+
"prebuild": "npm run clean",
|
|
25
|
+
"build": "tsc -p tsconfig.build.json",
|
|
26
|
+
"check": "biome ci src",
|
|
27
|
+
"format": "biome format --write src",
|
|
28
|
+
"prepare": "npm run build",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"supermemory": "^4.25.4",
|
|
33
|
+
"zod": "4.4.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@biomejs/biome": "2.5.7",
|
|
37
|
+
"@types/node": "24.x",
|
|
38
|
+
"eve": "0.47.3",
|
|
39
|
+
"typescript": "7.0.2"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"eve": "^0.47.3"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=24"
|
|
49
|
+
}
|
|
50
|
+
}
|