#Questions about the qmd config and usescase

1 messages · Page 1 of 1 (latest)

trail idol
#
  1. About the exportDir (for my chat history)
        "enabled": true,
        "exportDir": "/chat-history",
        "retentionDays": 90
      },

If i set like this , so that means Openclaw will create new dir inside the workspace dir of my agents for sanitizing the chat history in last 90 days ?
Example: ~/.openclaw/workspace/chat-history/

And EACH OF THE AGENTS will have its own /chat-history/ dir inside its workspace ?

  1. Regarding memory.qmd.path[]
  • I know that is for adding extra directories/files (path, optional pattern, optional stable name).

However, is it we can just add new collection via "qmd add collection" in the shell is enough ? Why need to add these in openclaw.json ?
Please explain the usecase with this and give me best optimized usecase and workflow for this

Thanks @fallen oar

sick warrenBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

fallen oarBOT
#

You’re very close — just one important path detail.

  1. memory.qmd.sessions.exportDir

With this:

sessions: {
enabled: true,
exportDir: "/chat-history",
retentionDays: 90
}

/chat-history is an absolute path at filesystem root (not inside workspace).
So OpenClaw will try to write to /chat-history directly.

#
  • If you want it inside each agent workspace, use a relative path, e.g.:
exportDir: "chat-history"

Then it resolves relative to that agent’s workspace.

Also: retentionDays here applies to the exported sanitized markdown session copies used for QMD recall — not your original session JSONL store.

By default (if exportDir is omitted), session exports go to:

~/.openclaw/agents/<agentId>/qmd/sessions/

So yes, by default it is per-agent.


  1. Why memory.qmd.paths[] in config vs qmd collection add manually?
#

Manual qmd collection add works at QMD CLI level, but OpenClaw’s QMD manager is config-driven:

  • It builds managed collections from memory.qmd.paths[] (+ default memory files, + optional sessions export)
  • It runs periodic qmd update / qmd embed
  • It repairs/rebinds managed collections on boot/update cycles

So if you only add collections manually, OpenClaw may not treat them as managed recall sources in its normal pipeline.

Best workflow (optimized)

  • Keep includeDefaultMemory: true
  • Add only high-signal sources via memory.qmd.paths[]
  • Use stable name values
  • Use tight pattern globs (avoid indexing noisy folders)
  • Enable session exports with a finite retentionDays (30/60/90)

Example:

#
memory: {
backend: "qmd",
qmd: {
includeDefaultMemory: true,
paths: [
{ name: "docs", path: "~/notes/docs", pattern: "**/*.md" },
{ name: "rfc", path: "~/work/rfcs", pattern: "*.md" }
],
sessions: {
enabled: true,
exportDir: "chat-history", // relative -> workspace/chat-history
retentionDays: 90
}
}
}
trail idol
# fallen oar Manual `qmd collection add` works at QMD CLI level, but OpenClaw’s QMD manager i...
  1. after exportDir is setup, the folder is empty => do i need to wait for it to be filled with chat history ?

  2. if we already config those folders in openclaw.json (path[] and exportDir)

{ name: "docs", path: "~/notes/docs", pattern: "**/*.md" },
{ name: "rfc", path: "~/work/rfcs", pattern: "*.md" }
],
sessions: {
enabled: true,
exportDir: "chat-history", // relative -> workspace/chat-history
retentionDays: 90

do we need to manually qmd collection add these folders into the collection for embeding ? (docs, rfcs, chat history etc....)

  1. Do we need to qmd embed ourselves from shell or let openclaw do it ? (would openclaw auto first time do it by itself) ?
#

@fallen oar

fallen oarBOT
#

Yep — short answer:

  1. With exportDir: "/chat-history" No, that is not inside workspace.
    It means absolute path at filesystem root: /chat-history.

If you want workspace-local per agent, use:

exportDir: "chat-history"

Then it becomes <that agent workspace>/chat-history.

So:

  • Different workspace per agent → each agent gets its own chat-history/
  • Shared workspace across agents → they share the same folder
#

Also, retentionDays: 90 prunes the sanitized exported markdown copies for QMD recall, not the original session JSONL files.


  1. qmd collection add manually vs memory.qmd.paths[]

Manual add is possible, but for OpenClaw you should still define sources in openclaw.json because OpenClaw’s QMD manager is config-driven (boot sync, update/embed cycles, managed collection set, repair/rebind behavior).

So best practice:

  • Keep includeDefaultMemory: true
  • Add important external docs in memory.qmd.paths[]
  • Use stable names
  • Use tight glob patterns
  • Enable sessions export + retention if you want recent-chat recall

Docs: