feat(api): add agent memory module (MS22-DB-002, MS22-API-002)
All checks were successful
ci/woodpecker/push/orchestrator Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
ci/woodpecker/push/api Pipeline was successful

- 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 7b390d8be2
commit fcb2f662e5
11 changed files with 528 additions and 0 deletions

View File

@@ -0,0 +1 @@
export * from "./upsert-agent-memory.dto";

View File

@@ -0,0 +1,10 @@
import { IsNotEmpty } from "class-validator";
/**
* DTO for upserting an agent memory entry.
* The value accepts any JSON-serializable data.
*/
export class UpsertAgentMemoryDto {
@IsNotEmpty({ message: "value must not be empty" })
value!: unknown;
}