iranti 0.2.32 → 0.2.35
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 +771 -771
- package/bin/iranti.js +1 -1
- package/dist/scripts/iranti-mcp.js +20 -20
- package/dist/src/api/server.js +1 -1
- package/dist/src/archivist/index.js +9 -9
- package/dist/src/attendant/AttendantInstance.js +54 -54
- package/dist/src/lib/commandInvocation.js +3 -3
- package/dist/src/lib/commandInvocation.js.map +1 -1
- package/dist/src/librarian/index.js +51 -51
- package/dist/src/library/queries.js +85 -85
- package/package.json +1 -1
package/bin/iranti.js
CHANGED
|
@@ -145,12 +145,12 @@ async function main() {
|
|
|
145
145
|
await ensureDefaultAgent(iranti);
|
|
146
146
|
const server = new mcp_js_1.McpServer({
|
|
147
147
|
name: 'iranti-mcp',
|
|
148
|
-
version: '0.2.
|
|
148
|
+
version: '0.2.35',
|
|
149
149
|
});
|
|
150
150
|
server.registerTool('iranti_handshake', {
|
|
151
|
-
description: `Initialize or refresh an agent's working-memory brief for the current task.
|
|
152
|
-
Call this at session start or when a new task begins, passing the task and
|
|
153
|
-
recent messages. Returns operating rules plus prioritized relevant memory
|
|
151
|
+
description: `Initialize or refresh an agent's working-memory brief for the current task.
|
|
152
|
+
Call this at session start or when a new task begins, passing the task and
|
|
153
|
+
recent messages. Returns operating rules plus prioritized relevant memory
|
|
154
154
|
for that task. Do not use this as a per-turn retrieval tool; use iranti_attend.`,
|
|
155
155
|
inputSchema: {
|
|
156
156
|
task: z.string().min(1).describe('The current task or objective.'),
|
|
@@ -166,11 +166,11 @@ for that task. Do not use this as a per-turn retrieval tool; use iranti_attend.`
|
|
|
166
166
|
return textResult(result);
|
|
167
167
|
});
|
|
168
168
|
server.registerTool('iranti_attend', {
|
|
169
|
-
description: `Ask Iranti whether memory should be injected before the next LLM turn.
|
|
170
|
-
Call this before each turn, passing the latest message and the current
|
|
171
|
-
visible context window. Returns an injection decision plus any facts
|
|
172
|
-
that should be added to context if relevant memory is missing.
|
|
173
|
-
Omitting currentContext falls back to latestMessage only — pass the
|
|
169
|
+
description: `Ask Iranti whether memory should be injected before the next LLM turn.
|
|
170
|
+
Call this before each turn, passing the latest message and the current
|
|
171
|
+
visible context window. Returns an injection decision plus any facts
|
|
172
|
+
that should be added to context if relevant memory is missing.
|
|
173
|
+
Omitting currentContext falls back to latestMessage only — pass the
|
|
174
174
|
full visible context when available.`,
|
|
175
175
|
inputSchema: {
|
|
176
176
|
latestMessage: z.string().min(1).describe('The latest user or assistant message.'),
|
|
@@ -209,10 +209,10 @@ full visible context when available.`,
|
|
|
209
209
|
return textResult(result);
|
|
210
210
|
});
|
|
211
211
|
server.registerTool('iranti_query', {
|
|
212
|
-
description: `Retrieve the current fact for an exact entity+key lookup.
|
|
213
|
-
Use this when you already know both the entity and the key.
|
|
214
|
-
Returns the current value, summary, confidence, source, and
|
|
215
|
-
temporal metadata when available. Prefer this over iranti_search
|
|
212
|
+
description: `Retrieve the current fact for an exact entity+key lookup.
|
|
213
|
+
Use this when you already know both the entity and the key.
|
|
214
|
+
Returns the current value, summary, confidence, source, and
|
|
215
|
+
temporal metadata when available. Prefer this over iranti_search
|
|
216
216
|
when the target fact is already known.`,
|
|
217
217
|
inputSchema: {
|
|
218
218
|
entity: z.string().min(1).describe('Entity in entityType/entityId format.'),
|
|
@@ -223,8 +223,8 @@ when the target fact is already known.`,
|
|
|
223
223
|
return textResult(result);
|
|
224
224
|
});
|
|
225
225
|
server.registerTool('iranti_search', {
|
|
226
|
-
description: `Search shared memory with natural language when the exact entity
|
|
227
|
-
or key is unknown. Uses hybrid lexical and vector search across
|
|
226
|
+
description: `Search shared memory with natural language when the exact entity
|
|
227
|
+
or key is unknown. Uses hybrid lexical and vector search across
|
|
228
228
|
stored facts. Use this for discovery and recall, not exact lookup.`,
|
|
229
229
|
inputSchema: {
|
|
230
230
|
query: z.string().min(1).describe('Natural language search phrase.'),
|
|
@@ -248,11 +248,11 @@ stored facts. Use this for discovery and recall, not exact lookup.`,
|
|
|
248
248
|
return textResult(result);
|
|
249
249
|
});
|
|
250
250
|
server.registerTool('iranti_write', {
|
|
251
|
-
description: `Write one durable fact to shared memory for a specific entity.
|
|
252
|
-
Use this when you learned something concrete that future turns,
|
|
253
|
-
agents, or sessions should retain. Requires: entity ("type/id"),
|
|
254
|
-
key, value JSON, and summary. Confidence is optional and defaults
|
|
255
|
-
to 85. Conflicts on the same entity+key are detected automatically
|
|
251
|
+
description: `Write one durable fact to shared memory for a specific entity.
|
|
252
|
+
Use this when you learned something concrete that future turns,
|
|
253
|
+
agents, or sessions should retain. Requires: entity ("type/id"),
|
|
254
|
+
key, value JSON, and summary. Confidence is optional and defaults
|
|
255
|
+
to 85. Conflicts on the same entity+key are detected automatically
|
|
256
256
|
and may be resolved or escalated.`,
|
|
257
257
|
inputSchema: {
|
|
258
258
|
entity: z.string().min(1).describe('Entity in entityType/entityId format.'),
|
package/dist/src/api/server.js
CHANGED
|
@@ -39,7 +39,7 @@ const RUNTIME_AUTHORITY = (0, runtimeLifecycle_1.resolveRuntimeAuthorityFromEnv)
|
|
|
39
39
|
const INSTANCE_DIR = RUNTIME_AUTHORITY.instanceDir;
|
|
40
40
|
const INSTANCE_RUNTIME_FILE = RUNTIME_AUTHORITY.runtimeFile;
|
|
41
41
|
const INSTANCE_NAME = process.env.IRANTI_INSTANCE_NAME?.trim() || (INSTANCE_DIR ? path_1.default.basename(INSTANCE_DIR) : 'adhoc');
|
|
42
|
-
const VERSION = '0.2.
|
|
42
|
+
const VERSION = '0.2.35';
|
|
43
43
|
const PORT_RAW = (process.env.IRANTI_PORT ?? '3001').trim();
|
|
44
44
|
const PORT = Number.parseInt(PORT_RAW, 10);
|
|
45
45
|
const runtimeMetadataHealth = {
|
|
@@ -346,15 +346,15 @@ async function processEscalationFile(filename, paths, report) {
|
|
|
346
346
|
report.escalationsProcessed++;
|
|
347
347
|
}
|
|
348
348
|
async function generateEnrichment(fileContent, auth) {
|
|
349
|
-
const prompt = `You are analyzing a resolved conflict. The human provided this authoritative resolution:
|
|
350
|
-
|
|
351
|
-
${JSON.stringify(auth, null, 2)}
|
|
352
|
-
|
|
353
|
-
Provide enrichment (non-authoritative):
|
|
354
|
-
1. Brief explanation of why this resolution makes sense
|
|
355
|
-
2. Suggested validUntil (ISO 8601) if none provided and fact seems time-bound
|
|
356
|
-
3. Any normalization warnings
|
|
357
|
-
|
|
349
|
+
const prompt = `You are analyzing a resolved conflict. The human provided this authoritative resolution:
|
|
350
|
+
|
|
351
|
+
${JSON.stringify(auth, null, 2)}
|
|
352
|
+
|
|
353
|
+
Provide enrichment (non-authoritative):
|
|
354
|
+
1. Brief explanation of why this resolution makes sense
|
|
355
|
+
2. Suggested validUntil (ISO 8601) if none provided and fact seems time-bound
|
|
356
|
+
3. Any normalization warnings
|
|
357
|
+
|
|
358
358
|
Respond with JSON: { "explanation": "...", "suggestedValidUntil": "..." or null, "normalizationWarnings": [...] }`;
|
|
359
359
|
const response = await (0, llm_1.complete)([
|
|
360
360
|
{ role: 'user', content: prompt }
|
|
@@ -823,29 +823,29 @@ class AttendantInstance {
|
|
|
823
823
|
const entityResponse = await (0, router_1.route)('extraction', [
|
|
824
824
|
{
|
|
825
825
|
role: 'user',
|
|
826
|
-
content: `Extract explicitly named entities from the text.
|
|
827
|
-
An entity can be a person, organization, project, technology, or named concept.
|
|
828
|
-
|
|
829
|
-
Return ONLY valid JSON as an array of objects in this exact shape:
|
|
830
|
-
[
|
|
831
|
-
{
|
|
832
|
-
"type": "project",
|
|
833
|
-
"name": "Project Atlas",
|
|
834
|
-
"id_guess": "project_atlas",
|
|
835
|
-
"confidence": 0.92,
|
|
836
|
-
"evidence": "Project Atlas",
|
|
837
|
-
"start": 123,
|
|
838
|
-
"end": 136
|
|
839
|
-
}
|
|
840
|
-
]
|
|
841
|
-
|
|
842
|
-
Rules:
|
|
843
|
-
- Only include entities explicitly named in the provided text.
|
|
844
|
-
- Do not infer or carry over entities not present in the text.
|
|
845
|
-
- If uncertain, omit.
|
|
846
|
-
- If none are present, return [].
|
|
847
|
-
|
|
848
|
-
Text:
|
|
826
|
+
content: `Extract explicitly named entities from the text.
|
|
827
|
+
An entity can be a person, organization, project, technology, or named concept.
|
|
828
|
+
|
|
829
|
+
Return ONLY valid JSON as an array of objects in this exact shape:
|
|
830
|
+
[
|
|
831
|
+
{
|
|
832
|
+
"type": "project",
|
|
833
|
+
"name": "Project Atlas",
|
|
834
|
+
"id_guess": "project_atlas",
|
|
835
|
+
"confidence": 0.92,
|
|
836
|
+
"evidence": "Project Atlas",
|
|
837
|
+
"start": 123,
|
|
838
|
+
"end": 136
|
|
839
|
+
}
|
|
840
|
+
]
|
|
841
|
+
|
|
842
|
+
Rules:
|
|
843
|
+
- Only include entities explicitly named in the provided text.
|
|
844
|
+
- Do not infer or carry over entities not present in the text.
|
|
845
|
+
- If uncertain, omit.
|
|
846
|
+
- If none are present, return [].
|
|
847
|
+
|
|
848
|
+
Text:
|
|
849
849
|
${detectionWindow}`,
|
|
850
850
|
},
|
|
851
851
|
], 512);
|
|
@@ -1149,20 +1149,20 @@ ${detectionWindow}`,
|
|
|
1149
1149
|
const response = await (0, router_1.route)('classification', [
|
|
1150
1150
|
{
|
|
1151
1151
|
role: 'user',
|
|
1152
|
-
content: `Decide whether this assistant should fetch persistent memory before replying.
|
|
1153
|
-
|
|
1154
|
-
Latest user message:
|
|
1155
|
-
${input.latestMessage || '(none)'}
|
|
1156
|
-
|
|
1157
|
-
Recent context excerpt:
|
|
1158
|
-
${contextWindow || '(empty)'}
|
|
1159
|
-
|
|
1160
|
-
Return ONLY valid JSON with this exact shape:
|
|
1161
|
-
{"needsMemory":true,"confidence":0.81,"reason":"short_reason"}
|
|
1162
|
-
|
|
1163
|
-
Rules:
|
|
1164
|
-
- needsMemory=true when the answer likely depends on user-specific or session-specific facts.
|
|
1165
|
-
- needsMemory=false for generic chit-chat, open-domain facts, or when no memory lookup is needed.
|
|
1152
|
+
content: `Decide whether this assistant should fetch persistent memory before replying.
|
|
1153
|
+
|
|
1154
|
+
Latest user message:
|
|
1155
|
+
${input.latestMessage || '(none)'}
|
|
1156
|
+
|
|
1157
|
+
Recent context excerpt:
|
|
1158
|
+
${contextWindow || '(empty)'}
|
|
1159
|
+
|
|
1160
|
+
Return ONLY valid JSON with this exact shape:
|
|
1161
|
+
{"needsMemory":true,"confidence":0.81,"reason":"short_reason"}
|
|
1162
|
+
|
|
1163
|
+
Rules:
|
|
1164
|
+
- needsMemory=true when the answer likely depends on user-specific or session-specific facts.
|
|
1165
|
+
- needsMemory=false for generic chit-chat, open-domain facts, or when no memory lookup is needed.
|
|
1166
1166
|
- confidence is a float from 0 to 1.`,
|
|
1167
1167
|
},
|
|
1168
1168
|
], 128);
|
|
@@ -1228,14 +1228,14 @@ Rules:
|
|
|
1228
1228
|
const response = await (0, router_1.route)('task_inference', [
|
|
1229
1229
|
{
|
|
1230
1230
|
role: 'user',
|
|
1231
|
-
content: `You are analyzing what an AI agent is currently working on.
|
|
1232
|
-
|
|
1233
|
-
Agent ID: ${this.agentId}
|
|
1234
|
-
Task description: ${context.task}
|
|
1235
|
-
Recent messages:
|
|
1236
|
-
${context.recentMessages.map((m, i) => `${i + 1}. ${m}`).join('\n')}
|
|
1237
|
-
|
|
1238
|
-
In one short sentence, describe the specific type of task this agent is currently performing.
|
|
1231
|
+
content: `You are analyzing what an AI agent is currently working on.
|
|
1232
|
+
|
|
1233
|
+
Agent ID: ${this.agentId}
|
|
1234
|
+
Task description: ${context.task}
|
|
1235
|
+
Recent messages:
|
|
1236
|
+
${context.recentMessages.map((m, i) => `${i + 1}. ${m}`).join('\n')}
|
|
1237
|
+
|
|
1238
|
+
In one short sentence, describe the specific type of task this agent is currently performing.
|
|
1239
1239
|
Be specific and concrete.`,
|
|
1240
1240
|
},
|
|
1241
1241
|
], 256);
|
|
@@ -1267,15 +1267,15 @@ Be specific and concrete.`,
|
|
|
1267
1267
|
const response = await (0, router_1.route)('relevance_filtering', [
|
|
1268
1268
|
{
|
|
1269
1269
|
role: 'user',
|
|
1270
|
-
content: `You are deciding what knowledge an AI agent needs for its current task.
|
|
1271
|
-
|
|
1272
|
-
Agent task: ${taskType}
|
|
1273
|
-
|
|
1274
|
-
Available knowledge entries:
|
|
1275
|
-
${entryInputs.map((e, i) => `${i + 1}. [${e.key}] ${e.valueSummary} (confidence: ${e.confidence})`).join('\n')}
|
|
1276
|
-
|
|
1277
|
-
Return only the numbers of entries that are directly relevant to the current task.
|
|
1278
|
-
Format: comma-separated numbers only. Example: 1,3,5
|
|
1270
|
+
content: `You are deciding what knowledge an AI agent needs for its current task.
|
|
1271
|
+
|
|
1272
|
+
Agent task: ${taskType}
|
|
1273
|
+
|
|
1274
|
+
Available knowledge entries:
|
|
1275
|
+
${entryInputs.map((e, i) => `${i + 1}. [${e.key}] ${e.valueSummary} (confidence: ${e.confidence})`).join('\n')}
|
|
1276
|
+
|
|
1277
|
+
Return only the numbers of entries that are directly relevant to the current task.
|
|
1278
|
+
Format: comma-separated numbers only. Example: 1,3,5
|
|
1279
1279
|
If nothing is relevant, return: none`,
|
|
1280
1280
|
},
|
|
1281
1281
|
], 128);
|
|
@@ -175,12 +175,12 @@ function windowsCodexInvocation(args) {
|
|
|
175
175
|
return windowsCodexInvocationFromCandidates(windowsCodexCandidates(windowsWhereHits('codex')), args);
|
|
176
176
|
}
|
|
177
177
|
function resolveCommandInvocation(executable, args) {
|
|
178
|
-
if (process.platform !== 'win32') {
|
|
179
|
-
return { executable, args: [...args] };
|
|
180
|
-
}
|
|
181
178
|
const shim = genericTestToolShim(executable, args);
|
|
182
179
|
if (shim)
|
|
183
180
|
return shim;
|
|
181
|
+
if (process.platform !== 'win32') {
|
|
182
|
+
return { executable, args: [...args] };
|
|
183
|
+
}
|
|
184
184
|
if (executable === 'npm') {
|
|
185
185
|
const override = windowsNodeToolOverride('IRANTI_TEST_NPM_CLI', executable, args);
|
|
186
186
|
if (override)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,UAAU,qBAAqB,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBACjE,OAAO;YACX,CAAC;YACD,OAAO,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -588,30 +588,30 @@ async function resolveWithReasoning(existing, incoming, existingScore, incomingS
|
|
|
588
588
|
const response = await (0, router_1.route)('conflict_resolution', [
|
|
589
589
|
{
|
|
590
590
|
role: 'user',
|
|
591
|
-
content: `You are resolving a knowledge conflict between two AI agents.
|
|
592
|
-
|
|
593
|
-
Entity: ${incoming.entityType} / ${incoming.entityId} / ${incoming.key}
|
|
594
|
-
|
|
595
|
-
Existing entry:
|
|
596
|
-
- Value: ${JSON.stringify(existing.valueRaw)}
|
|
597
|
-
- Confidence: ${existing.confidence}
|
|
598
|
-
- Source: ${existing.source}
|
|
599
|
-
- Created: ${existing.createdAt.toISOString()}
|
|
600
|
-
|
|
601
|
-
Incoming entry:
|
|
602
|
-
- Value: ${JSON.stringify(incoming.valueRaw)}
|
|
603
|
-
- Confidence: ${incoming.confidence}
|
|
604
|
-
- Source: ${incoming.source}
|
|
605
|
-
|
|
606
|
-
Consider:
|
|
607
|
-
1. Which source is more authoritative for this type of data?
|
|
608
|
-
2. Which entry is more recent?
|
|
609
|
-
3. Are these values genuinely contradictory or measuring different things?
|
|
610
|
-
4. Can you determine a clear winner?
|
|
611
|
-
|
|
612
|
-
Respond with exactly one of these decisions and a one-sentence reason:
|
|
613
|
-
KEEP_EXISTING: <reason>
|
|
614
|
-
KEEP_INCOMING: <reason>
|
|
591
|
+
content: `You are resolving a knowledge conflict between two AI agents.
|
|
592
|
+
|
|
593
|
+
Entity: ${incoming.entityType} / ${incoming.entityId} / ${incoming.key}
|
|
594
|
+
|
|
595
|
+
Existing entry:
|
|
596
|
+
- Value: ${JSON.stringify(existing.valueRaw)}
|
|
597
|
+
- Confidence: ${existing.confidence}
|
|
598
|
+
- Source: ${existing.source}
|
|
599
|
+
- Created: ${existing.createdAt.toISOString()}
|
|
600
|
+
|
|
601
|
+
Incoming entry:
|
|
602
|
+
- Value: ${JSON.stringify(incoming.valueRaw)}
|
|
603
|
+
- Confidence: ${incoming.confidence}
|
|
604
|
+
- Source: ${incoming.source}
|
|
605
|
+
|
|
606
|
+
Consider:
|
|
607
|
+
1. Which source is more authoritative for this type of data?
|
|
608
|
+
2. Which entry is more recent?
|
|
609
|
+
3. Are these values genuinely contradictory or measuring different things?
|
|
610
|
+
4. Can you determine a clear winner?
|
|
611
|
+
|
|
612
|
+
Respond with exactly one of these decisions and a one-sentence reason:
|
|
613
|
+
KEEP_EXISTING: <reason>
|
|
614
|
+
KEEP_INCOMING: <reason>
|
|
615
615
|
ESCALATE: <reason>`,
|
|
616
616
|
},
|
|
617
617
|
], 512);
|
|
@@ -783,33 +783,33 @@ function buildConflictSnapshot(existing, incoming) {
|
|
|
783
783
|
function buildInitialEscalationContent(existing, incoming) {
|
|
784
784
|
const filename = buildEscalationFilename(incoming.entityType, incoming.entityId, incoming.key);
|
|
785
785
|
const snapshot = buildConflictSnapshot(existing, incoming);
|
|
786
|
-
return `# Escalation: ${filename}
|
|
787
|
-
|
|
788
|
-
## LIBRARIAN ASSESSMENT
|
|
789
|
-
|
|
790
|
-
${snapshot}
|
|
791
|
-
- **Status:** PENDING
|
|
792
|
-
|
|
793
|
-
### CONFLICT_EVENTS
|
|
794
|
-
|
|
795
|
-
#### EVENT_1
|
|
796
|
-
${snapshot}
|
|
797
|
-
|
|
798
|
-
## HUMAN RESOLUTION
|
|
799
|
-
|
|
800
|
-
Update **Status** above to \`RESOLVED\` when done, then provide authoritative JSON:
|
|
801
|
-
|
|
802
|
-
### AUTHORITATIVE_JSON
|
|
803
|
-
\`\`\`json
|
|
804
|
-
{
|
|
805
|
-
"entityType": "${incoming.entityType}",
|
|
806
|
-
"entityId": "${incoming.entityId}",
|
|
807
|
-
"key": "${incoming.key}",
|
|
808
|
-
"value": { "text": "..." },
|
|
809
|
-
"summary": "One sentence summary",
|
|
810
|
-
"notes": "Optional human notes"
|
|
811
|
-
}
|
|
812
|
-
\`\`\`
|
|
786
|
+
return `# Escalation: ${filename}
|
|
787
|
+
|
|
788
|
+
## LIBRARIAN ASSESSMENT
|
|
789
|
+
|
|
790
|
+
${snapshot}
|
|
791
|
+
- **Status:** PENDING
|
|
792
|
+
|
|
793
|
+
### CONFLICT_EVENTS
|
|
794
|
+
|
|
795
|
+
#### EVENT_1
|
|
796
|
+
${snapshot}
|
|
797
|
+
|
|
798
|
+
## HUMAN RESOLUTION
|
|
799
|
+
|
|
800
|
+
Update **Status** above to \`RESOLVED\` when done, then provide authoritative JSON:
|
|
801
|
+
|
|
802
|
+
### AUTHORITATIVE_JSON
|
|
803
|
+
\`\`\`json
|
|
804
|
+
{
|
|
805
|
+
"entityType": "${incoming.entityType}",
|
|
806
|
+
"entityId": "${incoming.entityId}",
|
|
807
|
+
"key": "${incoming.key}",
|
|
808
|
+
"value": { "text": "..." },
|
|
809
|
+
"summary": "One sentence summary",
|
|
810
|
+
"notes": "Optional human notes"
|
|
811
|
+
}
|
|
812
|
+
\`\`\`
|
|
813
813
|
`;
|
|
814
814
|
}
|
|
815
815
|
function buildEscalationUpdateBlock(existing, incoming) {
|
|
@@ -253,19 +253,19 @@ function mapHybridRows(rows) {
|
|
|
253
253
|
}
|
|
254
254
|
async function fetchLexicalCandidateIds(input, db, limit) {
|
|
255
255
|
const filters = buildSearchFilters(input);
|
|
256
|
-
const rows = await db.$queryRaw(client_2.Prisma.sql `
|
|
257
|
-
SELECT kb."id"
|
|
258
|
-
FROM "knowledge_base" kb
|
|
259
|
-
WHERE ${client_2.Prisma.join(filters, ' AND ')}
|
|
260
|
-
AND ts_rank_cd(
|
|
261
|
-
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
262
|
-
websearch_to_tsquery('english', ${input.query})
|
|
263
|
-
) > 0
|
|
264
|
-
ORDER BY ts_rank_cd(
|
|
265
|
-
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
266
|
-
websearch_to_tsquery('english', ${input.query})
|
|
267
|
-
) DESC
|
|
268
|
-
LIMIT ${limit}
|
|
256
|
+
const rows = await db.$queryRaw(client_2.Prisma.sql `
|
|
257
|
+
SELECT kb."id"
|
|
258
|
+
FROM "knowledge_base" kb
|
|
259
|
+
WHERE ${client_2.Prisma.join(filters, ' AND ')}
|
|
260
|
+
AND ts_rank_cd(
|
|
261
|
+
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
262
|
+
websearch_to_tsquery('english', ${input.query})
|
|
263
|
+
) > 0
|
|
264
|
+
ORDER BY ts_rank_cd(
|
|
265
|
+
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
266
|
+
websearch_to_tsquery('english', ${input.query})
|
|
267
|
+
) DESC
|
|
268
|
+
LIMIT ${limit}
|
|
269
269
|
`);
|
|
270
270
|
return rows.map((row) => row.id);
|
|
271
271
|
}
|
|
@@ -326,69 +326,69 @@ async function scoreHybridCandidates(candidateIds, input, db) {
|
|
|
326
326
|
return [];
|
|
327
327
|
}
|
|
328
328
|
const idRows = client_2.Prisma.join(candidateIds);
|
|
329
|
-
return db.$queryRaw(client_2.Prisma.sql `
|
|
330
|
-
WITH candidate_ids AS (
|
|
331
|
-
SELECT UNNEST(ARRAY[${idRows}]::int[]) AS "id"
|
|
332
|
-
)
|
|
333
|
-
SELECT
|
|
334
|
-
kb."id",
|
|
335
|
-
kb."entityType",
|
|
336
|
-
kb."entityId",
|
|
337
|
-
kb."key",
|
|
338
|
-
kb."valueRaw",
|
|
339
|
-
kb."valueSummary",
|
|
340
|
-
kb."confidence",
|
|
341
|
-
kb."source",
|
|
342
|
-
kb."validUntil",
|
|
343
|
-
ts_rank_cd(
|
|
344
|
-
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
345
|
-
websearch_to_tsquery('english', ${input.query})
|
|
346
|
-
) AS "lexicalScore",
|
|
347
|
-
0::float8 AS "vectorScore",
|
|
348
|
-
0::float8 AS "score"
|
|
349
|
-
FROM "knowledge_base" kb
|
|
350
|
-
INNER JOIN candidate_ids c ON c."id" = kb."id"
|
|
329
|
+
return db.$queryRaw(client_2.Prisma.sql `
|
|
330
|
+
WITH candidate_ids AS (
|
|
331
|
+
SELECT UNNEST(ARRAY[${idRows}]::int[]) AS "id"
|
|
332
|
+
)
|
|
333
|
+
SELECT
|
|
334
|
+
kb."id",
|
|
335
|
+
kb."entityType",
|
|
336
|
+
kb."entityId",
|
|
337
|
+
kb."key",
|
|
338
|
+
kb."valueRaw",
|
|
339
|
+
kb."valueSummary",
|
|
340
|
+
kb."confidence",
|
|
341
|
+
kb."source",
|
|
342
|
+
kb."validUntil",
|
|
343
|
+
ts_rank_cd(
|
|
344
|
+
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
345
|
+
websearch_to_tsquery('english', ${input.query})
|
|
346
|
+
) AS "lexicalScore",
|
|
347
|
+
0::float8 AS "vectorScore",
|
|
348
|
+
0::float8 AS "score"
|
|
349
|
+
FROM "knowledge_base" kb
|
|
350
|
+
INNER JOIN candidate_ids c ON c."id" = kb."id"
|
|
351
351
|
`);
|
|
352
352
|
}
|
|
353
353
|
async function lexicalSearch(input, db, limit, minScore, lexicalWeight) {
|
|
354
354
|
const filters = buildSearchFilters(input);
|
|
355
|
-
const rows = await db.$queryRaw(client_2.Prisma.sql `
|
|
356
|
-
WITH scored AS (
|
|
357
|
-
SELECT
|
|
358
|
-
kb."id",
|
|
359
|
-
kb."entityType",
|
|
360
|
-
kb."entityId",
|
|
361
|
-
kb."key",
|
|
362
|
-
kb."valueRaw",
|
|
363
|
-
kb."valueSummary",
|
|
364
|
-
kb."confidence",
|
|
365
|
-
kb."source",
|
|
366
|
-
kb."validUntil",
|
|
367
|
-
ts_rank_cd(
|
|
368
|
-
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
369
|
-
websearch_to_tsquery('english', ${input.query})
|
|
370
|
-
) AS "lexicalScore"
|
|
371
|
-
FROM "knowledge_base" kb
|
|
372
|
-
WHERE ${client_2.Prisma.join(filters, ' AND ')}
|
|
373
|
-
)
|
|
374
|
-
SELECT
|
|
375
|
-
"id",
|
|
376
|
-
"entityType",
|
|
377
|
-
"entityId",
|
|
378
|
-
"key",
|
|
379
|
-
"valueRaw",
|
|
380
|
-
"valueSummary",
|
|
381
|
-
"confidence",
|
|
382
|
-
"source",
|
|
383
|
-
"validUntil",
|
|
384
|
-
"lexicalScore",
|
|
385
|
-
0::float8 AS "vectorScore",
|
|
386
|
-
(${lexicalWeight} * "lexicalScore") AS "score"
|
|
387
|
-
FROM scored
|
|
388
|
-
WHERE "lexicalScore" > 0
|
|
389
|
-
AND (${lexicalWeight} * "lexicalScore") >= ${minScore}
|
|
390
|
-
ORDER BY "score" DESC
|
|
391
|
-
LIMIT ${limit}
|
|
355
|
+
const rows = await db.$queryRaw(client_2.Prisma.sql `
|
|
356
|
+
WITH scored AS (
|
|
357
|
+
SELECT
|
|
358
|
+
kb."id",
|
|
359
|
+
kb."entityType",
|
|
360
|
+
kb."entityId",
|
|
361
|
+
kb."key",
|
|
362
|
+
kb."valueRaw",
|
|
363
|
+
kb."valueSummary",
|
|
364
|
+
kb."confidence",
|
|
365
|
+
kb."source",
|
|
366
|
+
kb."validUntil",
|
|
367
|
+
ts_rank_cd(
|
|
368
|
+
to_tsvector('english', coalesce(kb."key", '') || ' ' || coalesce(kb."valueSummary", '')),
|
|
369
|
+
websearch_to_tsquery('english', ${input.query})
|
|
370
|
+
) AS "lexicalScore"
|
|
371
|
+
FROM "knowledge_base" kb
|
|
372
|
+
WHERE ${client_2.Prisma.join(filters, ' AND ')}
|
|
373
|
+
)
|
|
374
|
+
SELECT
|
|
375
|
+
"id",
|
|
376
|
+
"entityType",
|
|
377
|
+
"entityId",
|
|
378
|
+
"key",
|
|
379
|
+
"valueRaw",
|
|
380
|
+
"valueSummary",
|
|
381
|
+
"confidence",
|
|
382
|
+
"source",
|
|
383
|
+
"validUntil",
|
|
384
|
+
"lexicalScore",
|
|
385
|
+
0::float8 AS "vectorScore",
|
|
386
|
+
(${lexicalWeight} * "lexicalScore") AS "score"
|
|
387
|
+
FROM scored
|
|
388
|
+
WHERE "lexicalScore" > 0
|
|
389
|
+
AND (${lexicalWeight} * "lexicalScore") >= ${minScore}
|
|
390
|
+
ORDER BY "score" DESC
|
|
391
|
+
LIMIT ${limit}
|
|
392
392
|
`);
|
|
393
393
|
return mapHybridRows(rows);
|
|
394
394
|
}
|
|
@@ -688,15 +688,15 @@ async function recordKnowledgeEntryAccess(entryIds, db) {
|
|
|
688
688
|
const client = db ?? (0, client_1.getDb)();
|
|
689
689
|
const decayConfig = (0, decay_1.getDecayConfig)();
|
|
690
690
|
const now = new Date();
|
|
691
|
-
await client.$executeRaw(client_2.Prisma.sql `
|
|
692
|
-
UPDATE "knowledge_base"
|
|
693
|
-
SET
|
|
694
|
-
"lastAccessedAt" = ${now},
|
|
695
|
-
"stability" = LEAST(
|
|
696
|
-
COALESCE("stability", ${decayConfig.stabilityBase}) + ${decayConfig.stabilityIncrement},
|
|
697
|
-
${decayConfig.stabilityMax}
|
|
698
|
-
)
|
|
699
|
-
WHERE "id" IN (${client_2.Prisma.join(ids)})
|
|
691
|
+
await client.$executeRaw(client_2.Prisma.sql `
|
|
692
|
+
UPDATE "knowledge_base"
|
|
693
|
+
SET
|
|
694
|
+
"lastAccessedAt" = ${now},
|
|
695
|
+
"stability" = LEAST(
|
|
696
|
+
COALESCE("stability", ${decayConfig.stabilityBase}) + ${decayConfig.stabilityIncrement},
|
|
697
|
+
${decayConfig.stabilityMax}
|
|
698
|
+
)
|
|
699
|
+
WHERE "id" IN (${client_2.Prisma.join(ids)})
|
|
700
700
|
`);
|
|
701
701
|
}
|
|
702
702
|
// Guards
|
|
@@ -724,10 +724,10 @@ function canWriteToStaffNamespace(createdBy, entityType) {
|
|
|
724
724
|
async function appendConflictLog(entryId, event, db) {
|
|
725
725
|
const client = db ?? (0, client_1.getDb)();
|
|
726
726
|
const eventJson = JSON.stringify(event);
|
|
727
|
-
await client.$executeRaw `
|
|
728
|
-
UPDATE "knowledge_base"
|
|
729
|
-
SET "conflictLog" = COALESCE("conflictLog", '[]'::jsonb) || ${eventJson}::jsonb
|
|
730
|
-
WHERE "id" = ${entryId}
|
|
727
|
+
await client.$executeRaw `
|
|
728
|
+
UPDATE "knowledge_base"
|
|
729
|
+
SET "conflictLog" = COALESCE("conflictLog", '[]'::jsonb) || ${eventJson}::jsonb
|
|
730
|
+
WHERE "id" = ${entryId}
|
|
731
731
|
`;
|
|
732
732
|
}
|
|
733
733
|
// Write Receipts (Idempotency)
|