espace-codage / server /src /core /memory.ts
Abmacode12's picture
Architecture “Rosalinda” (100% propriétaire)
6ce9b06 verified
raw
history blame contribute delete
366 Bytes
```typescript
type Msg = { role: "user" | "assistant" | "system"; content: string };
const mem = new Map<string, Msg[]>();
export function memoryGet(projectId: string): Msg[] {
return mem.get(projectId) ?? [];
}
export function memoryAppend(projectId: string, msg: Msg) {
const arr = mem.get(projectId) ?? [];
arr.push(msg);
mem.set(projectId, arr);
}
```