# MemoryManager

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/memory/memory-manager.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/memory/memory-manager.ts#L45)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `mark` | `mark(memory: SessionMemory, relatedFiles: string[])` | `string` |
| `recall` | `recall(query: Partial<Omit<MemoryQuery, 'projectId'>>)` | `MemoryRecord[]` |
| `extractAndPersist` | `extractAndPersist(ctx: SessionContext)` | `Promise<number>` |
| `formatForContext` | `formatForContext(memories: MemoryRecord[])` | `string` |
| `get` | `get(id: string)` | `MemoryRecord | null` |
| `delete` | `delete(id: string)` | `boolean` |
| `search` | `search(search: string, limit: number)` | `MemoryRecord[]` |
| `consolidate` | `consolidate()` | `ConsolidationReport` |
| `count` | `count()` | `number` |
| `getProjectId` | `getProjectId()` | `string` |

## Where it refuses work

- `MemoryManager` stops the work with `Error` when `!this.modelCall` — “MemoryManager: modelCall is required for extractAndPersist()”.
- `MemoryManager` stops the work with an early return when `!prompt`.
- `MemoryManager` stops the work with an early return when `memories.length === 0`.
