feat(context): add recall fusion and zvec workspace adapters
Introduce RRF-based recall fusion for personal/episodic/temporal paths, zvec-grep workspace shadow probing for code executors, and a local headroom proxy starter aligned with the fusion plan defaults. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,6 +8,10 @@ import {
|
||||
parseCursorAgentUsage,
|
||||
} from './cursor-agent-usage.mjs';
|
||||
import { resolveExecutorDisplayLabel } from './executor-display-label.mjs';
|
||||
import {
|
||||
searchZvecWorkspace,
|
||||
shouldAttachZvecWorkspaceForTask,
|
||||
} from './memind-zvec-workspace.mjs';
|
||||
|
||||
const BASE_CODE_EXECUTORS = ['aider', 'openhands'];
|
||||
|
||||
@@ -226,6 +230,22 @@ export function createToolGateway({
|
||||
throw new Error('Tool Gateway job missing instruction');
|
||||
}
|
||||
const executor = selectExecutor({ userMessage, taskType });
|
||||
const normalizedTaskType = String(taskType ?? userMessage?.metadata?.memindRun?.taskType ?? '').trim();
|
||||
let zvecWorkspace = null;
|
||||
if (shouldAttachZvecWorkspaceForTask(normalizedTaskType, env)) {
|
||||
zvecWorkspace = searchZvecWorkspace({
|
||||
query: instruction,
|
||||
cwd,
|
||||
env,
|
||||
});
|
||||
if (zvecWorkspace.mode === 'shadow' && zvecWorkspace.hitCount > 0) {
|
||||
console.log('[tool-gateway] zvec workspace shadow', {
|
||||
taskType: normalizedTaskType,
|
||||
hitCount: zvecWorkspace.hitCount,
|
||||
top: zvecWorkspace.hits[0],
|
||||
});
|
||||
}
|
||||
}
|
||||
const receiptPath = executor === 'aider'
|
||||
? resolveAiderReceiptPath(userMessage, requestId)
|
||||
: null;
|
||||
@@ -274,6 +294,7 @@ export function createToolGateway({
|
||||
runId,
|
||||
requestId,
|
||||
userId,
|
||||
zvecWorkspace,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -330,6 +351,7 @@ export function createToolGateway({
|
||||
displayStdout: displayStdout || undefined,
|
||||
usage: usage ?? undefined,
|
||||
stderr,
|
||||
zvecWorkspace,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user