LiyaEngine Docs

Memory

Notes your agents keep across conversations, as plain files you can read, edit, approve and roll back.

Dashboard

Memory is what an agent knows that was not in the message it just received: a customer's usual language, the way your team words a refusal, a fact learned last week. LiyaEngine keeps it as plain-text files in folders, so a person can read exactly what an agent remembers, correct it, and undo a change.

Memory is separate from a single conversation's context. A conversation remembers its recent turns and a short summary (see Sessions and memory). Learned memory is what survives between conversations, and it is off until you turn it on.

Off by default

A project has memory off until someone switches it on, and an agent's learned memory is off until you give it a mode. Nothing is remembered, and no memory tool is offered to a model, until you choose.

How memory is organized

Files live in folders: a shared folder every agent can see, folders for a domain, and a private folder for each agent (agent/<agent id>/). Each file has a short description, a version, and a size, and a project can hold a limited number of files.

Every change is a new version. You can list a file's history, compare two versions, and restore an old one, so a wrong note is never permanent.

What an agent may do

An agent's learned memory mode decides how it uses memory:

ModeThe agent can
off (default)Not use learned memory.
readRead files it is allowed to see.
after_turnRead, and a separate pass after each turn may write what it learned.
when_askedRead, and write when a person asks it to remember something.

You also choose how much memory is brought into each run (a budget) and which folders the agent may read and write. A read-only agent is told so, which stops it claiming it "saved" something it cannot.

Who may write, and what is held

Writes are checked before they happen:

  • Permission rows say who may write where. The longest matching folder prefix wins over the built-in defaults.
  • A write filter refuses secrets, card numbers and identifiers for everyone, and refuses injected instructions from agents. A change that would loosen limits or get around an approval is held.
  • A line a person stated can only be changed by an agent through an approval.

A held change waits as an approval. An admin or owner approves or rejects it, and it expires after 14 days. If the file changed in the meantime, the approval is marked stale instead of overwriting the newer text. A held write answers with HTTP 202.

Curation

The curator reads memory and proposes tidy-ups: merging duplicate lines and rewriting a file's description. It is rule-based and costs nothing. A model-written pass that proposes removing lines is optional and billed. Proposals arrive as approvals; the curator never edits on its own, skips files edited recently, and can run on a nightly schedule you switch on.

In the dashboard

Open Memory:

  • Overview: counts, folders, recent changes and what needs attention.
  • Files: browse, edit, see history and restore. Import and export a project's memory here.
  • Curation: run the curator and decide its proposals.
  • Access: permission rows, the built-in guardrails, sensitive words, and a dry run that shows what a write would do before it happens.
  • Activity: every memory call, with filters, and the conversations behind them.

With the API, SDK and MCP

Memory is available at /v1/memory with an API key. A Read key can list and read; a Full key can also write and restore. Approving a held change is decided by a person in the dashboard.

GET  /v1/memory/files?prefix=shared/        # list files with descriptions
GET  /v1/memory/files/{path}                # one file with its version
PUT  /v1/memory/files/{path}                # { "content": "...", "if_version": 3 }
GET  /v1/memory/history/{path}              # versions, newest first
POST /v1/memory/restore/{path}              # { "version": 2 }
POST /v1/memory/dry-run                     # what would this write do?

Pass if_version when you replace a file you read, so a concurrent change is refused instead of overwritten. The same tools reach an assistant over MCP: memory_list and memory_read need a Read key; memory_write, memory_str_replace and memory_append need a Full key and follow your access rules. The SDKs expose it as client.memory.

On this page