Skip to main content
File memory is Xpertโ€™s built-in file-based long-term memory capability. It stores reusable user preferences, project state, feedback corrections, and reference material as Markdown files so agents can retrieve, read, and extend those memories in later conversations. Dreaming is the background organization capability for file memory. Based on existing memories, usage signals, and conversation evidence, it runs a dedicated Dreamer agent to organize memory files and generate traceable run records and reports.

Use Cases

  • Store user preferences, long-lived facts, and personalization that remain valid across conversations.
  • Preserve project background, interim conclusions, business rules, and reusable context.
  • Record user feedback, corrections, and later changes to answer style or business wording.
  • Allow administrators to directly view, edit, and audit agent memory content.

Memory Types

File memory is divided into four categories by purpose. Each Xpert has its own isolated memory space.

File Structure

File memory is organized per Xpert. A typical structure is:
  • MEMORY.md is the memory index, used to quickly browse and recall candidate memories.
  • user/, feedback/, project/, and reference/ store topic files for each memory category.
  • .dream/ stores Dreaming run state, run records, signals, and score caches. By default, it is not foreground memory content.
Each topic file is Markdown with frontmatter. The frontmatter contains the memory ID, type, status, title, summary, tags, source, updated time, and usage statistics. The body stores the concrete content that the agent can read.

How Agents Use File Memory

After the Xpert file memory middleware is enabled, the agent receives these memory tools: The system automatically prepares memory indexes and summaries before the conversation. The agent only needs to call memory_search or memory_get when summaries are insufficient, memories conflict, the user asks for sources, or body-level details are required. File memory is auxiliary context and does not override the userโ€™s current input. If the current input conflicts with memory, the agent should prioritize the current input and explain when a memory may be outdated.

Automatic Recall Configuration

The file memory middleware supports automatic recall of related memories and injects selected content into the current model context. When memories are searched, read, or written, the system records usage signals and updates the usage statistics in topic files and the .dream/scorecards/index.json score cache.

Automatic Writeback

If a conversation turn does not explicitly call memory_write, the system triggers automatic writeback after the conversation ends. Automatic writeback reads the recent conversation and determines whether it contains information worth storing long term. Automatic writeback is suitable for stable facts, explicit preferences, project state, and reusable conclusions. Temporary small talk, unconfirmed guesses, and raw conversation transcripts are not suitable for long-term memory.

File Memory Management Page

After entering the digital expert memory page, choose โ€œFileโ€ to manage file memory. The left side of the page is the file workspace, where you can view MEMORY.md, the four memory directories, and individual topic files. It supports opening, editing, saving, uploading, and deleting files. When manually editing memory files, follow these rules:
  • Keep MEMORY.md as a concise index and do not write long body content into the index.
  • Put topic files in the correct type directory.
  • Keep type, scopeId, status, title, and summary in frontmatter valid.
  • Use status: archived for archived content instead of deleting memories that still have value.

Dreaming Configuration

The top of the file memory page provides Dreaming configuration. โ€œMemory organization agent keyโ€ is not an external API key. It is the identifier of an Agent inside the Dreamer Xpert. The system uses that Agent to read Dreaming evidence, organize memory files, and generate reports.

Running a Dream

Clicking the โ€œDreamโ€ button creates a manual Dream run. The system immediately returns a run ID and continues execution in the background. A Dream run completes the following work:
  1. Create a run record.
  2. Acquire the Dream lock for the current Xpert to avoid multiple Dreams running for the same Xpert at the same time.
  3. Evaluate Dream gate conditions and mark the run as skipped if they are not met.
  4. Prepare evidence files, including memory inventory, signals, score cache, conversation snippets, and instructions.
  5. Run the configured Dreamer Xpert.
  6. Validate organized memory files and MEMORY.md.
  7. Generate the Dream report, validation, changed files, and DREAMS.md record.

Dream Run Status

Dreams for the same Xpert run serially. If a run is already in progress, a new trigger reuses or enters a waiting state. Dreams for different Xperts can run independently.

Viewing Dream Results

The right side of the file memory page shows the Dream runs list. After selecting a run, you can view:
  • Run status, start time, end time, changed file count, and issue count.
  • Gate decision result, new or updated memory count, related session count, and skip reason.
  • Preflight report.
  • Dream report, including organization summary, changed files, and unresolved conflicts.
  • Validation result.
  • Run artifacts, including status.json, request.json, evidence/, gate.json, dream-report.json, validation.json, and changed-files.json.
When the run status is partial, first review validation and unresolved conflicts, then fix frontmatter, index links, duplicate titles, or other issues according to the prompts.

Current Validation Rules

After Dreaming completes, the system validates the memory file structure. Current coverage includes:
  • Whether the Xpert scope in topic file frontmatter matches the current Xpert.
  • Whether duplicate titles exist.
  • Whether there are topic files that cannot be parsed.
  • Whether MEMORY.md links point to valid memory paths.
  • Whether MEMORY.md references missing, duplicate, or archived topic files.
  • Whether MEMORY.md contains overly long index entries or content that looks like body text.
When validation passes, the run status is succeeded. When issues exist, the run status is partial, and the page displays the items that need handling. The file memory page uses these APIs:

Recommendations

  • Store stable, reusable information in file memory and avoid saving temporary small talk.
  • Keep each topic file focused on a single topic, with a clear title and summary.
  • After bulk imports or multi-turn conversations, manually run Dream to organize memories.
  • When a Dream report contains conflicts, fix the issues listed in validation before running the next Dream.
  • Prefer saving key business wording in reference or project memory for easier later retrieval and auditing.