Conceptsv3 featuresWorking memory

Working memory

Beta in docs/STATUS.md. Mnemosyne is alpha, on the 3.6.x line, and the API can still change within 3.x.

Postgres is the durable store. Redis sits in front of it for state that is short-lived or read often. Three pieces are wired in the server today.

LayerWhat it holdsRedis keyLifetime
Working memoryPer-agent scratch values, such as the memory ids anticipated at session startmnemo:{ws}:work:{agent}:{key}TTL clamped to 1 to 60 minutes
Session bufferThe turns of open sessions and the set of active sessionsmnemo:{ws}:sess:{id}:turns, mnemo:{ws}:sess:active24 hours, at most 500 turns
Hot tierA sorted set of recently recalled factsmnemo:{ws}:hot:factsDecayed hourly, rebuilt daily

Sources: packages/core/src/session/working-memory.ts, packages/core/src/session/session-buffer.ts and packages/core/src/cognitive/recall-hot.ts.

No REST route or MCP tool reads or writes working memory directly. The server uses it: for example, POST /session/start stages the anticipated memory ids there for 30 minutes.

Caches in Postgres

Two caches live in Postgres, not in Redis, and are used by recall (packages/core/src/cognitive/index.ts):

  • Embedding cache. The embedding of a query text is stored by its hash, so the same text is not embedded twice.
  • Result cache. A query whose embedding has a cosine of at least 0.95 with a query from the last five minutes reuses that query’s result ids. It only applies to default-shaped requests whose hits are all facts, and each cached fact is checked again before it is served.

When Redis is down

PieceBehaviour without Redis
Working memoryFalls back to an in-process map capped at 10 MB; evictions are logged
Session bufferReads and writes go to Postgres
Hot tierCounts as a miss; recall continues with the pointer and cold tiers

Without MNEMO_REDIS_URL the hot tier and rate limiting are off from the start.

See also