feat(api): add agent memory module (MS22-DB-002, MS22-API-002)
Some checks failed
ci/woodpecker/push/api Pipeline failed

- Add AgentMemory model to schema.prisma with workspaceId/agentId/key/value
  and @@unique([workspaceId, agentId, key]) constraint
- Add Workspace.agentMemories relation
- Add migration 20260228000000_ms22_agent_memory
- Add AgentMemoryModule with service, controller, DTOs, and unit tests
- Endpoints: PUT/GET/GET/:key/DELETE on /api/agents/:agentId/memory/:key
- Register AgentMemoryModule in app.module.ts
- 10 unit tests passing (service + controller)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 19:35:38 -06:00
parent a3af402f73
commit af23fa685a
11 changed files with 528 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import { LlmUsageModule } from "./llm-usage/llm-usage.module";
import { BrainModule } from "./brain/brain.module";
import { CronModule } from "./cron/cron.module";
import { AgentTasksModule } from "./agent-tasks/agent-tasks.module";
import { AgentMemoryModule } from "./agent-memory/agent-memory.module";
import { ValkeyModule } from "./valkey/valkey.module";
import { BullMqModule } from "./bullmq/bullmq.module";
import { StitcherModule } from "./stitcher/stitcher.module";
@@ -100,6 +101,7 @@ import { RlsContextInterceptor } from "./common/interceptors/rls-context.interce
BrainModule,
CronModule,
AgentTasksModule,
AgentMemoryModule,
RunnerJobsModule,
JobEventsModule,
JobStepsModule,