Add memory tables to DB schema (preferences, insights with pgvector embedding column, agent_logs, skills, summarization_jobs). Implement PreferencesRepo (CRUD + upsert) and InsightsRepo (CRUD + semantic search + relevance decay). Define VectorStore and EmbeddingProvider interfaces for future provider abstraction. Wire MemoryModule into gateway with REST endpoints at /api/memory/*. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16 lines
424 B
TypeScript
16 lines
424 B
TypeScript
import type { Db } from '@mosaic/db';
|
|
import { createPreferencesRepo, type PreferencesRepo } from './preferences.js';
|
|
import { createInsightsRepo, type InsightsRepo } from './insights.js';
|
|
|
|
export interface Memory {
|
|
preferences: PreferencesRepo;
|
|
insights: InsightsRepo;
|
|
}
|
|
|
|
export function createMemory(db: Db): Memory {
|
|
return {
|
|
preferences: createPreferencesRepo(db),
|
|
insights: createInsightsRepo(db),
|
|
};
|
|
}
|