@vortex-os/memory-extended 0.5.1 → 0.5.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 +17 -17
- package/dist/mcp/recall-tool.d.ts +13 -1
- package/dist/mcp/recall-tool.d.ts.map +1 -1
- package/dist/mcp/recall-tool.js +37 -8
- package/dist/mcp/recall-tool.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +4 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/recall/engine.d.ts +20 -18
- package/dist/recall/engine.d.ts.map +1 -1
- package/dist/recall/engine.js +248 -56
- package/dist/recall/engine.js.map +1 -1
- package/dist/recall/ftsQuery.d.ts +29 -0
- package/dist/recall/ftsQuery.d.ts.map +1 -0
- package/dist/recall/ftsQuery.js +36 -0
- package/dist/recall/ftsQuery.js.map +1 -0
- package/dist/recall/fusion.d.ts +58 -0
- package/dist/recall/fusion.d.ts.map +1 -0
- package/dist/recall/fusion.js +115 -0
- package/dist/recall/fusion.js.map +1 -0
- package/dist/recall/index.d.ts +3 -1
- package/dist/recall/index.d.ts.map +1 -1
- package/dist/recall/index.js +1 -0
- package/dist/recall/index.js.map +1 -1
- package/dist/recall/types.d.ts +24 -2
- package/dist/recall/types.d.ts.map +1 -1
- package/dist/sessionArchive/adapters/claude-code.d.ts.map +1 -1
- package/dist/sessionArchive/adapters/claude-code.js +38 -4
- package/dist/sessionArchive/adapters/claude-code.js.map +1 -1
- package/dist/sessionArchive/index.d.ts +1 -1
- package/dist/sessionArchive/index.d.ts.map +1 -1
- package/dist/sessionArchive/index.js.map +1 -1
- package/dist/sessionArchive/store.d.ts +22 -1
- package/dist/sessionArchive/store.d.ts.map +1 -1
- package/dist/sessionArchive/store.js +143 -12
- package/dist/sessionArchive/store.js.map +1 -1
- package/dist/sqlite/fts.d.ts +38 -0
- package/dist/sqlite/fts.d.ts.map +1 -0
- package/dist/sqlite/fts.js +102 -0
- package/dist/sqlite/fts.js.map +1 -0
- package/dist/sqlite/index.d.ts +2 -0
- package/dist/sqlite/index.d.ts.map +1 -1
- package/dist/sqlite/index.js +1 -0
- package/dist/sqlite/index.js.map +1 -1
- package/dist/sqlite/store.d.ts +8 -1
- package/dist/sqlite/store.d.ts.map +1 -1
- package/dist/sqlite/store.js +29 -7
- package/dist/sqlite/store.js.map +1 -1
- package/dist/vector/embedder.d.ts +11 -0
- package/dist/vector/embedder.d.ts.map +1 -1
- package/dist/vector/embedder.js +4 -1
- package/dist/vector/embedder.js.map +1 -1
- package/dist/vector/segment.d.ts +1 -1
- package/dist/vector/store.d.ts +12 -2
- package/dist/vector/store.d.ts.map +1 -1
- package/dist/vector/store.js +17 -2
- package/dist/vector/store.js.map +1 -1
- package/dist/vector/types.d.ts +1 -1
- package/dist/vector/types.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,20 +8,20 @@ Extended memory layer for VortEX — an **opt-in add-on** that lives on top of `
|
|
|
8
8
|
|
|
9
9
|
| Namespace | Purpose | Status |
|
|
10
10
|
|---|---|---|
|
|
11
|
-
| `sessionArchive` | Append-only JSONL log of agent sessions + SQLite metadata. Four first-party host adapters (Claude Code CLI, Codex CLI, Gemini CLI, Claude Desktop). |
|
|
12
|
-
| `consolidate` | Post-session fact-extraction proposer — read past `sessionArchive` events, propose memory candidates, operator confirms. |
|
|
13
|
-
| `sqlite` | Structured store derived from markdown memories — hard-filter queries (`byType` / `byTag` / `byPrivacy` / `updatedSince`), drift detection (log + skip, non-destructive). |
|
|
14
|
-
| `vector` | Dense retrieval over memories **and conversation sessions**. Default backend: **in-process brute-force cosine**; vectors in the shared `memory.sqlite`. Host-injected `EmbedFn` (multilingual local default). Sessions are vectorized at topic-chunk granularity via embedding-similarity segmentation. |
|
|
15
|
-
| `recall` | Two-stage hybrid retrieval **engine** (SQLite loose hard-filter → cosine rerank). Returns data, not a report. Hits carry `source` = `memory` \| `session-archive`. `/recall <query>` command lives in `session-rituals`. |
|
|
16
|
-
| `mcp` | MCP server for any MCP host (Claude Desktop, chatbots) over stdio: read tools (`recall`, `list_memories`, `get_memory`) + document tools (`suggest_document` → `write_document` / `decline_document`, a propose-then-write pair), plus a one-line `install` into the host config. Writes are gated behind an explicit second tool call. SDK is an optional dependency. Bin: `vortex-mcp-recall`. |
|
|
11
|
+
| `sessionArchive` | Append-only JSONL log of agent sessions + SQLite metadata. Four first-party host adapters (Claude Code CLI, Codex CLI, Gemini CLI, Claude Desktop). | Shipped |
|
|
12
|
+
| `consolidate` | Post-session fact-extraction proposer — read past `sessionArchive` events, propose memory candidates, operator confirms. | Shipped |
|
|
13
|
+
| `sqlite` | Structured store derived from markdown memories — hard-filter queries (`byType` / `byTag` / `byPrivacy` / `updatedSince`), drift detection (log + skip, non-destructive). | Shipped |
|
|
14
|
+
| `vector` | Dense retrieval over memories **and conversation sessions**. Default backend: **in-process brute-force cosine**; vectors in the shared `memory.sqlite`. Host-injected `EmbedFn` (multilingual local default). Sessions are vectorized at topic-chunk granularity via embedding-similarity segmentation. | Shipped |
|
|
15
|
+
| `recall` | Two-stage hybrid retrieval **engine** (SQLite loose hard-filter → cosine rerank). Returns data, not a report. Hits carry `source` = `memory` \| `session-archive`. `/recall <query>` command lives in `session-rituals`. | Shipped |
|
|
16
|
+
| `mcp` | MCP server for any MCP host (Claude Desktop, chatbots) over stdio: read tools (`recall`, `list_memories`, `get_memory`) + document tools (`suggest_document` → `write_document` / `decline_document`, a propose-then-write pair), plus a one-line `install` into the host config. Writes are gated behind an explicit second tool call. SDK is an optional dependency. Bin: `vortex-mcp-recall`. | Shipped |
|
|
17
17
|
|
|
18
|
-
The companion module **`proactive-curator`** (shipped inside `@vortex-os/base`) handles the *in-session* counterpart to `consolidate` — live "this looks worth capturing" prompts during an ongoing conversation. `memory-extended/consolidate`
|
|
18
|
+
The companion module **`proactive-curator`** (shipped inside `@vortex-os/base`) handles the *in-session* counterpart to `consolidate` — live "this looks worth capturing" prompts during an ongoing conversation. `memory-extended/consolidate` emits proposals shaped identically to `proactive-curator`'s `Proposal` / `LLMJudge` types (that small surface is **inlined** under `src/internal/`, not imported), so a single host UX renders both surfaces.
|
|
19
19
|
|
|
20
20
|
## What it is not
|
|
21
21
|
|
|
22
22
|
- It does **not** replace `@vortex-os/base`'s `memorySystem`. The markdown layer remains the source of truth; this package adds *derived* indexes that can be deleted and regenerated at any time.
|
|
23
23
|
- It does **not** write to `_memory/` directly. The `consolidate` namespace proposes; the operator confirms; writes go through `base`'s `memorySystem`.
|
|
24
|
-
- It does **not** require all
|
|
24
|
+
- It does **not** require all of its namespaces to be present. Use what you need; drop the rest.
|
|
25
25
|
|
|
26
26
|
## Installation
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ npm install @vortex-os/memory-extended @vortex-os/base better-sqlite3
|
|
|
31
31
|
npm install classic-level
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
`@vortex-os/base` is a required peer
|
|
34
|
+
`@vortex-os/base` is a required peer because this package is an **add-on layered onto a base instance** — it expects a base-scaffolded `data/` layout alongside it, not because its code imports base. (memory-extended is self-contained: its only runtime dependency is `yaml`; the `proactive-curator` types `consolidate` mirrors are inlined under `src/internal/`.) `better-sqlite3` is required for the SQLite metadata layer. `classic-level` is optional — required only when the Claude Desktop adapter is registered.
|
|
35
35
|
|
|
36
36
|
The local embedder (`@huggingface/transformers`) is an **optional dependency** — it installs automatically with this package; nothing to fetch by hand. The default model is **`Xenova/multilingual-e5-small`** (384-dim, 50+ languages incl. Korean, 512-token input, ~470 MB) — a retrieval-tuned multilingual model that downloads once on first `vector`/`recall` use and is cached. It is *asymmetric*: a `"query: "` prefix is applied to search text and `"passage: "` to indexed text automatically (the store passes the right `kind`). To use a *symmetric* model instead (e.g. `Xenova/all-MiniLM-L6-v2`, ~90 MB) pass `{ model: "...", prefixes: null }`. To skip the local model entirely, pass your own `EmbedFn` (e.g. an OpenAI/Voyage adapter).
|
|
37
37
|
|
|
@@ -70,7 +70,7 @@ await rebuildFromMemoryDir(store, "./data/_memory");
|
|
|
70
70
|
|
|
71
71
|
// Four hard-filter helpers.
|
|
72
72
|
const rules = store.byType("feedback");
|
|
73
|
-
const
|
|
73
|
+
const taggedRules = store.byTag("onboarding");
|
|
74
74
|
const visiblePublic = store.byPrivacy("public");
|
|
75
75
|
const fresh = store.updatedSince("2026-05-01");
|
|
76
76
|
|
|
@@ -89,7 +89,7 @@ console.log(`drifted ${report.drifted.length}/${report.rowsScanned}`);
|
|
|
89
89
|
store.close();
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
The sqlite file lives under `data/_indexes/` (gitignored). Markdown remains the source of truth — the sqlite index is derived and rebuildable. See the operator decision table in [`docs/memory-extended-design.md`](
|
|
92
|
+
The sqlite file lives under `data/_indexes/` (gitignored). Markdown remains the source of truth — the sqlite index is derived and rebuildable. See the operator decision table in [`docs/memory-extended-design.md`](https://github.com/vortex-os-project/vortex/blob/main/docs/memory-extended-design.md#sqlite-namespace) for the rationale.
|
|
93
93
|
|
|
94
94
|
## Quick usage — `vector` + `recall`
|
|
95
95
|
|
|
@@ -108,7 +108,7 @@ await vector.rebuild(sqlite, embed); // → { indexed, skipped,
|
|
|
108
108
|
|
|
109
109
|
// The engine returns DATA — list it, or phrase one hit in conversation.
|
|
110
110
|
const result = await recall(
|
|
111
|
-
{ query: "tone feedback from
|
|
111
|
+
{ query: "tone feedback from last May", k: 5 }, // intent: type/tag/month parsed loosely
|
|
112
112
|
{ sqlite, vector, embed },
|
|
113
113
|
);
|
|
114
114
|
console.log(renderRecallHits(result)); // optional compact list render
|
|
@@ -117,7 +117,7 @@ vector.close();
|
|
|
117
117
|
sqlite.close();
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
The vector index shares the same `memory.sqlite` (a `memory_vectors` table) — one file, one rebuild path. The `/recall <query>` slash command wraps this engine; register it via `createRitualRegistry({ recall: { embed } })` in `@vortex-os/session-rituals`. The engine returns structured hits rather than a report so the host can either render a list or weave a hit into conversation (operator decision 5). See [`docs/memory-extended-design.md`](
|
|
120
|
+
The vector index shares the same `memory.sqlite` (a `memory_vectors` table) — one file, one rebuild path. The `/recall <query>` slash command wraps this engine; register it via `createRitualRegistry({ recall: { embed } })` in `@vortex-os/session-rituals`. The engine returns structured hits rather than a report so the host can either render a list or weave a hit into conversation (operator decision 5). See [`docs/memory-extended-design.md`](https://github.com/vortex-os-project/vortex/blob/main/docs/memory-extended-design.md#vector-namespace) for the backend/embedder rationale.
|
|
121
121
|
|
|
122
122
|
**Conversation sessions** are searchable too. `vector.rebuildSessions(sessionArchiveStore, embed)` vectorizes each archived session and stores chunks under `source: "session-archive"` plus a `session_chunks` metadata row for hydration. Run `npx rebuild-memory-vector --sessions`. `recall` then returns session hits alongside memory hits (pass a `SessionChunkStore` as `sessionChunks` to hydrate them; without it session hits are skipped). Filter to one corpus with `/recall <q> --source session-archive`.
|
|
123
123
|
|
|
@@ -238,7 +238,7 @@ The consolidator queries recently-ingested sessions from `sessionArchive`, asks
|
|
|
238
238
|
|
|
239
239
|
## Design documents
|
|
240
240
|
|
|
241
|
-
- [`docs/memory-extended-design.md`](
|
|
242
|
-
- [`docs/transcript-adapter-design.md`](
|
|
243
|
-
- [`docs/proactive-curator-design.md`](
|
|
244
|
-
- [`docs/architecture.md`](
|
|
241
|
+
- [`docs/memory-extended-design.md`](https://github.com/vortex-os-project/vortex/blob/main/docs/memory-extended-design.md) — cluster overview, sub-phase breakdown, industry pattern alignment
|
|
242
|
+
- [`docs/transcript-adapter-design.md`](https://github.com/vortex-os-project/vortex/blob/main/docs/transcript-adapter-design.md) — `sessionArchive` adapter interface, per-host schema mapping, on-disk storage, SQLite schema, lock-handling UX
|
|
243
|
+
- [`docs/proactive-curator-design.md`](https://github.com/vortex-os-project/vortex/blob/main/docs/proactive-curator-design.md) — in-session counterpart (separate module)
|
|
244
|
+
- [`docs/architecture.md`](https://github.com/vortex-os-project/vortex/blob/main/docs/architecture.md#multi-layer-memory-architecture) — multi-layer memory architecture, source-of-truth policy
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RecallResult } from "../recall/types.js";
|
|
1
|
+
import type { RecallResult, RecallMode } from "../recall/types.js";
|
|
2
2
|
import type { EmbedFn, VectorSource } from "../vector/types.js";
|
|
3
3
|
export declare const RECALL_TOOL_NAME = "recall";
|
|
4
4
|
/**
|
|
@@ -21,6 +21,11 @@ export declare const recallToolDefinition: {
|
|
|
21
21
|
type: string;
|
|
22
22
|
description: string;
|
|
23
23
|
};
|
|
24
|
+
mode: {
|
|
25
|
+
type: string;
|
|
26
|
+
enum: string[];
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
24
29
|
source: {
|
|
25
30
|
type: string;
|
|
26
31
|
enum: string[];
|
|
@@ -33,6 +38,7 @@ export declare const recallToolDefinition: {
|
|
|
33
38
|
export interface RunRecallArgs {
|
|
34
39
|
readonly query: string;
|
|
35
40
|
readonly k?: number;
|
|
41
|
+
readonly mode?: RecallMode;
|
|
36
42
|
readonly source?: VectorSource;
|
|
37
43
|
readonly noHardFilter?: boolean;
|
|
38
44
|
}
|
|
@@ -41,6 +47,12 @@ export interface RunRecallDeps {
|
|
|
41
47
|
readonly embed: EmbedFn;
|
|
42
48
|
/** Absolute path to the memory SQLite index (e.g. <dataDir>/_indexes/memory.sqlite). */
|
|
43
49
|
readonly dbPath: string;
|
|
50
|
+
/**
|
|
51
|
+
* Instance data dir, for locating the session archive (keyword session lane).
|
|
52
|
+
* If omitted, it is inferred as the grandparent of `dbPath` (the
|
|
53
|
+
* `<dataDir>/_indexes/memory.sqlite` convention); pass it when `dbPath` is custom.
|
|
54
|
+
*/
|
|
55
|
+
readonly dataDir?: string;
|
|
44
56
|
readonly defaultK?: number;
|
|
45
57
|
}
|
|
46
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-tool.d.ts","sourceRoot":"","sources":["../../src/mcp/recall-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recall-tool.d.ts","sourceRoot":"","sources":["../../src/mcp/recall-tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMhE,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBhC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AASD;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAyC/F"}
|
package/dist/mcp/recall-tool.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { dirname } from "node:path";
|
|
1
2
|
import { recall as recallEngine } from "../recall/engine.js";
|
|
2
3
|
import { MemorySqliteStore } from "../sqlite/store.js";
|
|
3
4
|
import { MemoryVectorStore } from "../vector/store.js";
|
|
4
5
|
import { SessionChunkStore } from "../vector/session.js";
|
|
6
|
+
import { SessionArchiveStore } from "../sessionArchive/index.js";
|
|
5
7
|
export const RECALL_TOOL_NAME = "recall";
|
|
6
8
|
/**
|
|
7
9
|
* MCP tool descriptor for `recall`, as plain JSON (no MCP SDK types at build
|
|
@@ -11,7 +13,7 @@ export const RECALL_TOOL_NAME = "recall";
|
|
|
11
13
|
*/
|
|
12
14
|
export const recallToolDefinition = {
|
|
13
15
|
name: RECALL_TOOL_NAME,
|
|
14
|
-
description: "
|
|
16
|
+
description: "Hybrid keyword + semantic search over the user's VortEX memory (markdown frontmatter memories + session archive). " +
|
|
15
17
|
"Returns structured hits: score, name, description, type, tags, and a short excerpt. " +
|
|
16
18
|
"Use it to recall prior context, decisions, preferences, or facts the user has stored.",
|
|
17
19
|
inputSchema: {
|
|
@@ -19,6 +21,11 @@ export const recallToolDefinition = {
|
|
|
19
21
|
properties: {
|
|
20
22
|
query: { type: "string", description: "Natural-language search query." },
|
|
21
23
|
k: { type: "number", description: "Maximum number of hits to return (default 5)." },
|
|
24
|
+
mode: {
|
|
25
|
+
type: "string",
|
|
26
|
+
enum: ["keyword", "semantic", "hybrid"],
|
|
27
|
+
description: "Search mode. 'keyword' for exact terms / error codes / file names / identifiers; 'semantic' for concepts / topics; 'hybrid' (default) runs both and fuses.",
|
|
28
|
+
},
|
|
22
29
|
source: {
|
|
23
30
|
type: "string",
|
|
24
31
|
enum: ["memory", "session-archive"],
|
|
@@ -45,16 +52,38 @@ export async function runRecall(args, deps) {
|
|
|
45
52
|
return EMPTY_RESULT;
|
|
46
53
|
}
|
|
47
54
|
const k = args.k && args.k > 0 ? args.k : deps.defaultK ?? 5;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
// Construct stores INSIDE the try so a later constructor throwing still lets the
|
|
56
|
+
// finally close whichever handles were already opened (Codex F5).
|
|
57
|
+
let sqlStore;
|
|
58
|
+
let vecStore;
|
|
59
|
+
let chunkStore;
|
|
60
|
+
let archive;
|
|
51
61
|
try {
|
|
52
|
-
|
|
62
|
+
sqlStore = new MemorySqliteStore(deps.dbPath);
|
|
63
|
+
vecStore = new MemoryVectorStore({ db: deps.dbPath });
|
|
64
|
+
chunkStore = new SessionChunkStore(deps.dbPath);
|
|
65
|
+
// The keyword session lane reads the archive's events_fts. dbPath is
|
|
66
|
+
// <dataDir>/_indexes/memory.sqlite, so the dataDir is two levels up.
|
|
67
|
+
// Best-effort: without it, the session keyword lane is silently skipped.
|
|
68
|
+
try {
|
|
69
|
+
archive = new SessionArchiveStore(deps.dataDir ?? dirname(dirname(deps.dbPath)));
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
archive = undefined;
|
|
73
|
+
}
|
|
74
|
+
return await recallEngine({ query, k, mode: args.mode, source: args.source, noHardFilter: args.noHardFilter }, {
|
|
75
|
+
sqlite: sqlStore,
|
|
76
|
+
vector: vecStore,
|
|
77
|
+
embed: deps.embed,
|
|
78
|
+
sessionChunks: chunkStore,
|
|
79
|
+
sessionArchive: archive,
|
|
80
|
+
});
|
|
53
81
|
}
|
|
54
82
|
finally {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
83
|
+
archive?.close();
|
|
84
|
+
chunkStore?.close();
|
|
85
|
+
vecStore?.close();
|
|
86
|
+
sqlStore?.close();
|
|
58
87
|
}
|
|
59
88
|
}
|
|
60
89
|
//# sourceMappingURL=recall-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-tool.js","sourceRoot":"","sources":["../../src/mcp/recall-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"recall-tool.js","sourceRoot":"","sources":["../../src/mcp/recall-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C;IAC/C,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAsBlD,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC;IAC9E,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC,CAiGD"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -33,7 +33,10 @@ export async function createRecallServer(options) {
|
|
|
33
33
|
try {
|
|
34
34
|
if (name === RECALL_TOOL_NAME) {
|
|
35
35
|
const source = raw.source === "memory" || raw.source === "session-archive" ? raw.source : undefined;
|
|
36
|
-
const
|
|
36
|
+
const mode = raw.mode === "keyword" || raw.mode === "semantic" || raw.mode === "hybrid"
|
|
37
|
+
? raw.mode
|
|
38
|
+
: undefined;
|
|
39
|
+
const result = await runRecall({ query: str(raw.query) ?? "", k: num(raw.k), mode, source }, { embed: options.embed, dbPath: options.dbPath, dataDir: options.dataDir, defaultK: options.defaultK });
|
|
37
40
|
return jsonResult({ query: result.query, count: result.hits.length, hits: result.hits });
|
|
38
41
|
}
|
|
39
42
|
if (name === LIST_MEMORIES_TOOL_NAME) {
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,YAAY,EACZ,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAkB7B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAA4B;IAInE,MAAM,GAAG,GAAG,MAAM,UAAU,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAC3B,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,mBAAmB,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,EAClF,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAChE,KAAK,EAAE;YACL,oBAAoB;YACpB,0BAA0B;YAC1B,uBAAuB;YACvB,6BAA6B;YAC7B,2BAA2B;YAC3B,6BAA6B;SAC9B;KACF,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,qBAAqB,E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E,CAAC;AACjF,CAAC;AAiBD,KAAK,UAAU,UAAU;IACvB,MAAM,eAAe,GAAG,2CAA2C,CAAC;IACpE,MAAM,cAAc,GAAG,oCAAoC,CAAC;IAC5D,IAAI,CAAC;QACH,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC9C,MAAM,CAAC,eAAe,CAAC;YACvB,MAAM,CAAC,cAAc,CAAC;SACvB,CAAC,CAAC;QACH,OAAO;YACL,MAAM,EAAG,SAA0C,CAAC,MAAM;YAC1D,sBAAsB,EAAG,QAAgD;iBACtE,sBAAsB;YACzB,qBAAqB,EAAG,QAA+C;iBACpE,qBAAqB;SACzB,CAAC;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,kEAAkE;YAChE,sFAAsF;YACtF,kEAAmE,CAAW,CAAC,OAAO,EAAE,CAC3F,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/recall/engine.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { MemorySqliteStore } from "../sqlite/store.js";
|
|
|
2
2
|
import type { MemoryVectorStore } from "../vector/store.js";
|
|
3
3
|
import type { EmbedFn } from "../vector/types.js";
|
|
4
4
|
import type { SessionChunkStore } from "../vector/session.js";
|
|
5
|
+
import type { SessionArchiveStore } from "../sessionArchive/index.js";
|
|
5
6
|
import type { RecallParams, RecallResult } from "./types.js";
|
|
6
7
|
/** Dependencies the recall engine needs the host to supply. */
|
|
7
8
|
export interface RecallDeps {
|
|
@@ -9,30 +10,31 @@ export interface RecallDeps {
|
|
|
9
10
|
readonly vector: MemoryVectorStore;
|
|
10
11
|
readonly embed: EmbedFn;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* Hydrates session-archive SEMANTIC hits (vector → chunk metadata). Without
|
|
14
|
+
* it the session semantic lane is skipped (graceful degradation), so a host
|
|
14
15
|
* that has not vectorized sessions still gets memory recall.
|
|
15
16
|
*/
|
|
16
17
|
readonly sessionChunks?: SessionChunkStore;
|
|
18
|
+
/**
|
|
19
|
+
* Enables the session KEYWORD lane (`searchEvents`). Without it the session
|
|
20
|
+
* keyword lane is skipped — the same graceful-degradation precedent.
|
|
21
|
+
*/
|
|
22
|
+
readonly sessionArchive?: SessionArchiveStore;
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
25
|
+
* Hybrid recall (P3). Branches on `mode`:
|
|
26
|
+
* - `semantic` — the original cosine pipeline (memory hard-filter → vector
|
|
27
|
+
* rerank), unchanged in behavior.
|
|
28
|
+
* - `keyword` — FTS5 over memories + session events.
|
|
29
|
+
* - `hybrid` (default) — both lanes, fused by Reciprocal Rank Fusion.
|
|
23
30
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* filter never costs you a relevant-but-unfiltered memory.
|
|
32
|
-
* 3. **Semantic rerank** — embed the (filter-stripped) query text and ask
|
|
33
|
-
* the vector store for the closest candidates.
|
|
34
|
-
* 4. **Hydrate** — join vector hits back to their memory rows for name,
|
|
35
|
-
* description, tags, and a body excerpt.
|
|
31
|
+
* Returns structured {@link RecallResult} data — never a pre-rendered report.
|
|
32
|
+
* The memory hard-filter (parsed type/tag/date) constrains the MEMORY lanes
|
|
33
|
+
* only; session lanes filter by their own semantics (§12 R8). Session hits fuse
|
|
34
|
+
* at the SESSION level — the semantic lane is de-duped to one best chunk per
|
|
35
|
+
* session before ranking (§13). The tool_result keyword downweight applies in
|
|
36
|
+
* `hybrid` only (§12 R6). `score` stays cosine for any semantically-matched
|
|
37
|
+
* hit; a keyword-only hit gets `1/(1+rank)` (§12 R7).
|
|
36
38
|
*/
|
|
37
39
|
export declare function recall(params: RecallParams, deps: RecallDeps): Promise<RecallResult>;
|
|
38
40
|
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/recall/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/recall/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,4BAA4B,CAAC;AAWzF,OAAO,KAAK,EAAyB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEpF,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;CAC/C;AAwBD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAoL1F"}
|