memoryrouter-codex 1.6.0 → 1.6.1
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 +1 -0
- package/package.json +1 -1
- package/runtime/constants.cjs +1 -1
- package/runtime/mcp-stdio.cjs +28 -5
- package/runtime/memory.cjs +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/runtime/constants.cjs
CHANGED
package/runtime/mcp-stdio.cjs
CHANGED
|
@@ -15,13 +15,13 @@ const SERVER_INSTRUCTIONS = 'MemoryRouter provides durable cross-machine, cross-
|
|
|
15
15
|
const TOOLS = [
|
|
16
16
|
{
|
|
17
17
|
name: 'memory_search',
|
|
18
|
-
description: "Search durable MemoryRouter memories. Defaults to the current git project and filters other projects out. Tier guide: tier 3 holds the highest-level consolidated reflections (identity, principles, what matters most), tier 2 holds reflections of specific meaningful events, tier 1 holds raw verbatim memories. Match filters to the question. Broad 'most important things we have done' questions: tiers [3], importance 8 or higher, large limit such as
|
|
18
|
+
description: "Search durable MemoryRouter memories. Defaults to the current git project and filters other projects out. Tier guide: tier 3 holds the highest-level consolidated reflections (identity, principles, what matters most), tier 2 holds reflections of specific meaningful events, tier 1 holds raw verbatim memories. Match filters to the question. Broad 'most important things we have done' questions: tiers [3], importance 8 or higher, large limit such as 250. Big-picture overviews like 'what do you know about this area or period': tiers [3] with no importance filter. Specific lookups like 'find the decision about X': omit tiers to search all tiers blended and leave importance unset; a high importance filter hides the specific detail you are looking for. Specific meaningful events without raw noise: tiers [2] or [2, 3]. Exact verbatim detail: if the detail is not already in context, drill down by lineage: search tiers [3] to find the relevant thread, then use memory_inspect on the result to see the tier 2 reflections it consolidated, then inspect those to reach the raw memories underneath. Direct tiers [1] search works when you know exact wording to match. Mixing tiers is legitimate; adjust the importance threshold to the question rather than always setting it high. Only reflections (tiers 2 and 3) carry importance ratings. For time-window questions like 'what happened last week' or 'lately' use memory_date_search instead.",
|
|
19
19
|
inputSchema: {
|
|
20
20
|
type: 'object',
|
|
21
21
|
properties: {
|
|
22
22
|
query: { type: 'string', description: 'Semantic search query.' },
|
|
23
|
-
limit: { type: 'integer', minimum: 1, maximum:
|
|
24
|
-
tiers: { type: 'array', items: { type: 'integer', enum: [1, 2, 3] }, minItems: 1, uniqueItems: true, description: "Restrict results to these memory tiers. 3 highest-level consolidated reflections (identity, principles, what matters most), 2 reflections of specific meaningful events, 1 raw verbatim memories. Use [3] for broad 'most important' or big-picture questions, [2] or [2, 3] for specific meaningful events, [1] for exact verbatim detail. Omit to search all tiers blended, the right default for specific lookups. Mixing tiers is fine. Only tiers 2 and 3 carry importance ratings." },
|
|
23
|
+
limit: { type: 'integer', minimum: 1, maximum: 250, description: 'Candidate results before project filtering.' },
|
|
24
|
+
tiers: { type: 'array', items: { type: 'integer', enum: [1, 2, 3] }, minItems: 1, uniqueItems: true, description: "Restrict results to these memory tiers. 3 highest-level consolidated reflections (identity, principles, what matters most), 2 reflections of specific meaningful events, 1 raw verbatim memories. Use [3] for broad 'most important' or big-picture questions, [2] or [2, 3] for specific meaningful events, [1] for exact verbatim detail when you know the wording to match; otherwise drill down from [3] with memory_inspect. Omit to search all tiers blended, the right default for specific lookups. Mixing tiers is fine. Only tiers 2 and 3 carry importance ratings." },
|
|
25
25
|
importance: { type: 'integer', minimum: 1, maximum: 10, description: "Minimum importance threshold, 1 to 10. Only reflections (tiers 2 and 3) carry ratings, so raw memories are excluded whenever this is set. Use 8 or higher with tiers [3] for broad 'most important' questions. Leave unset for general or specific searches; a high threshold hides relevant material." },
|
|
26
26
|
},
|
|
27
27
|
required: ['query'],
|
|
@@ -30,14 +30,14 @@ const TOOLS = [
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
name: 'memory_date_search',
|
|
33
|
-
description: "Retrieve memories from a specific time window. Use for questions like 'what happened last week' or 'most important things this month or lately'. Tier guide: tier 3 holds the highest-level consolidated reflections (identity, principles, what matters most), tier 2 holds reflections of specific meaningful events, tier 1 holds raw verbatim memories. Match filters to the question. Time-bounded 'most important things last month' questions: tiers [3], importance 8 or higher, generous max_tokens. Big-picture overviews of a period like 'what do you know about July': tiers [3] with no importance filter. Specific lookups in a window like 'find the decision about X': omit tiers to include all tiers and leave importance unset; a high importance filter hides the specific detail you are looking for. Specific meaningful events without raw noise: tiers [2] or [2, 3]. Exact verbatim detail: tiers [1]. Mixing tiers is legitimate; adjust the importance threshold to the question rather than always setting it high. Only reflections (tiers 2 and 3) carry importance ratings. Omit query for a chronological review; include query to rank by relevance within the window. Resolve relative phrases like 'lately' to concrete ISO dates before calling.",
|
|
33
|
+
description: "Retrieve memories from a specific time window. Use for questions like 'what happened last week' or 'most important things this month or lately'. Tier guide: tier 3 holds the highest-level consolidated reflections (identity, principles, what matters most), tier 2 holds reflections of specific meaningful events, tier 1 holds raw verbatim memories. Match filters to the question. Time-bounded 'most important things last month' questions: tiers [3], importance 8 or higher, generous max_tokens. Big-picture overviews of a period like 'what do you know about July': tiers [3] with no importance filter. Specific lookups in a window like 'find the decision about X': omit tiers to include all tiers and leave importance unset; a high importance filter hides the specific detail you are looking for. Specific meaningful events without raw noise: tiers [2] or [2, 3]. Exact verbatim detail: if the detail is not already in context, drill down by lineage: search tiers [3] to find the relevant thread, then use memory_inspect on the result to see the tier 2 reflections it consolidated, then inspect those to reach the raw memories underneath. Direct tiers [1] search works when you know exact wording to match. Mixing tiers is legitimate; adjust the importance threshold to the question rather than always setting it high. Only reflections (tiers 2 and 3) carry importance ratings. Omit query for a chronological review; include query to rank by relevance within the window. Resolve relative phrases like 'lately' to concrete ISO dates before calling.",
|
|
34
34
|
inputSchema: {
|
|
35
35
|
type: 'object',
|
|
36
36
|
properties: {
|
|
37
37
|
from: { type: 'string', description: 'Window start, ISO 8601 date or datetime (e.g. 2026-08-10 or 2026-08-10T00:00:00Z). Required. Must be a concrete date, not a relative phrase.' },
|
|
38
38
|
to: { type: 'string', description: 'Window end, ISO 8601 date or datetime. Optional, defaults to now.' },
|
|
39
39
|
query: { type: 'string', description: 'Optional relevance query. Omit for a pure chronological browse; include to rank results within the window.' },
|
|
40
|
-
tiers: { type: 'array', items: { type: 'integer', enum: [1, 2, 3] }, minItems: 1, uniqueItems: true, description: "Restrict results to these memory tiers. 3 highest-level consolidated reflections (identity, principles, what matters most), 2 reflections of specific meaningful events, 1 raw verbatim memories. Use [3] for broad 'most important' or big-picture questions, [2] or [2, 3] for specific meaningful events, [1] for exact verbatim detail. Omit to search all tiers blended, the right default for specific lookups. Mixing tiers is fine. Only tiers 2 and 3 carry importance ratings." },
|
|
40
|
+
tiers: { type: 'array', items: { type: 'integer', enum: [1, 2, 3] }, minItems: 1, uniqueItems: true, description: "Restrict results to these memory tiers. 3 highest-level consolidated reflections (identity, principles, what matters most), 2 reflections of specific meaningful events, 1 raw verbatim memories. Use [3] for broad 'most important' or big-picture questions, [2] or [2, 3] for specific meaningful events, [1] for exact verbatim detail when you know the wording to match; otherwise drill down from [3] with memory_inspect. Omit to search all tiers blended, the right default for specific lookups. Mixing tiers is fine. Only tiers 2 and 3 carry importance ratings." },
|
|
41
41
|
importance: { type: 'integer', minimum: 1, maximum: 10, description: "Minimum importance threshold, 1 to 10. Only reflections (tiers 2 and 3) carry ratings, so raw memories are excluded whenever this is set. Use 8 or higher with tiers [3] for broad 'most important' questions. Leave unset for general or specific searches; a high threshold hides relevant material." },
|
|
42
42
|
max_tokens: { type: 'integer', minimum: 1000, maximum: 200000, description: 'Token budget for returned results. Server default 50000; use a smaller value like 5000 for a quick look.' },
|
|
43
43
|
},
|
|
@@ -45,6 +45,19 @@ const TOOLS = [
|
|
|
45
45
|
},
|
|
46
46
|
annotations: { title: 'Date search MemoryRouter', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
name: 'memory_inspect',
|
|
50
|
+
description: "Inspect a memory's consolidation lineage by memory_id: its tier, the sources it consolidated, and what it was consolidated into. Use repeatedly to drill down from a high-level reflection to the tier 2 reflections and raw memories beneath it. Read only.",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
properties: {
|
|
54
|
+
memory_id: { type: 'string', description: 'A memory id (UUID) from a search result or a previous inspect.' },
|
|
55
|
+
},
|
|
56
|
+
required: ['memory_id'],
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
},
|
|
59
|
+
annotations: { title: 'Inspect memory lineage', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
60
|
+
},
|
|
48
61
|
{
|
|
49
62
|
name: 'memory_store',
|
|
50
63
|
description: 'Store a concise durable project memory. Returns a stable content-derived handle and deduplicates exact repeats.',
|
|
@@ -235,6 +248,16 @@ async function callTool(name, args = {}, options = {}) {
|
|
|
235
248
|
}
|
|
236
249
|
return textResult(text);
|
|
237
250
|
}
|
|
251
|
+
if (name === 'memory_inspect') {
|
|
252
|
+
if (!args.memory_id || typeof args.memory_id !== 'string' || !args.memory_id.trim()) {
|
|
253
|
+
return textResult('memory_id is required', true);
|
|
254
|
+
}
|
|
255
|
+
const response = await api.inspect(key, args.memory_id.trim(), { apiBase: config.apiBase });
|
|
256
|
+
if (response.status === 404) return textResult('No memory with that id in the connected vault.', true);
|
|
257
|
+
if (!response.ok) return textResult(`Inspect failed (HTTP ${response.status}).`, true);
|
|
258
|
+
recordAudit('inspect', { ok: true, project: project.handle }, env);
|
|
259
|
+
return textResult(JSON.stringify(response.data || {}, null, 2));
|
|
260
|
+
}
|
|
238
261
|
if (name === 'memory_consolidate') {
|
|
239
262
|
const tier = args.tier === undefined ? 1 : args.tier;
|
|
240
263
|
if (tier !== 1 && tier !== 2) return textResult('tier must be 1 or 2', true);
|
package/runtime/memory.cjs
CHANGED
|
@@ -107,7 +107,7 @@ async function searchScoped(query, options = {}) {
|
|
|
107
107
|
return { ok: false, reason: 'no-api-key', memories: [], context: '' };
|
|
108
108
|
}
|
|
109
109
|
const project = options.project || resolveProject(options.cwd);
|
|
110
|
-
const limit = Math.max(1, Math.min(
|
|
110
|
+
const limit = Math.max(1, Math.min(250, Number(options.limit || config.maxSearchResults || 12)));
|
|
111
111
|
const response = await api.search(
|
|
112
112
|
key,
|
|
113
113
|
`${normalizeContent(query)}\nMemoryRouter project handle ${project.handle}`,
|