feat: add episodic history recall
Memind CI / Test, build, and release guards (pull_request) Successful in 4m37s
Memind CI / Test, build, and release guards (pull_request) Successful in 4m37s
This commit is contained in:
+28
@@ -212,6 +212,7 @@ import { createSessionSnapshotService } from './session-snapshot.mjs';
|
||||
import { createConversationMemoryService } from './conversation-memory.mjs';
|
||||
import { createManagedMemoryV2Runtime } from './memory-v2-runtime.mjs';
|
||||
import { createMemoryV2AdminConfigService } from './memory-v2-admin-config.mjs';
|
||||
import { createEpisodicMemoryService } from './episodic-memory.mjs';
|
||||
import { createSkillRuntimeAdminConfigService } from './skill-runtime-admin-config.mjs';
|
||||
import { createWechatScheduleLlmConfigService } from './wechat-schedule-llm-config.mjs';
|
||||
import { createExperienceService } from './experience-service.mjs';
|
||||
@@ -380,6 +381,7 @@ let directChatService = null;
|
||||
let sessionSnapshotService = null;
|
||||
let conversationMemoryService = null;
|
||||
let memoryV2 = null;
|
||||
let episodicMemoryService = null;
|
||||
let memoryV2ConfigService = null;
|
||||
let skillRuntimeConfigService = null;
|
||||
let wechatScheduleLlmConfigService = null;
|
||||
@@ -730,9 +732,23 @@ async function bootstrapUserAuth() {
|
||||
configService: memoryV2ConfigService,
|
||||
mysqlPool: pool,
|
||||
});
|
||||
episodicMemoryService = createEpisodicMemoryService(pool, {
|
||||
getEffectiveEnv: async () => {
|
||||
const state = await memoryV2ConfigService.getRuntimeState().catch(() => null);
|
||||
return { ...process.env, ...(state?.overrides ?? {}) };
|
||||
},
|
||||
logger: console,
|
||||
});
|
||||
await episodicMemoryService.ensureSchema().catch((err) => {
|
||||
console.warn(
|
||||
'[episodic-memory] schema setup degraded; snapshot fallback remains available:',
|
||||
err instanceof Error ? err.message : err,
|
||||
);
|
||||
});
|
||||
sessionSnapshotService = createSessionSnapshotService(pool, {
|
||||
conversationMemoryService,
|
||||
memoryV2,
|
||||
episodicMemoryService,
|
||||
});
|
||||
if (isSessionStreamReplayEnabled()) {
|
||||
sessionStreamStore = createSessionStreamStore({ pool });
|
||||
@@ -744,11 +760,13 @@ async function bootstrapUserAuth() {
|
||||
sessionSnapshotService,
|
||||
memoryV2,
|
||||
conversationMemoryService,
|
||||
episodicMemoryService,
|
||||
});
|
||||
chatIntentRouter = createManagedChatIntentRouter({
|
||||
llmProviderService,
|
||||
memoryV2,
|
||||
conversationMemoryService,
|
||||
episodicMemoryService,
|
||||
configService: memoryV2ConfigService,
|
||||
});
|
||||
// GOOSED PROXY BOUNDARY: H5 chat → goosed 唯一入口(Patch 5, goosed-proxy-boundary.mjs)
|
||||
@@ -2223,6 +2241,16 @@ api.get('/runtime/status', async (_req, res) => {
|
||||
}
|
||||
try {
|
||||
const status = await tkmindProxy.getRuntimeStatus();
|
||||
if (episodicMemoryService?.getStatus) {
|
||||
status.memory = {
|
||||
...(status.memory ?? {}),
|
||||
episodic: await episodicMemoryService.getStatus().catch((err) => ({
|
||||
configuredEnabled: false,
|
||||
mode: 'off',
|
||||
error: err instanceof Error ? err.message : String(err),
|
||||
})),
|
||||
};
|
||||
}
|
||||
const toolQueue = agentRunGateway?.getQueueStatus
|
||||
? await agentRunGateway.getQueueStatus().catch((err) => ({
|
||||
error: err instanceof Error ? err.message : String(err),
|
||||
|
||||
Reference in New Issue
Block a user